1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

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]

(From OE-Core rev: 5f3128e3a85e3a5d67d5dc1f2585fe6c236e443c)

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>
(cherry picked from commit 95a5bc130dc51ea9de95c64dbf0e9c7892415d50)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Thomas Roos
2023-05-19 14:09:58 +02:00
committed by Steve Sakoman
parent 82fd9eb08f
commit e211a16fb5
+8
View File
@@ -8,6 +8,7 @@ import shutil
import tempfile import tempfile
import glob import glob
import fnmatch import fnmatch
import unittest
import oeqa.utils.ftools as ftools import oeqa.utils.ftools as ftools
from oeqa.selftest.case import OESelftestTestCase from oeqa.selftest.case import OESelftestTestCase
@@ -38,6 +39,13 @@ def setUpModule():
canonical_layerpath = os.path.realpath(canonical_layerpath) + '/' canonical_layerpath = os.path.realpath(canonical_layerpath) + '/'
edited_layers.append(layerpath) edited_layers.append(layerpath)
oldmetapath = os.path.realpath(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) result = runCmd('git rev-parse --show-toplevel', cwd=canonical_layerpath)
oldreporoot = result.output.rstrip() oldreporoot = result.output.rstrip()
newmetapath = os.path.join(corecopydir, os.path.relpath(oldmetapath, oldreporoot)) newmetapath = os.path.join(corecopydir, os.path.relpath(oldmetapath, oldreporoot))