summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/runtime_test.py60
1 files changed, 27 insertions, 33 deletions
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 2a70ae15b8..72f906deea 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -223,37 +223,31 @@ postinst-delayed-t \
223 fileboot_name = "this-was-created-at-first-boot" 223 fileboot_name = "this-was-created-at-first-boot"
224 rootfs_pkg = 'postinst-at-rootfs' 224 rootfs_pkg = 'postinst-at-rootfs'
225 boot_pkg = 'postinst-delayed-a' 225 boot_pkg = 'postinst-delayed-a'
226 #Step 1 226
227 common_features = 'MACHINE = "qemux86"\n'
228 common_features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg)
229 common_features += 'IMAGE_FEATURES += "ssh-server-openssh"\n'
230 for init_manager in ("sysvinit", "systemd"): 227 for init_manager in ("sysvinit", "systemd"):
231 #for sysvinit no extra configuration is needed, 228 for classes in ("package_rpm", "package_deb", "package_ipk"):
232 features = '' 229 with self.subTest(init_manager=init_manager, package_class=classes):
233 if (init_manager is "systemd"): 230 features = 'MACHINE = "qemux86"\n'
234 features += 'DISTRO_FEATURES_append = " systemd"\n' 231 features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg)
235 features += 'VIRTUAL-RUNTIME_init_manager = "systemd"\n' 232 features += 'IMAGE_FEATURES += "ssh-server-openssh"\n'
236 features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"\n' 233 features += 'PACKAGE_CLASSES = "%s"\n' % classes
237 features += 'VIRTUAL-RUNTIME_initscripts = ""\n' 234 if init_manager == "systemd":
238 for classes in ("package_rpm package_deb package_ipk", 235 features += 'DISTRO_FEATURES_append = " systemd"\n'
239 "package_deb package_rpm package_ipk", 236 features += 'VIRTUAL-RUNTIME_init_manager = "systemd"\n'
240 "package_ipk package_deb package_rpm"): 237 features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"\n'
241 features += 'PACKAGE_CLASSES = "%s"\n' % classes 238 features += 'VIRTUAL-RUNTIME_initscripts = ""\n'
242 self.write_config(common_features + features) 239 self.write_config(features)
243 240
244 #Step 2 241 bitbake('core-image-minimal')
245 bitbake('core-image-minimal') 242
246 243 file_rootfs_created = os.path.join(get_bb_var('IMAGE_ROOTFS', "core-image-minimal"),
247 #Step 3 244 file_rootfs_name)
248 file_rootfs_created = os.path.join(get_bb_var('IMAGE_ROOTFS',"core-image-minimal"), 245 found = os.path.isfile(file_rootfs_created)
249 file_rootfs_name) 246 self.assertTrue(found, "File %s was not created at rootfs time by %s" % \
250 found = os.path.isfile(file_rootfs_created) 247 (file_rootfs_name, rootfs_pkg))
251 self.assertTrue(found, "File %s was not created at rootfs time by %s" % \ 248
252 (file_rootfs_name, rootfs_pkg)) 249 testcommand = 'ls /etc/' + fileboot_name
253 250 with runqemu('core-image-minimal') as qemu:
254 #Step 4 251 sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
255 testcommand = 'ls /etc/'+fileboot_name 252 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
256 with runqemu('core-image-minimal') as qemu: 253 self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name)
257 sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
258 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
259 self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name)