From 9f2bbe9bcbc4468029b04383279bb5c35963c8a4 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Thu, 18 Jan 2018 18:36:33 +0100 Subject: Fix flag deprecation warning. Partial cherry-pick of 84baa1c3d8f996f7daf2d8aa3d26197378218f21 from rocko. --- scripts/qemucommand.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 9a893d8..7ae9381 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py @@ -96,7 +96,7 @@ class QemuCommand(object): "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, "-m", "1G", "-usb", - "-usbdevice", "tablet", + "-device", "usb-tablet", "-show-cursor", "-vga", "std", "-net", netuser, -- cgit v1.2.3-54-g00ecf From c2e9fcc8744b6c1f1af5941fd7d4546273361a91 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 19 Jan 2018 14:12:22 +0100 Subject: Add a helpful hint for the oe-selftest grub problem. Partial cherry-pick of b605cf215ff4cef35c3f62fee0ec14e3c8d5ba22 from rocko. --- lib/oeqa/selftest/updater.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py index f28349f..b435d1b 100644 --- a/lib/oeqa/selftest/updater.py +++ b/lib/oeqa/selftest/updater.py @@ -161,7 +161,8 @@ class GrubTests(oeSelfTest): # Strip off line ending. value_str = value.decode()[:-1] self.assertEqual(value_str, machine, - 'MACHINE does not match hostname: ' + machine + ', ' + value_str) + 'MACHINE does not match hostname: ' + machine + ', ' + value_str + + '\nIs tianocore ovmf installed?') print(value_str) -- cgit v1.2.3-54-g00ecf From 3a4bdbcae17b1b2f2197c61a0d188336767e1c60 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Fri, 1 Dec 2017 11:56:51 +0100 Subject: Add tests for aktualizr-info. Cherry-pick of c64b399633975bc05856e5eded519c4f22adfe44 from rocko. --- lib/oeqa/selftest/updater.py | 56 +++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py index b435d1b..0962cb7 100644 --- a/lib/oeqa/selftest/updater.py +++ b/lib/oeqa/selftest/updater.py @@ -1,8 +1,9 @@ -import unittest +# pylint: disable=C0111,C0325 import os import logging import subprocess -import time +import unittest +from time import sleep from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars @@ -49,11 +50,11 @@ class GeneralTests(oeSelfTest): def test_feature_sota(self): result = get_bb_var('DISTRO_FEATURES').find('sota') - self.assertNotEqual(result, -1, 'Feature "sota" not set at DISTRO_FEATURES'); + self.assertNotEqual(result, -1, 'Feature "sota" not set at DISTRO_FEATURES') def test_feature_systemd(self): result = get_bb_var('DISTRO_FEATURES').find('systemd') - self.assertNotEqual(result, -1, 'Feature "systemd" not set at DISTRO_FEATURES'); + self.assertNotEqual(result, -1, 'Feature "systemd" not set at DISTRO_FEATURES') def test_credentials(self): bitbake('core-image-minimal') @@ -66,7 +67,8 @@ class GeneralTests(oeSelfTest): deploydir = get_bb_var('DEPLOY_DIR_IMAGE') imagename = get_bb_var('IMAGE_LINK_NAME', 'core-image-minimal') # Check if the credentials are included in the output image - result = runCmd('tar -jtvf %s/%s.tar.bz2 | grep sota_provisioning_credentials.zip' % (deploydir, imagename), ignore_status=True) + result = runCmd('tar -jtvf %s/%s.tar.bz2 | grep sota_provisioning_credentials.zip' % + (deploydir, imagename), ignore_status=True) self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) def test_java(self): @@ -99,7 +101,7 @@ class GeneralTests(oeSelfTest): self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /usr/bin/man') path2 = os.path.realpath(image_path) size2 = os.path.getsize(path2) - logger.info('Second image %s has size %i' % (path2, size2)) + logger.info('Second image %s has size %i', path2, size2) self.assertNotEqual(path1, path2, "Image paths are identical; image was not rebuilt.") self.assertNotEqual(size1, size2, "Image sizes are identical; image was not rebuilt.") @@ -114,14 +116,17 @@ class QemuTests(oeSelfTest): def tearDownClass(cls): qemu_terminate(cls.s) + def run_command(self, command): + return qemu_send_command(self.qemu.ssh_port, command) + def test_hostname(self): print('') print('Checking machine name (hostname) of device:') - value, err = qemu_send_command(self.qemu.ssh_port, 'hostname') + stdout, stderr, retcode = self.run_command('hostname') machine = get_bb_var('MACHINE', 'core-image-minimal') - self.assertEqual(err, b'', 'Error: ' + err.decode()) + self.assertEqual(stderr, b'', 'Error: ' + stderr.decode()) # Strip off line ending. - value_str = value.decode()[:-1] + value_str = stdout.decode()[:-1] self.assertEqual(value_str, machine, 'MACHINE does not match hostname: ' + machine + ', ' + value_str) print(value_str) @@ -129,9 +134,26 @@ class QemuTests(oeSelfTest): def test_var_sota(self): print('') print('Checking contents of /var/sota:') - value, err = qemu_send_command(self.qemu.ssh_port, 'ls /var/sota') - self.assertEqual(err, b'', 'Error: ' + err.decode()) - print(value.decode()) + stdout, stderr, retcode = self.run_command('ls /var/sota') + self.assertEqual(stderr, b'', 'Error: ' + stderr.decode()) + self.assertEqual(retcode, 0) + print(stdout.decode()) + + def test_aktualizr_info(self): + print('Checking output of aktualizr-info:') + ran_ok = False + for delay in [0, 1, 2, 5, 10, 15]: + sleep(delay) + try: + stdout, stderr, retcode = self.run_command('aktualizr-info') + if retcode == 0 and stderr == b'': + ran_ok = True + break + except IOError as e: + print(e) + if not ran_ok: + print(stdout.decode()) + print(stderr.decode()) class GrubTests(oeSelfTest): @@ -155,9 +177,10 @@ class GrubTests(oeSelfTest): def test_grub(self): print('') print('Checking machine name (hostname) of device:') - value, err = qemu_send_command(self.qemu.ssh_port, 'hostname') + value, err, retcode = qemu_send_command(self.qemu.ssh_port, 'hostname') machine = get_bb_var('MACHINE', 'core-image-minimal') self.assertEqual(err, b'', 'Error: ' + err.decode()) + self.assertEqual(retcode, 0) # Strip off line ending. value_str = value.decode()[:-1] self.assertEqual(value_str, machine, @@ -190,7 +213,7 @@ def qemu_launch(efi=False, machine=None): cmdline = qemu.command_line() print('Booting image with run-qemu-ota...') s = subprocess.Popen(cmdline) - time.sleep(10) + sleep(10) return qemu, s def qemu_terminate(s): @@ -203,6 +226,7 @@ def qemu_send_command(port, command): command = ['ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost -p ' + str(port) + ' "' + command + '"'] s2 = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - value, err = s2.communicate() - return value, err + stdout, stderr = s2.communicate() + return stdout, stderr, s2.returncode +# vim:set ts=4 sw=4 sts=4 expandtab: -- cgit v1.2.3-54-g00ecf From 2dbeaf315ff9cf8cce1d0a3276fd561163db6237 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Tue, 13 Feb 2018 17:06:51 +0100 Subject: Fix minor ovmf compilation bug only present in pyro. This does not appear to be a problem on rocko, and it wasn't a problem for me on pyro when I last checked less than a month ago. It actually only broke the native build. This has been fixed upstream at some point, anyway. --- ...e-c-string-with-NULL-instead-of-a-literal.patch | 25 ++++++++++++++++++++++ recipes-core/ovmf/ovmf_%.bbappend | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 recipes-core/ovmf/files/0001-Compare-c-string-with-NULL-instead-of-a-literal.patch create mode 100644 recipes-core/ovmf/ovmf_%.bbappend diff --git a/recipes-core/ovmf/files/0001-Compare-c-string-with-NULL-instead-of-a-literal.patch b/recipes-core/ovmf/files/0001-Compare-c-string-with-NULL-instead-of-a-literal.patch new file mode 100644 index 0000000..6bdaf7e --- /dev/null +++ b/recipes-core/ovmf/files/0001-Compare-c-string-with-NULL-instead-of-a-literal.patch @@ -0,0 +1,25 @@ +From 6c730f3da7490ffbba5ad17af29ca44ed167cbfc Mon Sep 17 00:00:00 2001 +From: Patrick Vacek +Date: Tue, 13 Feb 2018 16:38:15 +0100 +Subject: [PATCH] Compare c-string with NULL instead of a literal. + +--- + BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +index 3ca57ed741..4fa066dd9f 100644 +--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp ++++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +@@ -3372,7 +3372,7 @@ CVfrStringDB::GetVarStoreNameFormStringId ( + UINT8 BlockType; + EFI_HII_STRING_PACKAGE_HDR *PkgHeader; + +- if (mStringFileName == '\0' ) { ++ if (mStringFileName == NULL ) { + return NULL; + } + +-- +2.14.1 + diff --git a/recipes-core/ovmf/ovmf_%.bbappend b/recipes-core/ovmf/ovmf_%.bbappend new file mode 100644 index 0000000..142fc53 --- /dev/null +++ b/recipes-core/ovmf/ovmf_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append = "file://0001-Compare-c-string-with-NULL-instead-of-a-literal.patch" -- cgit v1.2.3-54-g00ecf