summaryrefslogtreecommitdiffstats
path: root/lib/oeqa/selftest/updater.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oeqa/selftest/updater.py')
-rw-r--r--lib/oeqa/selftest/updater.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py
index e9048fd..4cdd1a2 100644
--- a/lib/oeqa/selftest/updater.py
+++ b/lib/oeqa/selftest/updater.py
@@ -4,6 +4,9 @@ import logging
4 4
5from oeqa.selftest.base import oeSelfTest 5from oeqa.selftest.base import oeSelfTest
6from oeqa.utils.commands import runCmd, bitbake, get_bb_var 6from oeqa.utils.commands import runCmd, bitbake, get_bb_var
7import subprocess
8from oeqa.selftest.qemucommand import QemuCommand
9import time
7 10
8class UpdaterTests(oeSelfTest): 11class UpdaterTests(oeSelfTest):
9 12
@@ -39,3 +42,33 @@ class UpdaterTests(oeSelfTest):
39 def test_hsm(self): 42 def test_hsm(self):
40 self.write_config('SOTA_CLIENT_FEATURES="hsm hsm-test"') 43 self.write_config('SOTA_CLIENT_FEATURES="hsm hsm-test"')
41 bitbake('core-image-minimal') 44 bitbake('core-image-minimal')
45
46 def test_qemu(self):
47 print('')
48 # Create empty object.
49 args = type('', (), {})()
50 args.imagename = 'core-image-minimal'
51 args.mac = None
52 args.dir = 'tmp/deploy/images'
53 args.efi = False
54 args.machine = None
55 args.no_kvm = False
56 args.no_gui = True
57 args.gdb = False
58 args.pcap = None
59 args.overlay = None
60 args.dry_run = False
61
62 qemu_command = QemuCommand(args)
63 cmdline = qemu_command.command_line()
64 print('Booting image with run-qemu-ota...')
65 s = subprocess.Popen(cmdline)
66 time.sleep(10)
67 print('Machine name (hostname) of device is:')
68 ssh_cmd = ['ssh', '-q', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', 'root@localhost', '-p', str(qemu_command.ssh_port), 'hostname']
69 s2 = subprocess.Popen(ssh_cmd)
70 time.sleep(5)
71 try:
72 s.terminate()
73 except KeyboardInterrupt:
74 pass