* [PATCH] oeqa/selftest/runtime_test: fix postinst_rootfs_and_boot
@ 2017-11-06 17:55 Ross Burton
2017-11-14 12:06 ` Patrick Ohly
0 siblings, 1 reply; 4+ messages in thread
From: Ross Burton @ 2017-11-06 17:55 UTC (permalink / raw)
To: openembedded-core
This test overrides IMAGE_FEATURES but failed to include package-management,
which is essential for postinsts to work under dpkg.
Also rewrite the file existence check to use a console login not SSH for
simplicity.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oeqa/selftest/cases/runtime_test.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 7ce81c3ff0f..25270b7535b 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -244,7 +244,7 @@ postinst-delayed-t \
with self.subTest(init_manager=init_manager, package_class=classes):
features = 'MACHINE = "qemux86"\n'
features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg)
- features += 'IMAGE_FEATURES += "empty-root-password ssh-server-openssh"\n'
+ features += 'IMAGE_FEATURES += "package-management empty-root-password"\n'
features += 'PACKAGE_CLASSES = "%s"\n' % classes
if init_manager == "systemd":
features += 'DISTRO_FEATURES_append = " systemd"\n'
@@ -263,6 +263,5 @@ postinst-delayed-t \
testcommand = 'ls /etc/' + fileboot_name
with runqemu('core-image-minimal') as qemu:
- ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog)
- status, output = ssh.run(testcommand)
+ status, output = qemu.run_serial("-f /etc/" + fileboot_name)
self.assertEqual(status, 0, 'File %s was not created at first boot (%s)' % (fileboot_name, output))
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] oeqa/selftest/runtime_test: fix postinst_rootfs_and_boot
@ 2017-11-07 10:32 Ross Burton
0 siblings, 0 replies; 4+ messages in thread
From: Ross Burton @ 2017-11-07 10:32 UTC (permalink / raw)
To: openembedded-core
This test overrides IMAGE_FEATURES but failed to include package-management,
which is essential for postinsts to work under dpkg.
Also rewrite the file existence check to use a console login not SSH for
simplicity.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oeqa/selftest/cases/runtime_test.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 7ce81c3ff0f..25270b7535b 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -244,7 +244,7 @@ postinst-delayed-t \
with self.subTest(init_manager=init_manager, package_class=classes):
features = 'MACHINE = "qemux86"\n'
features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, boot_pkg)
- features += 'IMAGE_FEATURES += "empty-root-password ssh-server-openssh"\n'
+ features += 'IMAGE_FEATURES += "package-management empty-root-password"\n'
features += 'PACKAGE_CLASSES = "%s"\n' % classes
if init_manager == "systemd":
features += 'DISTRO_FEATURES_append = " systemd"\n'
@@ -263,6 +263,5 @@ postinst-delayed-t \
testcommand = 'ls /etc/' + fileboot_name
with runqemu('core-image-minimal') as qemu:
- ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog)
- status, output = ssh.run(testcommand)
+ status, output = qemu.run_serial("-f /etc/" + fileboot_name)
self.assertEqual(status, 0, 'File %s was not created at first boot (%s)' % (fileboot_name, output))
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] oeqa/selftest/runtime_test: fix postinst_rootfs_and_boot
2017-11-06 17:55 [PATCH] oeqa/selftest/runtime_test: fix postinst_rootfs_and_boot Ross Burton
@ 2017-11-14 12:06 ` Patrick Ohly
2017-11-14 12:45 ` Burton, Ross
0 siblings, 1 reply; 4+ messages in thread
From: Patrick Ohly @ 2017-11-14 12:06 UTC (permalink / raw)
To: Ross Burton, openembedded-core
On Mon, 2017-11-06 at 17:55 +0000, Ross Burton wrote:
> testcommand = 'ls /etc/' + fileboot_name
Can't this be removed?
> with runqemu('core-image-minimal') as qemu:
> - ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog)
> - status, output = ssh.run(testcommand)
> + status, output = qemu.run_serial("-f /etc/" + fileboot_name)
Did you mean "test -f"?
> self.assertEqual(status, 0, 'File %s was not created at first boot (%s)' % (fileboot_name, output))
run_serial has the quirk that status == 1 on *success*. Yes, weird.
The test probably passed because it was testing for failure, and the
missing "test" ensured that the command failed.
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] oeqa/selftest/runtime_test: fix postinst_rootfs_and_boot
2017-11-14 12:06 ` Patrick Ohly
@ 2017-11-14 12:45 ` Burton, Ross
0 siblings, 0 replies; 4+ messages in thread
From: Burton, Ross @ 2017-11-14 12:45 UTC (permalink / raw)
To: Patrick Ohly; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
On 14 November 2017 at 12:06, Patrick Ohly <patrick.ohly@intel.com> wrote:
> On Mon, 2017-11-06 at 17:55 +0000, Ross Burton wrote:
> > testcommand = 'ls /etc/' + fileboot_name
>
> Can't this be removed?
>
> > with runqemu('core-image-minimal') as qemu:
> > - ssh = SSHControl(ip=qemu.ip,
> logfile=qemu.sshlog)
> > - status, output = ssh.run(testcommand)
> > + status, output = qemu.run_serial("-f /etc/" +
> fileboot_name)
>
> Did you mean "test -f"?
Yes! Argh.
>
> > self.assertEqual(status, 0, 'File %s was not
> created at first boot (%s)' % (fileboot_name, output))
>
> run_serial has the quirk that status == 1 on *success*. Yes, weird.
>
Oh <redacted>.
> The test probably passed because it was testing for failure, and the
> missing "test" ensured that the command failed.
>
Thanks. Sorry.
Ross
[-- Attachment #2: Type: text/html, Size: 1921 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-14 12:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06 17:55 [PATCH] oeqa/selftest/runtime_test: fix postinst_rootfs_and_boot Ross Burton
2017-11-14 12:06 ` Patrick Ohly
2017-11-14 12:45 ` Burton, Ross
-- strict thread matches above, loose matches on Subject: below --
2017-11-07 10:32 Ross Burton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.