From 6e6ede294c3391487df196055ad0544b08c2b1b2 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 5 Jan 2022 06:56:32 -1000 Subject: bitbake: 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. (Bitbake rev: c5969eedd035648e3258bade386cc67ce3bb0e03) Signed-off-by: Richard Purdie (cherry picked from commit a144178584394ea0700ffc2f2bfac94e8690effc) Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- bitbake/lib/bb/command.py | 10 ++++++++++ bitbake/lib/bb/cooker.py | 5 +++++ 2 files changed, 15 insertions(+) (limited to 'bitbake/lib/bb') diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 07128027fd..98c945edb5 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/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/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 8d9ca68062..ac54d4378d 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/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) -- cgit v1.2.3-54-g00ecf