aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-05 06:56:32 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-07 23:43:41 +0000
commitc5969eedd035648e3258bade386cc67ce3bb0e03 (patch)
tree7b80831fff2af861148e975812eb93f33ffe0a67
parentf18b65d0b9a6b983d53bde491e1bf2ca56949444 (diff)
downloadbitbake-contrib-c5969eedd035648e3258bade386cc67ce3bb0e03.tar.gz
cooker/command: Add a dummy event for tinfoil testing
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a144178584394ea0700ffc2f2bfac94e8690effc) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/command.py10
-rw-r--r--lib/bb/cooker.py5
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py
index 07128027f..98c945edb 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -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
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 8d9ca6806..ac54d4378 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -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)