mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d5e67725ac
commit
c4e2c59088
@@ -221,15 +221,15 @@ class TestContext(object):
|
||||
path = [os.path.dirname(os.path.abspath(__file__))]
|
||||
extrapath = ""
|
||||
else:
|
||||
path = d.getVar("BBPATH", True).split(':')
|
||||
path = d.getVar("BBPATH").split(':')
|
||||
extrapath = "lib/oeqa"
|
||||
|
||||
self.testslist = self._get_tests_list(path, extrapath)
|
||||
self.testsrequired = self._get_test_suites_required()
|
||||
|
||||
self.filesdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "runtime/files")
|
||||
self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split()
|
||||
self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split()
|
||||
self.imagefeatures = d.getVar("IMAGE_FEATURES").split()
|
||||
self.distrofeatures = d.getVar("DISTRO_FEATURES").split()
|
||||
|
||||
# get testcase list from specified file
|
||||
# if path is a relative path, then relative to build/conf/
|
||||
@@ -406,9 +406,9 @@ class RuntimeTestContext(TestContext):
|
||||
self.target = target
|
||||
|
||||
self.pkgmanifest = {}
|
||||
manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),
|
||||
d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
|
||||
nomanifest = d.getVar("IMAGE_NO_MANIFEST", True)
|
||||
manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"),
|
||||
d.getVar("IMAGE_LINK_NAME") + ".manifest")
|
||||
nomanifest = d.getVar("IMAGE_NO_MANIFEST")
|
||||
if nomanifest is None or nomanifest != "1":
|
||||
try:
|
||||
with open(manifest) as f:
|
||||
@@ -424,19 +424,19 @@ class RuntimeTestContext(TestContext):
|
||||
def _get_test_suites(self):
|
||||
testsuites = []
|
||||
|
||||
manifests = (self.d.getVar("TEST_SUITES_MANIFEST", True) or '').split()
|
||||
manifests = (self.d.getVar("TEST_SUITES_MANIFEST") or '').split()
|
||||
if manifests:
|
||||
for manifest in manifests:
|
||||
testsuites.extend(self._read_testlist(manifest,
|
||||
self.d.getVar("TOPDIR", True)).split())
|
||||
self.d.getVar("TOPDIR")).split())
|
||||
|
||||
else:
|
||||
testsuites = self.d.getVar("TEST_SUITES", True).split()
|
||||
testsuites = self.d.getVar("TEST_SUITES").split()
|
||||
|
||||
return testsuites
|
||||
|
||||
def _get_test_suites_required(self):
|
||||
return [t for t in self.d.getVar("TEST_SUITES", True).split() if t != "auto"]
|
||||
return [t for t in self.d.getVar("TEST_SUITES").split() if t != "auto"]
|
||||
|
||||
def loadTests(self):
|
||||
super(RuntimeTestContext, self).loadTests()
|
||||
@@ -449,10 +449,10 @@ class RuntimeTestContext(TestContext):
|
||||
"""
|
||||
|
||||
modules = self.getTestModules()
|
||||
bbpaths = self.d.getVar("BBPATH", True).split(":")
|
||||
bbpaths = self.d.getVar("BBPATH").split(":")
|
||||
|
||||
shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR", True))
|
||||
shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR", True))
|
||||
shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR"))
|
||||
shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR"))
|
||||
for module in modules:
|
||||
json_file = self._getJsonFile(module)
|
||||
if json_file:
|
||||
@@ -466,8 +466,8 @@ class RuntimeTestContext(TestContext):
|
||||
|
||||
import oe.path
|
||||
|
||||
extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True)
|
||||
packaged_path = self.d.getVar("TEST_PACKAGED_DIR", True)
|
||||
extracted_path = self.d.getVar("TEST_EXTRACTED_DIR")
|
||||
packaged_path = self.d.getVar("TEST_PACKAGED_DIR")
|
||||
|
||||
for key,value in needed_packages.items():
|
||||
packages = ()
|
||||
@@ -548,7 +548,7 @@ class RuntimeTestContext(TestContext):
|
||||
|
||||
from oeqa.utils.package_manager import get_package_manager
|
||||
|
||||
pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR", True), pkg)
|
||||
pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
|
||||
pm = get_package_manager(self.d, pkg_path)
|
||||
extract_dir = pm.extract(pkg)
|
||||
shutil.rmtree(pkg_path)
|
||||
@@ -562,8 +562,8 @@ class RuntimeTestContext(TestContext):
|
||||
|
||||
from oeqa.utils.package_manager import get_package_manager
|
||||
|
||||
pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR", True), pkg)
|
||||
dst_dir = self.d.getVar("TEST_PACKAGED_DIR", True)
|
||||
pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
|
||||
dst_dir = self.d.getVar("TEST_PACKAGED_DIR")
|
||||
pm = get_package_manager(self.d, pkg_path)
|
||||
pkg_info = pm.package_info(pkg)
|
||||
file_path = pkg_info[pkg]["filepath"]
|
||||
@@ -611,7 +611,7 @@ class ImageTestContext(RuntimeTestContext):
|
||||
def __init__(self, d, target, host_dumper):
|
||||
super(ImageTestContext, self).__init__(d, target)
|
||||
|
||||
self.tagexp = d.getVar("TEST_SUITES_TAGS", True)
|
||||
self.tagexp = d.getVar("TEST_SUITES_TAGS")
|
||||
|
||||
self.host_dumper = host_dumper
|
||||
|
||||
@@ -629,7 +629,7 @@ class ImageTestContext(RuntimeTestContext):
|
||||
Check if the test requires a package and Install/Unistall it in the DUT
|
||||
"""
|
||||
|
||||
pkg_dir = self.d.getVar("TEST_EXTRACTED_DIR", True)
|
||||
pkg_dir = self.d.getVar("TEST_EXTRACTED_DIR")
|
||||
super(ImageTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
|
||||
|
||||
class ExportTestContext(RuntimeTestContext):
|
||||
@@ -643,7 +643,7 @@ class ExportTestContext(RuntimeTestContext):
|
||||
super(ExportTestContext, self).__init__(d, target, exported)
|
||||
|
||||
tag = parsedArgs.get("tag", None)
|
||||
self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS", True)
|
||||
self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS")
|
||||
|
||||
self.sigterm = None
|
||||
|
||||
@@ -653,7 +653,7 @@ class ExportTestContext(RuntimeTestContext):
|
||||
"""
|
||||
|
||||
export_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||
extracted_dir = self.d.getVar("TEST_EXPORT_EXTRACTED_DIR", True)
|
||||
extracted_dir = self.d.getVar("TEST_EXPORT_EXTRACTED_DIR")
|
||||
pkg_dir = os.path.join(export_dir, extracted_dir)
|
||||
super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
|
||||
|
||||
@@ -666,7 +666,7 @@ class SDKTestContext(TestContext):
|
||||
self.tcname = tcname
|
||||
|
||||
if not hasattr(self, 'target_manifest'):
|
||||
self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True)
|
||||
self.target_manifest = d.getVar("SDK_TARGET_MANIFEST")
|
||||
try:
|
||||
self.pkgmanifest = {}
|
||||
with open(self.target_manifest) as f:
|
||||
@@ -677,7 +677,7 @@ class SDKTestContext(TestContext):
|
||||
bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
|
||||
|
||||
if not hasattr(self, 'host_manifest'):
|
||||
self.host_manifest = d.getVar("SDK_HOST_MANIFEST", True)
|
||||
self.host_manifest = d.getVar("SDK_HOST_MANIFEST")
|
||||
try:
|
||||
with open(self.host_manifest) as f:
|
||||
self.hostpkgmanifest = f.read()
|
||||
@@ -688,16 +688,16 @@ class SDKTestContext(TestContext):
|
||||
return "sdk"
|
||||
|
||||
def _get_test_suites(self):
|
||||
return (self.d.getVar("TEST_SUITES_SDK", True) or "auto").split()
|
||||
return (self.d.getVar("TEST_SUITES_SDK") or "auto").split()
|
||||
|
||||
def _get_test_suites_required(self):
|
||||
return [t for t in (self.d.getVar("TEST_SUITES_SDK", True) or \
|
||||
return [t for t in (self.d.getVar("TEST_SUITES_SDK") or \
|
||||
"auto").split() if t != "auto"]
|
||||
|
||||
class SDKExtTestContext(SDKTestContext):
|
||||
def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
|
||||
self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True)
|
||||
self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True)
|
||||
self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST")
|
||||
self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST")
|
||||
if args:
|
||||
self.cm = args[0] # Compatibility mode for run SDK tests
|
||||
else:
|
||||
@@ -715,8 +715,8 @@ class SDKExtTestContext(SDKTestContext):
|
||||
return "sdkext"
|
||||
|
||||
def _get_test_suites(self):
|
||||
return (self.d.getVar("TEST_SUITES_SDK_EXT", True) or "auto").split()
|
||||
return (self.d.getVar("TEST_SUITES_SDK_EXT") or "auto").split()
|
||||
|
||||
def _get_test_suites_required(self):
|
||||
return [t for t in (self.d.getVar("TEST_SUITES_SDK_EXT", True) or \
|
||||
return [t for t in (self.d.getVar("TEST_SUITES_SDK_EXT") or \
|
||||
"auto").split() if t != "auto"]
|
||||
|
||||
Reference in New Issue
Block a user