summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/bbconfigbuild/configfragments.py4
-rw-r--r--meta/lib/oe/recipeutils.py2
-rw-r--r--meta/lib/oeqa/core/target/ssh.py12
-rw-r--r--meta/lib/oeqa/runtime/cases/logrotate.py7
-rw-r--r--meta/lib/oeqa/runtime/cases/ssh.py2
-rw-r--r--meta/lib/oeqa/runtime/cases/weston.py2
-rw-r--r--meta/lib/oeqa/sdk/cases/autotools.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/bblayers.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/bblock.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/buildhistory.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/fitimage.py26
-rw-r--r--meta/lib/oeqa/selftest/cases/meta_ide.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/oescripts.py4
-rw-r--r--meta/lib/oeqa/selftest/cases/sstatetests.py34
-rw-r--r--meta/lib/oeqa/selftest/context.py4
-rw-r--r--meta/lib/oeqa/utils/postactions.py4
16 files changed, 66 insertions, 51 deletions
diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py
index 34c6a3b4bc..21baedc9a4 100644
--- a/meta/lib/bbconfigbuild/configfragments.py
+++ b/meta/lib/bbconfigbuild/configfragments.py
@@ -115,7 +115,7 @@ class ConfigFragmentsPlugin(LayerPlugin):
115 def create_conf(self, confpath): 115 def create_conf(self, confpath):
116 if not os.path.exists(confpath): 116 if not os.path.exists(confpath):
117 with open(confpath, 'w') as f: 117 with open(confpath, 'w') as f:
118 f.write('') 118 f.write('# Automated config file controlled by tools\n')
119 with open(confpath, 'r') as f: 119 with open(confpath, 'r') as f:
120 lines = f.read() 120 lines = f.read()
121 if "OE_FRAGMENTS += " not in lines: 121 if "OE_FRAGMENTS += " not in lines:
@@ -184,7 +184,7 @@ class ConfigFragmentsPlugin(LayerPlugin):
184 print("All fragments removed from {}.".format(args.confpath)) 184 print("All fragments removed from {}.".format(args.confpath))
185 185
186 def register_commands(self, sp): 186 def register_commands(self, sp):
187 default_confpath = os.path.join(os.environ["BBPATH"], "conf/auto.conf") 187 default_confpath = os.path.join(os.environ["BBPATH"], "conf/toolcfg.conf")
188 188
189 parser_list_fragments = self.add_command(sp, 'list-fragments', self.do_list_fragments, parserecipes=False) 189 parser_list_fragments = self.add_command(sp, 'list-fragments', self.do_list_fragments, parserecipes=False)
190 parser_list_fragments.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath)) 190 parser_list_fragments.add_argument("--confpath", default=default_confpath, help='Configuration file which contains a list of enabled fragments (default is {}).'.format(default_confpath))
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 102789ce73..54bc3d7666 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -1073,7 +1073,7 @@ def get_recipe_upstream_version(rd):
1073 upversion = None 1073 upversion = None
1074 revision = None 1074 revision = None
1075 try: 1075 try:
1076 revision = ud.method.latest_revision(ud, rd, 'default') 1076 revision = ud.method.latest_revision(ud, rd, ud.name)
1077 upversion = pv 1077 upversion = pv
1078 if revision != ud.revision: 1078 if revision != ud.revision:
1079 upversion = upversion + "-new-commits-available" 1079 upversion = upversion + "-new-commits-available"
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index 8b5c450a05..0ac3ae4388 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -55,7 +55,7 @@ class OESSHTarget(OETarget):
55 def stop(self, **kwargs): 55 def stop(self, **kwargs):
56 pass 56 pass
57 57
58 def _run(self, command, timeout=None, ignore_status=True, raw=False): 58 def _run(self, command, timeout=None, ignore_status=True, raw=False, ignore_ssh_fails=False):
59 """ 59 """
60 Runs command in target using SSHProcess. 60 Runs command in target using SSHProcess.
61 """ 61 """
@@ -66,13 +66,17 @@ class OESSHTarget(OETarget):
66 self.logger.debug("[Command returned '%d' after %.2f seconds]" 66 self.logger.debug("[Command returned '%d' after %.2f seconds]"
67 "" % (status, time.time() - starttime)) 67 "" % (status, time.time() - starttime))
68 68
69 if status and not ignore_status: 69 if status == 255 and not ignore_ssh_fails:
70 raise AssertionError("ssh exited with status '255' for command "
71 "'%s': this is likely an SSH failure\n%s"
72 % (command, output))
73 elif status and not ignore_status:
70 raise AssertionError("Command '%s' returned non-zero exit " 74 raise AssertionError("Command '%s' returned non-zero exit "
71 "status %d:\n%s" % (command, status, output)) 75 "status %d:\n%s" % (command, status, output))
72 76
73 return (status, output) 77 return (status, output)
74 78
75 def run(self, command, timeout=None, ignore_status=True, raw=False): 79 def run(self, command, timeout=None, ignore_status=True, raw=False, ignore_ssh_fails=False):
76 """ 80 """
77 Runs command in target. 81 Runs command in target.
78 82
@@ -91,7 +95,7 @@ class OESSHTarget(OETarget):
91 else: 95 else:
92 processTimeout = self.timeout 96 processTimeout = self.timeout
93 97
94 status, output = self._run(sshCmd, processTimeout, ignore_status, raw) 98 status, output = self._run(sshCmd, processTimeout, ignore_status, raw, ignore_ssh_fails)
95 if len(output) > (64 * 1024): 99 if len(output) > (64 * 1024):
96 self.logger.debug('Command: %s\nStatus: %d Output length: %s\n' % (command, status, len(output))) 100 self.logger.debug('Command: %s\nStatus: %d Output length: %s\n' % (command, status, len(output)))
97 else: 101 else:
diff --git a/meta/lib/oeqa/runtime/cases/logrotate.py b/meta/lib/oeqa/runtime/cases/logrotate.py
index 6ad980cb6a..7cb43d98c5 100644
--- a/meta/lib/oeqa/runtime/cases/logrotate.py
+++ b/meta/lib/oeqa/runtime/cases/logrotate.py
@@ -15,12 +15,13 @@ class LogrotateTest(OERuntimeTestCase):
15 15
16 @classmethod 16 @classmethod
17 def setUpClass(cls): 17 def setUpClass(cls):
18 cls.tc.target.run('cp /etc/logrotate.d/wtmp $HOME/wtmp.oeqabak') 18 cls.tc.target.run('cp /etc/logrotate.d/wtmp $HOME/wtmp.oeqabak',
19 ignore_ssh_fails=True)
19 20
20 @classmethod 21 @classmethod
21 def tearDownClass(cls): 22 def tearDownClass(cls):
22 cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log//logrotate_dir') 23 cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf /var/log//logrotate_dir', ignore_ssh_fails=True)
23 cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile') 24 cls.tc.target.run('rm -rf /var/log/logrotate_testfile && rm -rf /etc/logrotate.d/logrotate_testfile', ignore_ssh_fails=True)
24 25
25 @OETestDepends(['ssh.SSHTest.test_ssh']) 26 @OETestDepends(['ssh.SSHTest.test_ssh'])
26 @OEHasPackage(['logrotate']) 27 @OEHasPackage(['logrotate'])
diff --git a/meta/lib/oeqa/runtime/cases/ssh.py b/meta/lib/oeqa/runtime/cases/ssh.py
index b632a29a01..3e9503277e 100644
--- a/meta/lib/oeqa/runtime/cases/ssh.py
+++ b/meta/lib/oeqa/runtime/cases/ssh.py
@@ -17,7 +17,7 @@ class SSHTest(OERuntimeTestCase):
17 @OEHasPackage(['dropbear', 'openssh-sshd']) 17 @OEHasPackage(['dropbear', 'openssh-sshd'])
18 def test_ssh(self): 18 def test_ssh(self):
19 for i in range(5): 19 for i in range(5):
20 status, output = self.target.run("uname -a", timeout=30) 20 status, output = self.target.run("uname -a", timeout=30, ignore_ssh_fails=True)
21 if status == 0: 21 if status == 0:
22 break 22 break
23 elif status == 255 or status == -signal.SIGTERM: 23 elif status == 255 or status == -signal.SIGTERM:
diff --git a/meta/lib/oeqa/runtime/cases/weston.py b/meta/lib/oeqa/runtime/cases/weston.py
index ee4d336482..e2cecffe83 100644
--- a/meta/lib/oeqa/runtime/cases/weston.py
+++ b/meta/lib/oeqa/runtime/cases/weston.py
@@ -16,7 +16,7 @@ class WestonTest(OERuntimeTestCase):
16 16
17 @classmethod 17 @classmethod
18 def tearDownClass(cls): 18 def tearDownClass(cls):
19 cls.tc.target.run('rm %s' % cls.weston_log_file) 19 cls.tc.target.run('rm %s' % cls.weston_log_file, ignore_ssh_fails=True)
20 20
21 @OETestDepends(['ssh.SSHTest.test_ssh']) 21 @OETestDepends(['ssh.SSHTest.test_ssh'])
22 @OEHasPackage(['weston']) 22 @OEHasPackage(['weston'])
diff --git a/meta/lib/oeqa/sdk/cases/autotools.py b/meta/lib/oeqa/sdk/cases/autotools.py
index 3f51854e3d..ecafafa7d6 100644
--- a/meta/lib/oeqa/sdk/cases/autotools.py
+++ b/meta/lib/oeqa/sdk/cases/autotools.py
@@ -27,7 +27,7 @@ class AutotoolsTest(OESDKTestCase):
27 pmv = parallel_make_value((self.td.get('PARALLEL_MAKE') or '').split()) 27 pmv = parallel_make_value((self.td.get('PARALLEL_MAKE') or '').split())
28 28
29 with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir: 29 with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir:
30 tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftp.gnu.org/gnu/cpio/cpio-2.15.tar.gz") 30 tarball = self.fetch(testdir, self.td["DL_DIR"], "https://ftpmirror.gnu.org/gnu/cpio/cpio-2.15.tar.gz")
31 31
32 opts = {} 32 opts = {}
33 opts["source"] = os.path.join(testdir, "cpio-2.15") 33 opts["source"] = os.path.join(testdir, "cpio-2.15")
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py
index 08bc1d1e44..8026e7ed4a 100644
--- a/meta/lib/oeqa/selftest/cases/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -157,7 +157,9 @@ class BitbakeLayers(OESelftestTestCase):
157 with open(jsonfile) as f: 157 with open(jsonfile) as f:
158 data = json.load(f) 158 data = json.load(f)
159 for s in data['sources']: 159 for s in data['sources']:
160 if s == 'meta-yocto': 160 if s == 'poky':
161 data['sources'][s]['git-remote']['rev'] = '5200799866b92259e855051112520006e1aaaac0'
162 elif s == 'meta-yocto':
161 data['sources'][s]['git-remote']['rev'] = '913bd8ba4dd1d5d2a38261bde985b64a36e36281' 163 data['sources'][s]['git-remote']['rev'] = '913bd8ba4dd1d5d2a38261bde985b64a36e36281'
162 else: 164 else:
163 data['sources'][s]['git-remote']['rev'] = '744a2277844ec9a384a9ca7dae2a634d5a0d3590' 165 data['sources'][s]['git-remote']['rev'] = '744a2277844ec9a384a9ca7dae2a634d5a0d3590'
diff --git a/meta/lib/oeqa/selftest/cases/bblock.py b/meta/lib/oeqa/selftest/cases/bblock.py
index 2b62d2a0aa..cb99d32bb5 100644
--- a/meta/lib/oeqa/selftest/cases/bblock.py
+++ b/meta/lib/oeqa/selftest/cases/bblock.py
@@ -122,11 +122,11 @@ class BBLock(OESelftestTestCase):
122 else: 122 else:
123 machine = "qemux86-64" 123 machine = "qemux86-64"
124 124
125 self.write_config('MACHINE = "%s"\n' % machine) 125 self.write_config('MACHINE:forcevariable = "%s"\n' % machine)
126 126
127 self.lock_recipes(recipes, tasks) 127 self.lock_recipes(recipes, tasks)
128 128
129 self.write_config('MACHINE = "%s"\n' % self.td["MACHINE"]) 129 self.write_config('MACHINE:forcevariable = "%s"\n' % self.td["MACHINE"])
130 # modify quilt's do_compile task 130 # modify quilt's do_compile task
131 self.modify_tasks(recipes, tasks) 131 self.modify_tasks(recipes, tasks)
132 132
diff --git a/meta/lib/oeqa/selftest/cases/buildhistory.py b/meta/lib/oeqa/selftest/cases/buildhistory.py
index 511c666554..1edc60c72d 100644
--- a/meta/lib/oeqa/selftest/cases/buildhistory.py
+++ b/meta/lib/oeqa/selftest/cases/buildhistory.py
@@ -16,7 +16,7 @@ class BuildhistoryTests(OESelftestTestCase):
16 16
17 def config_buildhistory(self, tmp_bh_location=False): 17 def config_buildhistory(self, tmp_bh_location=False):
18 bb_vars = get_bb_vars(['USER_CLASSES', 'INHERIT']) 18 bb_vars = get_bb_vars(['USER_CLASSES', 'INHERIT'])
19 if (not 'buildhistory' in bb_vars['USER_CLASSES']) and (not 'buildhistory' in bb_vars['INHERIT']): 19 if (not bb_vars['USER_CLASSES'] or not 'buildhistory' in bb_vars['USER_CLASSES']) and (not 'buildhistory' in bb_vars['INHERIT']):
20 add_buildhistory_config = 'INHERIT += "buildhistory"\nBUILDHISTORY_COMMIT = "1"' 20 add_buildhistory_config = 'INHERIT += "buildhistory"\nBUILDHISTORY_COMMIT = "1"'
21 self.append_config(add_buildhistory_config) 21 self.append_config(add_buildhistory_config)
22 22
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py
index 3c40857747..195b9ee8b5 100644
--- a/meta/lib/oeqa/selftest/cases/fitimage.py
+++ b/meta/lib/oeqa/selftest/cases/fitimage.py
@@ -787,7 +787,7 @@ FIT_CONF_PREFIX = "foo-"
787 787
788 config = """ 788 config = """
789DISTRO = "poky" 789DISTRO = "poky"
790MACHINE = "beaglebone-yocto" 790MACHINE:forcevariable = "beaglebone-yocto"
791""" 791"""
792 self.write_config(config) 792 self.write_config(config)
793 793
@@ -828,7 +828,7 @@ MACHINE = "beaglebone-yocto"
828 """ 828 """
829 config = """ 829 config = """
830# Enable creation of fitImage 830# Enable creation of fitImage
831MACHINE = "beaglebone-yocto" 831MACHINE:forcevariable = "beaglebone-yocto"
832# Add a devicetree overlay which does not need kernel sources 832# Add a devicetree overlay which does not need kernel sources
833PREFERRED_PROVIDER_virtual/dtb = "bbb-dtbs-as-ext" 833PREFERRED_PROVIDER_virtual/dtb = "bbb-dtbs-as-ext"
834""" 834"""
@@ -855,7 +855,7 @@ PREFERRED_PROVIDER_virtual/dtb = "bbb-dtbs-as-ext"
855 # Generate a configuration section which gets included into the local.conf file 855 # Generate a configuration section which gets included into the local.conf file
856 config = """ 856 config = """
857# Enable creation of fitImage 857# Enable creation of fitImage
858MACHINE = "beaglebone-yocto" 858MACHINE:forcevariable = "beaglebone-yocto"
859UBOOT_SIGN_ENABLE = "1" 859UBOOT_SIGN_ENABLE = "1"
860UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 860UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
861UBOOT_SIGN_KEYNAME = "dev" 861UBOOT_SIGN_KEYNAME = "dev"
@@ -903,7 +903,7 @@ FIT_CONF_DEFAULT_DTB = "am335x-bonegreen.dtb"
903 # Generate a configuration section which gets included into the local.conf file 903 # Generate a configuration section which gets included into the local.conf file
904 config = """ 904 config = """
905# Enable creation of fitImage 905# Enable creation of fitImage
906MACHINE = "beaglebone-yocto" 906MACHINE:forcevariable = "beaglebone-yocto"
907UBOOT_SIGN_ENABLE = "1" 907UBOOT_SIGN_ENABLE = "1"
908FIT_GENERATE_KEYS = "1" 908FIT_GENERATE_KEYS = "1"
909UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 909UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
@@ -939,7 +939,7 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'"
939 939
940 config = """ 940 config = """
941DISTRO = "poky" 941DISTRO = "poky"
942MACHINE = "beaglebone-yocto" 942MACHINE:forcevariable = "beaglebone-yocto"
943INITRAMFS_IMAGE = "core-image-minimal-initramfs" 943INITRAMFS_IMAGE = "core-image-minimal-initramfs"
944INITRAMFS_SCRIPTS = "" 944INITRAMFS_SCRIPTS = ""
945UBOOT_MACHINE = "am335x_evm_defconfig" 945UBOOT_MACHINE = "am335x_evm_defconfig"
@@ -993,7 +993,7 @@ FIT_HASH_ALG = "sha256"
993 993
994 config = """ 994 config = """
995DISTRO = "poky" 995DISTRO = "poky"
996MACHINE = "beaglebone-yocto" 996MACHINE:forcevariable = "beaglebone-yocto"
997INITRAMFS_IMAGE_BUNDLE = "1" 997INITRAMFS_IMAGE_BUNDLE = "1"
998INITRAMFS_IMAGE = "core-image-minimal-initramfs" 998INITRAMFS_IMAGE = "core-image-minimal-initramfs"
999INITRAMFS_SCRIPTS = "" 999INITRAMFS_SCRIPTS = ""
@@ -1412,7 +1412,7 @@ class UBootFitImageTests(FitImageTestCase):
1412 """ 1412 """
1413 config = """ 1413 config = """
1414# We need at least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set 1414# We need at least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set
1415MACHINE = "qemuarm" 1415MACHINE:forcevariable = "qemuarm"
1416UBOOT_MACHINE = "am57xx_evm_defconfig" 1416UBOOT_MACHINE = "am57xx_evm_defconfig"
1417SPL_BINARY = "MLO" 1417SPL_BINARY = "MLO"
1418 1418
@@ -1451,7 +1451,7 @@ UBOOT_FIT_DESC = "A model description"
1451 config = """ 1451 config = """
1452# There's no U-boot defconfig with CONFIG_FIT_SIGNATURE yet, so we need at 1452# There's no U-boot defconfig with CONFIG_FIT_SIGNATURE yet, so we need at
1453# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set 1453# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set
1454MACHINE = "qemuarm" 1454MACHINE:forcevariable = "qemuarm"
1455UBOOT_MACHINE = "am57xx_evm_defconfig" 1455UBOOT_MACHINE = "am57xx_evm_defconfig"
1456SPL_BINARY = "MLO" 1456SPL_BINARY = "MLO"
1457# Enable creation and signing of the U-Boot fitImage 1457# Enable creation and signing of the U-Boot fitImage
@@ -1498,7 +1498,7 @@ UBOOT_FIT_HASH_ALG = "sha256"
1498 config = """ 1498 config = """
1499# There's no U-boot deconfig with CONFIG_FIT_SIGNATURE yet, so we need at 1499# There's no U-boot deconfig with CONFIG_FIT_SIGNATURE yet, so we need at
1500# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set 1500# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set
1501MACHINE = "qemuarm" 1501MACHINE:forcevariable = "qemuarm"
1502UBOOT_MACHINE = "am57xx_evm_defconfig" 1502UBOOT_MACHINE = "am57xx_evm_defconfig"
1503SPL_BINARY = "MLO" 1503SPL_BINARY = "MLO"
1504# Enable creation and signing of the U-Boot fitImage 1504# Enable creation and signing of the U-Boot fitImage
@@ -1546,7 +1546,7 @@ UBOOT_SIGN_KEYNAME = "cfg-oe-selftest"
1546 """ 1546 """
1547 config = """ 1547 config = """
1548# We need at least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set 1548# We need at least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set
1549MACHINE = "qemuarm" 1549MACHINE:forcevariable = "qemuarm"
1550UBOOT_MACHINE = "am57xx_evm_defconfig" 1550UBOOT_MACHINE = "am57xx_evm_defconfig"
1551SPL_BINARY = "MLO" 1551SPL_BINARY = "MLO"
1552 1552
@@ -1612,7 +1612,7 @@ UBOOT_FIT_ARM_TRUSTED_FIRMWARE_ENTRYPOINT = "0x80280000"
1612 config = """ 1612 config = """
1613# There's no U-boot deconfig with CONFIG_FIT_SIGNATURE yet, so we need at 1613# There's no U-boot deconfig with CONFIG_FIT_SIGNATURE yet, so we need at
1614# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set 1614# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set
1615MACHINE = "qemuarm" 1615MACHINE:forcevariable = "qemuarm"
1616UBOOT_MACHINE = "am57xx_evm_defconfig" 1616UBOOT_MACHINE = "am57xx_evm_defconfig"
1617SPL_BINARY = "MLO" 1617SPL_BINARY = "MLO"
1618# Enable creation and signing of the U-Boot fitImage 1618# Enable creation and signing of the U-Boot fitImage
@@ -1676,7 +1676,7 @@ UBOOT_FIT_ARM_TRUSTED_FIRMWARE_ENTRYPOINT = "0x80280000"
1676 """ 1676 """
1677 config = """ 1677 config = """
1678# Enable creation of fitImage 1678# Enable creation of fitImage
1679MACHINE = "beaglebone-yocto" 1679MACHINE:forcevariable = "beaglebone-yocto"
1680UBOOT_SIGN_ENABLE = "1" 1680UBOOT_SIGN_ENABLE = "1"
1681UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" 1681UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys"
1682UBOOT_SIGN_KEYNAME = "the-kernel-config-key" 1682UBOOT_SIGN_KEYNAME = "the-kernel-config-key"
@@ -1715,7 +1715,7 @@ FIT_SIGN_INDIVIDUAL = "1"
1715 config = """ 1715 config = """
1716# There's no U-boot defconfig with CONFIG_FIT_SIGNATURE yet, so we need at 1716# There's no U-boot defconfig with CONFIG_FIT_SIGNATURE yet, so we need at
1717# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set 1717# least CONFIG_SPL_LOAD_FIT and CONFIG_SPL_OF_CONTROL set
1718MACHINE = "qemuarm" 1718MACHINE:forcevariable = "qemuarm"
1719UBOOT_MACHINE = "am57xx_evm_defconfig" 1719UBOOT_MACHINE = "am57xx_evm_defconfig"
1720# Enable creation and signing of the U-Boot fitImage (no SPL) 1720# Enable creation and signing of the U-Boot fitImage (no SPL)
1721UBOOT_FITIMAGE_ENABLE = "1" 1721UBOOT_FITIMAGE_ENABLE = "1"
diff --git a/meta/lib/oeqa/selftest/cases/meta_ide.py b/meta/lib/oeqa/selftest/cases/meta_ide.py
index c3a7df4cdf..f105302d8b 100644
--- a/meta/lib/oeqa/selftest/cases/meta_ide.py
+++ b/meta/lib/oeqa/selftest/cases/meta_ide.py
@@ -37,14 +37,14 @@ class MetaIDE(OESelftestTestCase):
37 37
38 def test_meta_ide_can_compile_c_program(self): 38 def test_meta_ide_can_compile_c_program(self):
39 runCmd('cp %s/test.c %s' % (self.tc.files_dir, self.tmpdir_metaideQA)) 39 runCmd('cp %s/test.c %s' % (self.tc.files_dir, self.tmpdir_metaideQA))
40 runCmd("cd %s; . %s; $CC test.c -lm" % (self.tmpdir_metaideQA, self.environment_script_path)) 40 runCmd(". %s; cd %s; $CC test.c -lm" % (self.environment_script_path, self.tmpdir_metaideQA))
41 compiled_file = '%s/a.out' % self.tmpdir_metaideQA 41 compiled_file = '%s/a.out' % self.tmpdir_metaideQA
42 self.assertExists(compiled_file) 42 self.assertExists(compiled_file)
43 43
44 def test_meta_ide_can_build_cpio_project(self): 44 def test_meta_ide_can_build_cpio_project(self):
45 dl_dir = self.td.get('DL_DIR', None) 45 dl_dir = self.td.get('DL_DIR', None)
46 self.project = SDKBuildProject(self.tmpdir_metaideQA + "/cpio/", self.environment_script_path, 46 self.project = SDKBuildProject(self.tmpdir_metaideQA + "/cpio/", self.environment_script_path,
47 "https://ftp.gnu.org/gnu/cpio/cpio-2.15.tar.gz", 47 "https://ftpmirror.gnu.org/gnu/cpio/cpio-2.15.tar.gz",
48 self.tmpdir_metaideQA, self.td['DATETIME'], dl_dir=dl_dir) 48 self.tmpdir_metaideQA, self.td['DATETIME'], dl_dir=dl_dir)
49 self.project.download_archive() 49 self.project.download_archive()
50 self.assertEqual(self.project.run_configure('CFLAGS="-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration" $CONFIGURE_FLAGS'), 0, 50 self.assertEqual(self.project.run_configure('CFLAGS="-std=gnu17 -Dbool=int -Dtrue=1 -Dfalse=0 -Wno-error=implicit-function-declaration" $CONFIGURE_FLAGS'), 0,
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index 64fb3f1a1d..ebaf01f777 100644
--- a/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -18,6 +18,10 @@ class OEPybootchartguyTests(OESelftestTestCase):
18 @classmethod 18 @classmethod
19 def setUpClass(cls): 19 def setUpClass(cls):
20 super().setUpClass() 20 super().setUpClass()
21 cls.write_config(cls,
22"""
23INHERIT += "buildstats"
24""")
21 bitbake("core-image-minimal -c rootfs -f") 25 bitbake("core-image-minimal -c rootfs -f")
22 cls.tmpdir = get_bb_var('TMPDIR') 26 cls.tmpdir = get_bb_var('TMPDIR')
23 cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1] 27 cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1]
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py
index 08f94b168a..44dd674a32 100644
--- a/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -336,20 +336,20 @@ class SStateCacheManagement(SStateBase):
336 def test_sstate_cache_management_script_using_pr_3(self): 336 def test_sstate_cache_management_script_using_pr_3(self):
337 global_config = [] 337 global_config = []
338 target_config = [] 338 target_config = []
339 global_config.append('MACHINE = "qemux86-64"') 339 global_config.append('MACHINE:forcevariable = "qemux86-64"')
340 target_config.append('PR = "0"') 340 target_config.append('PR = "0"')
341 global_config.append(global_config[0]) 341 global_config.append(global_config[0])
342 target_config.append('PR = "1"') 342 target_config.append('PR = "1"')
343 global_config.append('MACHINE = "qemux86"') 343 global_config.append('MACHINE:forcevariable = "qemux86"')
344 target_config.append('PR = "1"') 344 target_config.append('PR = "1"')
345 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) 345 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
346 346
347 def test_sstate_cache_management_script_using_machine(self): 347 def test_sstate_cache_management_script_using_machine(self):
348 global_config = [] 348 global_config = []
349 target_config = [] 349 target_config = []
350 global_config.append('MACHINE = "qemux86-64"') 350 global_config.append('MACHINE:forcevariable = "qemux86-64"')
351 target_config.append('') 351 target_config.append('')
352 global_config.append('MACHINE = "qemux86"') 352 global_config.append('MACHINE:forcevariable = "qemux86"')
353 target_config.append('') 353 target_config.append('')
354 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic']) 354 self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
355 355
@@ -357,7 +357,7 @@ class SStateHashSameSigs(SStateBase):
357 def sstate_hashtest(self, sdkmachine): 357 def sstate_hashtest(self, sdkmachine):
358 358
359 self.write_config(""" 359 self.write_config("""
360MACHINE = "qemux86" 360MACHINE:forcevariable = "qemux86"
361TMPDIR = "${TOPDIR}/tmp-sstatesamehash" 361TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
362BUILD_ARCH = "x86_64" 362BUILD_ARCH = "x86_64"
363BUILD_OS = "linux" 363BUILD_OS = "linux"
@@ -368,7 +368,7 @@ BB_SIGNATURE_HANDLER = "OEBasicHash"
368 self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash") 368 self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
369 bitbake("core-image-weston -S none") 369 bitbake("core-image-weston -S none")
370 self.write_config(""" 370 self.write_config("""
371MACHINE = "qemux86" 371MACHINE:forcevariable = "qemux86"
372TMPDIR = "${TOPDIR}/tmp-sstatesamehash2" 372TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
373BUILD_ARCH = "i686" 373BUILD_ARCH = "i686"
374BUILD_OS = "linux" 374BUILD_OS = "linux"
@@ -454,13 +454,13 @@ class SStateHashSameSigs2(SStateBase):
454 454
455 configA = """ 455 configA = """
456TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" 456TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
457MACHINE = \"qemux86-64\" 457MACHINE:forcevariable = \"qemux86-64\"
458BB_SIGNATURE_HANDLER = "OEBasicHash" 458BB_SIGNATURE_HANDLER = "OEBasicHash"
459""" 459"""
460 #OLDEST_KERNEL is arch specific so set to a different value here for testing 460 #OLDEST_KERNEL is arch specific so set to a different value here for testing
461 configB = """ 461 configB = """
462TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" 462TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
463MACHINE = \"qemuarm\" 463MACHINE:forcevariable = \"qemuarm\"
464OLDEST_KERNEL = \"3.3.0\" 464OLDEST_KERNEL = \"3.3.0\"
465BB_SIGNATURE_HANDLER = "OEBasicHash" 465BB_SIGNATURE_HANDLER = "OEBasicHash"
466ERROR_QA:append = " somenewoption" 466ERROR_QA:append = " somenewoption"
@@ -475,7 +475,7 @@ WARN_QA:append = " someotheroption"
475 475
476 configA = """ 476 configA = """
477TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" 477TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
478MACHINE = \"qemux86-64\" 478MACHINE:forcevariable = \"qemux86-64\"
479require conf/multilib.conf 479require conf/multilib.conf
480MULTILIBS = \"multilib:lib32\" 480MULTILIBS = \"multilib:lib32\"
481DEFAULTTUNE:virtclass-multilib-lib32 = \"x86\" 481DEFAULTTUNE:virtclass-multilib-lib32 = \"x86\"
@@ -483,7 +483,7 @@ BB_SIGNATURE_HANDLER = "OEBasicHash"
483""" 483"""
484 configB = """ 484 configB = """
485TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" 485TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
486MACHINE = \"qemuarm\" 486MACHINE:forcevariable = \"qemuarm\"
487require conf/multilib.conf 487require conf/multilib.conf
488MULTILIBS = \"\" 488MULTILIBS = \"\"
489BB_SIGNATURE_HANDLER = "OEBasicHash" 489BB_SIGNATURE_HANDLER = "OEBasicHash"
@@ -500,7 +500,7 @@ class SStateHashSameSigs3(SStateBase):
500 500
501 self.write_config(""" 501 self.write_config("""
502TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" 502TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
503MACHINE = \"qemux86\" 503MACHINE:forcevariable = \"qemux86\"
504require conf/multilib.conf 504require conf/multilib.conf
505MULTILIBS = "multilib:lib32" 505MULTILIBS = "multilib:lib32"
506DEFAULTTUNE:virtclass-multilib-lib32 = "x86" 506DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
@@ -510,7 +510,7 @@ BB_SIGNATURE_HANDLER = "OEBasicHash"
510 bitbake("world meta-toolchain -S none") 510 bitbake("world meta-toolchain -S none")
511 self.write_config(""" 511 self.write_config("""
512TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" 512TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
513MACHINE = \"qemux86copy\" 513MACHINE:forcevariable = \"qemux86copy\"
514require conf/multilib.conf 514require conf/multilib.conf
515MULTILIBS = "multilib:lib32" 515MULTILIBS = "multilib:lib32"
516DEFAULTTUNE:virtclass-multilib-lib32 = "x86" 516DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
@@ -546,7 +546,7 @@ BB_SIGNATURE_HANDLER = "OEBasicHash"
546 546
547 self.write_config(""" 547 self.write_config("""
548TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\" 548TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
549MACHINE = \"qemux86\" 549MACHINE:forcevariable = \"qemux86\"
550require conf/multilib.conf 550require conf/multilib.conf
551MULTILIBS = "multilib:lib32" 551MULTILIBS = "multilib:lib32"
552DEFAULTTUNE:virtclass-multilib-lib32 = "x86" 552DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
@@ -556,7 +556,7 @@ BB_SIGNATURE_HANDLER = "OEBasicHash"
556 bitbake("binutils-native -S none") 556 bitbake("binutils-native -S none")
557 self.write_config(""" 557 self.write_config("""
558TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\" 558TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
559MACHINE = \"qemux86copy\" 559MACHINE:forcevariable = \"qemux86copy\"
560BB_SIGNATURE_HANDLER = "OEBasicHash" 560BB_SIGNATURE_HANDLER = "OEBasicHash"
561""") 561""")
562 self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2") 562 self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
@@ -707,7 +707,7 @@ class SStateFindSiginfo(SStateBase):
707 """ 707 """
708 self.write_config(""" 708 self.write_config("""
709TMPDIR = \"${TOPDIR}/tmp-sstates-findsiginfo\" 709TMPDIR = \"${TOPDIR}/tmp-sstates-findsiginfo\"
710MACHINE = \"qemux86-64\" 710MACHINE:forcevariable = \"qemux86-64\"
711require conf/multilib.conf 711require conf/multilib.conf
712MULTILIBS = "multilib:lib32" 712MULTILIBS = "multilib:lib32"
713DEFAULTTUNE:virtclass-multilib-lib32 = "x86" 713DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
@@ -957,13 +957,13 @@ class SStateMirrors(SStateCheckObjectPresence):
957 if check_cdn: 957 if check_cdn:
958 self.config_sstate(True) 958 self.config_sstate(True)
959 self.append_config(""" 959 self.append_config("""
960MACHINE = "{}" 960MACHINE:forcevariable = "{}"
961BB_HASHSERVE_UPSTREAM = "hashserv.yoctoproject.org:8686" 961BB_HASHSERVE_UPSTREAM = "hashserv.yoctoproject.org:8686"
962SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH" 962SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"
963""".format(machine)) 963""".format(machine))
964 else: 964 else:
965 self.append_config(""" 965 self.append_config("""
966MACHINE = "{}" 966MACHINE:forcevariable = "{}"
967""".format(machine)) 967""".format(machine))
968 result = bitbake("-DD -n {}".format(targets)) 968 result = bitbake("-DD -n {}".format(targets))
969 bitbake("-S none {}".format(targets)) 969 bitbake("-S none {}".format(targets))
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index 16f82c6737..c9eb481725 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -44,9 +44,13 @@ class NonConcurrentTestSuite(unittest.TestSuite):
44 self.bb_vars = bb_vars 44 self.bb_vars = bb_vars
45 45
46 def run(self, result): 46 def run(self, result):
47 origenv = os.environ.copy()
47 (builddir, newbuilddir) = self.setupfunc("-st", None, self.suite) 48 (builddir, newbuilddir) = self.setupfunc("-st", None, self.suite)
48 ret = super().run(result) 49 ret = super().run(result)
50 # In forks we don't have to restore but in a single process, restore cwd and the env
49 os.chdir(builddir) 51 os.chdir(builddir)
52 for e in origenv:
53 os.environ[e] = origenv[e]
50 if newbuilddir and ret.wasSuccessful() and self.removefunc: 54 if newbuilddir and ret.wasSuccessful() and self.removefunc:
51 self.removefunc(newbuilddir) 55 self.removefunc(newbuilddir)
52 56
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py
index c69481db6c..7b967edaad 100644
--- a/meta/lib/oeqa/utils/postactions.py
+++ b/meta/lib/oeqa/utils/postactions.py
@@ -22,7 +22,7 @@ from oeqa.utils import get_artefact_dir
22def get_target_disk_usage(d, tc, artifacts_list, outputdir): 22def get_target_disk_usage(d, tc, artifacts_list, outputdir):
23 output_file = os.path.join(outputdir, "target_disk_usage.txt") 23 output_file = os.path.join(outputdir, "target_disk_usage.txt")
24 try: 24 try:
25 (status, output) = tc.target.run('df -h') 25 (status, output) = tc.target.run('df -h', ignore_ssh_fails=True)
26 with open(output_file, 'w') as f: 26 with open(output_file, 'w') as f:
27 f.write(output) 27 f.write(output)
28 f.write("\n") 28 f.write("\n")
@@ -49,7 +49,7 @@ def get_artifacts_list(target, raw_list):
49 for raw_path in raw_list.split(): 49 for raw_path in raw_list.split():
50 cmd = f"for p in {raw_path}; do if [ -e $p ]; then echo $p; fi; done" 50 cmd = f"for p in {raw_path}; do if [ -e $p ]; then echo $p; fi; done"
51 try: 51 try:
52 status, output = target.run(cmd) 52 status, output = target.run(cmd, ignore_ssh_fails=True)
53 if status != 0 or not output: 53 if status != 0 or not output:
54 raise Exception() 54 raise Exception()
55 result += output.split() 55 result += output.split()