diff options
| author | Ross Burton <ross.burton@intel.com> | 2017-10-31 20:59:09 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-05 22:33:23 +0000 |
| commit | 01a050ebffdab33eb52c90d4f516d680d569bf48 (patch) | |
| tree | 7697ab0ffdec84e98dfeb6b33b41c447849d0b1d | |
| parent | 9fea8088e95c3894cba95b5f2d0845de90a529d2 (diff) | |
| download | poky-01a050ebffdab33eb52c90d4f516d680d569bf48.tar.gz | |
oeqa/selftest/runtime: force empty root password, use helpers to access qemu
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/runtime_test.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index 7d105f2fed..7ce81c3ff0 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | from oeqa.selftest.case import OESelftestTestCase | 1 | from oeqa.selftest.case import OESelftestTestCase |
| 2 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu | 2 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu |
| 3 | from oeqa.utils.sshcontrol import SSHControl | ||
| 3 | from oeqa.core.decorator.oeid import OETestID | 4 | from oeqa.core.decorator.oeid import OETestID |
| 4 | import os | 5 | import os |
| 5 | import re | 6 | import re |
| @@ -243,7 +244,7 @@ postinst-delayed-t \ | |||
| 243 | with self.subTest(init_manager=init_manager, package_class=classes): | 244 | with self.subTest(init_manager=init_manager, package_class=classes): |
| 244 | features = 'MACHINE = "qemux86"\n' | 245 | features = 'MACHINE = "qemux86"\n' |
| 245 | features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg) | 246 | features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg) |
| 246 | features += 'IMAGE_FEATURES += "ssh-server-openssh"\n' | 247 | features += 'IMAGE_FEATURES += "empty-root-password ssh-server-openssh"\n' |
| 247 | features += 'PACKAGE_CLASSES = "%s"\n' % classes | 248 | features += 'PACKAGE_CLASSES = "%s"\n' % classes |
| 248 | if init_manager == "systemd": | 249 | if init_manager == "systemd": |
| 249 | features += 'DISTRO_FEATURES_append = " systemd"\n' | 250 | features += 'DISTRO_FEATURES_append = " systemd"\n' |
| @@ -262,6 +263,6 @@ postinst-delayed-t \ | |||
| 262 | 263 | ||
| 263 | testcommand = 'ls /etc/' + fileboot_name | 264 | testcommand = 'ls /etc/' + fileboot_name |
| 264 | with runqemu('core-image-minimal') as qemu: | 265 | with runqemu('core-image-minimal') as qemu: |
| 265 | sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' | 266 | ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog) |
| 266 | result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand)) | 267 | status, output = ssh.run(testcommand) |
| 267 | self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name) | 268 | self.assertEqual(status, 0, 'File %s was not created at first boot (%s)' % (fileboot_name, output)) |
