[OE-core] [PATCH 4/9] oeqa/utils/commands: Added 3 new methods for recipes

Daniel Istrate daniel.alexandrux.istrate at intel.com
Fri Feb 26 14:40:46 UTC 2016


get_all_available_recipes, is_recipe_valid, get_tasks_for_recipe

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate at intel.com>
---
 meta/lib/oeqa/utils/commands.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 32e001c..6ae09d2 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -165,6 +165,26 @@ def get_test_layer():
             break
     return testlayer
 
+
+def get_all_available_recipes():
+    ret = bitbake('-s')
+    available_recipes = re.findall(r'\n(\S+)\s+:', ret.output)
+
+    return available_recipes
+
+
+def is_recipe_valid(recipe):
+    return recipe in get_all_available_recipes()
+
+
+def get_tasks_for_recipe(recipe):
+    """ Get available tasks for recipe """
+    ret = bitbake('-c listtasks %s' % recipe)
+    tasks = re.findall(':\s+do_(\S+)\s+', ret.output)
+
+    return tasks
+
+
 def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec='recipes-*/*'):
     os.makedirs(os.path.join(templayerdir, 'conf'))
     with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f:
-- 
2.1.0




More information about the Openembedded-core mailing list