Skip to contentSkip to conversation

[1.46][PATCH 1/1] cooker/command: Add a dummy event for tinfoil testing

bitbake Steve Sakoman 1 participant 1 message Jan 5, 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

From: Richard Purdie <[email protected]>

We need a command genetating an event to test through the tinfoil API. The current test has IO load issues so add a dummy version which won't have the IO constraints.

(cherry picked from commit a144178584394ea0700ffc2f2bfac94e8690effc)
---
 lib/bb/command.py | 10 ++++++++++
 lib/bb/cooker.py  |  5 +++++
 2 files changed, 15 insertions(+)
lib/bb/command.py +10 -0
index 07128027..98c945ed 100644
@@ -624,6 +624,16 @@ class CommandsAsync:
         command.finishAsyncCommand()
     findFilesMatchingInDir.needcache = False
 
+    def testCookerCommandEvent(self, command, params):
+        """
+        Dummy command used by OEQA selftest to test tinfoil without IO
+        """
+        pattern = params[0]
+
+        command.cooker.testCookerCommandEvent(pattern)
+        command.finishAsyncCommand()
+    testCookerCommandEvent.needcache = False
+
     def findConfigFilePath(self, command, params):
         """
         Find the path of the requested configuration file
lib/bb/cooker.py +5 -0
index 8d9ca680..ac54d437 100644
@@ -1019,6 +1019,11 @@ class BBCooker:
         if matches:
             bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.data)
 
+    def testCookerCommandEvent(self, filepattern):
+        # Dummy command used by OEQA selftest to test tinfoil without IO
+        matches = ["A", "B"]
+        bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.data)
+
     def findProviders(self, mc=''):
         return bb.providers.findProviders(self.databuilder.mcdata[mc], self.recipecaches[mc], self.recipecaches[mc].pkg_pn)
 
Signature · 1 line
2.25.1