selftest/runtime-tests: Modify positins test to reduce execution time

Currently test_postinst_roofs_and_boot is building a full-cmdline image
this is taking a lot of time to execute the test, so a minimal image
will be build instead.

(From OE-Core rev: 3a6b0b9f94b7097a825edf3fe258a2f86b73edd6)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jose Perez Carranza
2017-01-30 07:48:09 -06:00
committed by Richard Purdie
parent 42eace0770
commit 383fc7df31

View File

@@ -176,7 +176,7 @@ postinst-delayed-t \
that script can be delayed to run at first boot. that script can be delayed to run at first boot.
Dependencies: NA Dependencies: NA
Steps: 1. Add proper configuration to local.conf file Steps: 1. Add proper configuration to local.conf file
2. Build a "core-image-full-cmdline" image 2. Build a "core-image-minimal" image
3. Verify that file created by postinst_rootfs recipe is 3. Verify that file created by postinst_rootfs recipe is
present on rootfs dir. present on rootfs dir.
4. Boot the image created on qemu and verify that the file 4. Boot the image created on qemu and verify that the file
@@ -195,6 +195,7 @@ postinst-delayed-t \
#Step 1 #Step 1
features = 'MACHINE = "qemux86"\n' features = 'MACHINE = "qemux86"\n'
features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg) features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg)
features += 'IMAGE_FEATURES += "ssh-server-openssh"\n'
for init_manager in ("sysvinit", "systemd"): for init_manager in ("sysvinit", "systemd"):
#for sysvinit no extra configuration is needed, #for sysvinit no extra configuration is needed,
if (init_manager is "systemd"): if (init_manager is "systemd"):
@@ -209,10 +210,10 @@ postinst-delayed-t \
self.write_config(features) self.write_config(features)
#Step 2 #Step 2
bitbake('core-image-full-cmdline') bitbake('core-image-minimal')
#Step 3 #Step 3
file_rootfs_created = os.path.join(get_bb_var('IMAGE_ROOTFS',"core-image-full-cmdline"), file_rootfs_created = os.path.join(get_bb_var('IMAGE_ROOTFS',"core-image-minimal"),
file_rootfs_name) file_rootfs_name)
found = os.path.isfile(file_rootfs_created) found = os.path.isfile(file_rootfs_created)
self.assertTrue(found, "File %s was not created at rootfs time by %s" % \ self.assertTrue(found, "File %s was not created at rootfs time by %s" % \
@@ -220,11 +221,11 @@ postinst-delayed-t \
#Step 4 #Step 4
testcommand = 'ls /etc/'+fileboot_name testcommand = 'ls /etc/'+fileboot_name
with runqemu('core-image-full-cmdline') as qemu: with runqemu('core-image-minimal') as qemu:
sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand)) result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name) self.assertEqual(result.status, 0, 'File %s was not created at firts boot'% fileboot_name)
#Step 5 #Step 5
bitbake(' %s %s -c cleanall' % (rootfs_pkg, boot_pkg)) bitbake(' %s %s -c cleanall' % (rootfs_pkg, boot_pkg))
bitbake('core-image-full-cmdline -c cleanall') bitbake('core-image-minimal -c cleanall')