summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Roos <throos@amazon.de>2023-05-19 14:09:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-05-25 10:29:04 +0100
commit95a5bc130dc51ea9de95c64dbf0e9c7892415d50 (patch)
treef82016ffbb1fb684f0f4df5578d7a51d89b4ebfd
parentf72fd51e0da100e7ed90992225688bf43e2a69b6 (diff)
downloadopenembedded-core-contrib-95a5bc130dc51ea9de95c64dbf0e9c7892415d50.tar.gz
oeqa/selftest/cases/devtool.py: skip all tests require folder a git repo
Devtool selftests require poky dir a git repo, when downloading poky as a tar, this is not the case. Those tests will now skipped. [YOCTO #12389] Signed-off-by: Thomas Roos <throos@amazon.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 1896944250..397895c936 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -10,6 +10,7 @@ import shutil
import tempfile
import glob
import fnmatch
+import unittest
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
@@ -40,6 +41,13 @@ def setUpModule():
canonical_layerpath = os.path.realpath(canonical_layerpath) + '/'
edited_layers.append(layerpath)
oldmetapath = os.path.realpath(layerpath)
+
+ # when downloading poky from tar.gz some tests will be skipped (BUG 12389)
+ try:
+ runCmd('git rev-parse --is-inside-work-tree', cwd=canonical_layerpath)
+ except:
+ raise unittest.SkipTest("devtool tests require folder to be a git repo")
+
result = runCmd('git rev-parse --show-toplevel', cwd=canonical_layerpath)
oldreporoot = result.output.rstrip()
newmetapath = os.path.join(corecopydir, os.path.relpath(oldmetapath, oldreporoot))