[oe-commits] [openembedded-core] 05/07: Revert "selftest/runtime-test.py: Add test for testexport SDK feature"
git at git.openembedded.org
git at git.openembedded.org
Thu Jul 21 06:49:32 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 95060923e080c553a0adc0a676fcc60e46b7a968
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Jul 20 23:35:52 2016 +0100
Revert "selftest/runtime-test.py: Add test for testexport SDK feature"
This reverts commit 428e242684281c8913db51d46540bed1970b29dc.
---
meta/lib/oeqa/selftest/runtime-test.py | 60 +---------------------------------
meta/lib/oeqa/utils/commands.py | 19 -----------
2 files changed, 1 insertion(+), 78 deletions(-)
diff --git a/meta/lib/oeqa/selftest/runtime-test.py b/meta/lib/oeqa/selftest/runtime-test.py
index d2f9334..1e1d3b0 100644
--- a/meta/lib/oeqa/selftest/runtime-test.py
+++ b/meta/lib/oeqa/selftest/runtime-test.py
@@ -1,5 +1,5 @@
from oeqa.selftest.base import oeSelfTest
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu, updateEnv, restoreEnv
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
from oeqa.utils.decorators import testcase
import os
@@ -43,64 +43,6 @@ class TestExport(oeSelfTest):
failure = True if 'FAIL' in result.output else False
self.assertNotEqual(True, failure, 'ping test failed')
- def test_testexport_sdk(self):
- """
- Summary: Check sdk functionality for testexport.
- Expected: 1. testexport directory must be created.
- 2. SDK tarball must exists.
- 3. Uncompressing of tarball must succeed.
- 4. Check if the SDK directory is added to PATH.
- 5. Run tar from the SDK directory.
- Product: oe-core
- Author: Mariano Lopez <mariano.lopez at intel.com>
- """
-
- features = 'INHERIT += "testexport"\n'
- # These aren't the actual IP addresses but testexport class needs something defined
- features += 'TEST_SERVER_IP = "192.168.7.1"\n'
- features += 'TEST_TARGET_IP = "192.168.7.1"\n'
- features += 'TEST_SUITES = "ping"\n'
- features += 'TEST_EXPORT_SDK_ENABLED = "1"\n'
- features += 'TEST_EXPORT_SDK_PACKAGES = "nativesdk-tar"\n'
- self.write_config(features)
-
- # Build tesexport for core-image-minimal
- bitbake('core-image-minimal')
- bitbake('-c testexport core-image-minimal')
-
- # Check for SDK
- testexport_dir = get_bb_var('TEST_EXPORT_DIR', 'core-image-minimal')
- sdk_dir = get_bb_var('TEST_EXPORT_SDK_DIR', 'core-image-minimal')
- tarball_name = "%s.sh" % get_bb_var('TEST_EXPORT_SDK_NAME', 'core-image-minimal')
- tarball_path = os.path.join(testexport_dir, sdk_dir, tarball_name)
- self.assertEqual(os.path.isfile(tarball_path), True, "Couldn't find SDK tarball: %s" % tarball_path)
-
- # Uncompress SDK
- extract_path = os.path.join(testexport_dir, "sysroot")
- result = runCmd("%s -y -d %s" % (tarball_path, extract_path))
-
- # Setting up environment
- current_env = dict(os.environ)
- for f in os.listdir(extract_path):
- if f.startswith("environment-setup"):
- env_file = os.path.join(extract_path, f)
- updateEnv(env_file)
-
- # Check if the SDK directory was added to PATH
- working_path = False
- for path in os.environ['PATH'].split(":"):
- if testexport_dir in path:
- working_path = True
- sdk_path = path
- break
-
- self.assertEqual(working_path, True, "Couldn't find SDK path in PATH")
-
- # Execute tar from SDK path
- cmd_tar = os.path.join(sdk_path, "tar")
- result = runCmd("%s --version" % cmd_tar)
-
- restoreEnv(current_env)
class TestImage(oeSelfTest):
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 4cfa2e1..4f79d15 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -273,22 +273,3 @@ def updateEnv(env_file):
for line in result.output.split("\0"):
(key, _, value) = line.partition("=")
os.environ[key] = value
-
-def restoreEnv(old_env):
- """
- Restore environment with os.environ.
-
- os.environ.clear() will throw an exception if there is
- environment variable without any value, this function
- will deal with such cases.
- """
-
- keys = list(os.environ.keys())
-
- for var in keys:
- if var:
- if not os.environ[var]:
- os.environ[var] = "tmp"
- del os.environ[var]
-
- os.environ.update(old_env)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list