Skip to contentSkip to conversation

oeqa/selftest/archiver: Add multiconfig test for shared recipes

PATCH Jose Quaresma 1 participant 1 message Oct 14, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Sorry but I messed up the patch and need to send a v3.

Jose

Jose Quaresma via lists.openembedded.org <quaresma.jose= [email protected]> escreveu no dia sexta, 14/10/2022 à(s) 16:12:

Quoted 109 lines

From: Jose Quaresma <[email protected]>

Test that the shared recipes in original mode with diff enabled works in multiconfig,
otherwise it will not build when using the same TMP dir.

The test can be run with:

oe-selftest -r archiver.Archiver.test_archiver_multiconfig_shared_unpack_and_patch

| oe-selftest - INFO - test_archiver_multiconfig_shared_unpack_and_patch (archiver.Archiver)
| oe-selftest - INFO - ... ok
| oe-selftest - INFO -
----------------------------------------------------------------------

| oe-selftest - INFO - Ran 1 test in 52.948s
| oe-selftest - INFO - OK
| oe-selftest - INFO - RESULTS:
| oe-selftest - INFO - RESULTS -
archiver.Archiver.test_archiver_multiconfig_shared_unpack_and_patch: PASSED
(49.98s)
| oe-selftest - INFO - SUMMARY:
| oe-selftest - INFO - oe-selftest () - Ran 1 test in 52.948s
| oe-selftest - INFO - oe-selftest - OK - All required tests passed

(successes=1, skipped=0, failures=0, errors=0)

---

v2: replace --runonly with --cmd (-c)
update the runtime test time on the commit
show the locked_sigs file used on the assert

 meta/lib/oeqa/selftest/cases/archiver.py | 29 ++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
meta/lib/oeqa/selftest/cases/archiver.py +14 -0
index ffdea832be..1d4985dacf 100644
@@ -6,6 +6,7 @@
 
 import os
 import glob
+import re
 from oeqa.utils.commands import bitbake, get_bb_vars
 from oeqa.selftest.case import OESelftestTestCase
 
@@ -119,7 +120,35 @@ class Archiver(OESelftestTestCase):
         excluded_present = len(glob.glob(src_path_target + '/%s-*/*' %
 target_recipes[1]))
         self.assertFalse(excluded_present, 'Recipe %s was not excluded.'
 % target_recipes[1])
 
+    def test_archiver_multiconfig_shared_unpack_and_patch(self):
+        """
+        Test that shared recipes in original mode with diff enabled works
 in multiconfig,
+        otherwise it will not build when using the same TMP dir.
+        """
+
+        features = 'BBMULTICONFIG = "mc1 mc2"\n'
+        features += 'INHERIT += "archiver"\n'
+        features += 'ARCHIVER_MODE[src] = "original"\n'
+        features += 'ARCHIVER_MODE[diff] = "1"\n'
+        self.write_config(features)
+
+        # We can use any machine in multiconfig as long as they are

different

meta/lib/oeqa/selftest/cases/archiver.py +5 -0
+        self.write_config('MACHINE = "qemuarm"\n', 'mc1')
+        self.write_config('MACHINE = "qemux86"\n', 'mc2')
+
+        task = 'do_unpack_and_patch'
+        # Use gcc-source as it is a shared recipe (appends the pv to the

pn)

meta/lib/oeqa/selftest/cases/archiver.py +4 -0
+        pn = 'gcc-source-%s' % get_bb_vars(['PV'], 'gcc')['PV']
+
+        # Generate the tasks signatures
+        bitbake('mc:mc1:%s mc:mc2:%s --runonly=%s --dump-signatures=none'

% (pn, pn, task))

meta/lib/oeqa/selftest/cases/archiver.py +2 -0
+        # Check the tasks signatures
+        # To be machine agnostic the tasks needs to generate the same

signature for each machine

meta/lib/oeqa/selftest/cases/archiver.py +4 -0
+        locked_sigs = open("%s/locked-sigs.inc" % self.builddir).read()
+        task_sigs = re.findall(r"%s:%s:.*" % (pn, task), locked_sigs)
+        uniq_sigs = set(task_sigs)
+        self.assertFalse(len(uniq_sigs) - 1, 'The task "%s" of the recipe

"%s" has diferent signatures for each machine in multiconfig' % (task, pn))

     def test_archiver_srpm_mode(self):
         """

--
2.38.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#171732):
https://lists.openembedded.org/g/openembedded-core/message/171732
Mute This Topic: https://lists.openembedded.org/mt/94328653/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma