summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-10-25 23:15:07 -0700
committerArmin Kuster <akuster808@gmail.com>2019-10-25 23:15:07 -0700
commitf39a4531286929f519892654fb023f6d073af273 (patch)
treeeb58a18900e921176434bd0bede0c05943fc53b1
parent20acd956f04b3f551c79de5791162d00b421d1e5 (diff)
downloadopenembedded-core-contrib-akuster/ycl_selftest.tar.gz
openembedded-core-contrib-akuster/ycl_selftest.tar.bz2
openembedded-core-contrib-akuster/ycl_selftest.zip
oeqa: add selftest for running yocto-check-layerakuster/ycl_selftest
This is so we can standardize what is being run as a baseline for folks who want to submit for Compatiblitity Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/lib/oeqa/selftest/cases/layer_checker.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/layer_checker.py b/meta/lib/oeqa/selftest/cases/layer_checker.py
new file mode 100644
index 0000000000..814ed74030
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/layer_checker.py
@@ -0,0 +1,57 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
+import os
+import shutil
+import unittest
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var
+from oeqa.utils import CommandError
+
+YCL_WHITELIST = "meta"
+
+class YoctoCheckLayerBase(OESelftestTestCase):
+ test_distro_features_add = "pam systemd opengl ptest"
+ test_distro_features_rm = "x11 ipv6"
+ scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
+ layers = get_bb_var("BBLAYERS").split()
+
+ check_layers = ""
+ opts = "-n "
+
+ for layer in layers:
+ if os.path.basename(layer) not in YCL_WHITELIST:
+ check_layers += " %s" % layer
+
+ def run_check_layer(self, features):
+ self.write_config(features)
+ result = runCmd("%s/yocto-check-layer %s %s" % (self.scripts_dir, self.opts, self.check_layers) )
+ self.remove_config(features)
+
+class YoctoCheckLayerTests(YoctoCheckLayerBase):
+
+ def test_yocto_check_layer_distro_default(self):
+ self.logger.info("Defatult layer check")
+ result = runCmd("%s/yocto-check-layer %s %s" % (self.scripts_dir, self.opts, self.check_layers) )
+
+class YoctoCheckLayerDistroTests(YoctoCheckLayerBase):
+ def check_layer_features_list(self):
+ for feature in self.test_distro_features_add.split():
+ self.logger.info("layer check with '%s' enabled" % feature)
+ features = 'DISTRO_FEATURES_append = " %s" \n' % feature
+ self.run_check_layer(features)
+
+ def test_yocto_check_layer_distro_features_add(self):
+ self.check_layer_features_list()
+
+ def test_yocto_check_layer_distro_nox11(self):
+ features = 'DISTRO_FEATURES_remove = "x11"\n'
+ self.run_check_layer(features)
+
+ def test_yocto_check_layer_distro_nopipv6(self):
+ features = 'DISTRO_FEATURES_remove = "ipv6"\n'
+ self.run_check_layer(features)
+
+
+