diff options
Diffstat (limited to 'lib')
| l--------- | lib/oeqa/selftest/qemucommand.py | 1 | ||||
| -rw-r--r-- | lib/oeqa/selftest/updater.py | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/qemucommand.py b/lib/oeqa/selftest/qemucommand.py new file mode 120000 index 0000000..bc06dde --- /dev/null +++ b/lib/oeqa/selftest/qemucommand.py | |||
| @@ -0,0 +1 @@ | |||
| ../../../scripts/qemucommand.py \ No newline at end of file | |||
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 | ||
| 5 | from oeqa.selftest.base import oeSelfTest | 5 | from oeqa.selftest.base import oeSelfTest |
| 6 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var | 6 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var |
| 7 | import subprocess | ||
| 8 | from oeqa.selftest.qemucommand import QemuCommand | ||
| 9 | import time | ||
| 7 | 10 | ||
| 8 | class UpdaterTests(oeSelfTest): | 11 | class 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 | ||
