mirror of
https://git.yoctoproject.org/poky
synced 2026-09-15 15:49:32 +02:00
selftest: do not hardcode /tmp/sdk
This races if there are several copies of the test running at the same time. [YOCTO #14438] (From OE-Core rev: deab11848036941771f2b3dc5cdaee83395280b5) (From OE-Core rev: 969c29c39b0ceb73ace615c478ca4544be803c9a) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit ea707e8726cd7012d101d02e69503b7c98bdaf3e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
bf8881dac7
commit
de1578c825
@@ -14,11 +14,6 @@ from oeqa.core.decorator.data import skipIfNotQemu
|
|||||||
|
|
||||||
class TestExport(OESelftestTestCase):
|
class TestExport(OESelftestTestCase):
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def tearDownClass(cls):
|
|
||||||
runCmd("rm -rf /tmp/sdk")
|
|
||||||
super(TestExport, cls).tearDownClass()
|
|
||||||
|
|
||||||
def test_testexport_basic(self):
|
def test_testexport_basic(self):
|
||||||
"""
|
"""
|
||||||
Summary: Check basic testexport functionality with only ping test enabled.
|
Summary: Check basic testexport functionality with only ping test enabled.
|
||||||
@@ -95,19 +90,20 @@ class TestExport(OESelftestTestCase):
|
|||||||
msg = "Couldn't find SDK tarball: %s" % tarball_path
|
msg = "Couldn't find SDK tarball: %s" % tarball_path
|
||||||
self.assertEqual(os.path.isfile(tarball_path), True, msg)
|
self.assertEqual(os.path.isfile(tarball_path), True, msg)
|
||||||
|
|
||||||
# Extract SDK and run tar from SDK
|
with tempfile.TemporaryDirectory() as tmpdirname:
|
||||||
result = runCmd("%s -y -d /tmp/sdk" % tarball_path)
|
# Extract SDK and run tar from SDK
|
||||||
self.assertEqual(0, result.status, "Couldn't extract SDK")
|
result = runCmd("%s -y -d %s" % (tarball_path, tmpdirname))
|
||||||
|
self.assertEqual(0, result.status, "Couldn't extract SDK")
|
||||||
|
|
||||||
env_script = result.output.split()[-1]
|
env_script = result.output.split()[-1]
|
||||||
result = runCmd(". %s; which tar" % env_script, shell=True)
|
result = runCmd(". %s; which tar" % env_script, shell=True)
|
||||||
self.assertEqual(0, result.status, "Couldn't setup SDK environment")
|
self.assertEqual(0, result.status, "Couldn't setup SDK environment")
|
||||||
is_sdk_tar = True if "/tmp/sdk" in result.output else False
|
is_sdk_tar = True if tmpdirname in result.output else False
|
||||||
self.assertTrue(is_sdk_tar, "Couldn't setup SDK environment")
|
self.assertTrue(is_sdk_tar, "Couldn't setup SDK environment")
|
||||||
|
|
||||||
tar_sdk = result.output
|
tar_sdk = result.output
|
||||||
result = runCmd("%s --version" % tar_sdk)
|
result = runCmd("%s --version" % tar_sdk)
|
||||||
self.assertEqual(0, result.status, "Couldn't run tar from SDK")
|
self.assertEqual(0, result.status, "Couldn't run tar from SDK")
|
||||||
|
|
||||||
|
|
||||||
class TestImage(OESelftestTestCase):
|
class TestImage(OESelftestTestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user