mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00: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
@@ -13,7 +13,7 @@ def setUpModule():
|
||||
skipModule("Image doesn't have package management feature")
|
||||
if not oeRuntimeTest.hasPackage("smartpm"):
|
||||
skipModule("Image doesn't have smart installed")
|
||||
if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
|
||||
if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES").split()[0]:
|
||||
skipModule("Rpm is not the primary package manager")
|
||||
|
||||
class PtestRunnerTest(oeRuntimeTest):
|
||||
@@ -57,7 +57,7 @@ class PtestRunnerTest(oeRuntimeTest):
|
||||
# (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
|
||||
# for x in result.split("\n"):
|
||||
# self.existingchannels.add(x)
|
||||
self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip)
|
||||
self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR'), oeRuntimeTest.tc.target.server_ip)
|
||||
self.repo_server.start()
|
||||
|
||||
@classmethod
|
||||
@@ -70,23 +70,23 @@ class PtestRunnerTest(oeRuntimeTest):
|
||||
# oeRuntimeTest.tc.target.run('smart channel --remove '+x[1:-1]+' -y', 0)
|
||||
|
||||
def add_smart_channel(self):
|
||||
image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
|
||||
image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE')
|
||||
deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
|
||||
pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
|
||||
pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS').replace("-","_").split()
|
||||
for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
|
||||
if arch in pkgarchs:
|
||||
self.target.run('smart channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url), 0)
|
||||
self.target.run('smart update', 0)
|
||||
|
||||
def install_complementary(self, globs=None):
|
||||
installed_pkgs_file = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True),
|
||||
installed_pkgs_file = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR'),
|
||||
"installed_pkgs.txt")
|
||||
self.pkgs_list = RpmPkgsList(oeRuntimeTest.tc.d, oeRuntimeTest.tc.d.getVar('IMAGE_ROOTFS', True), oeRuntimeTest.tc.d.getVar('arch_var', True), oeRuntimeTest.tc.d.getVar('os_var', True))
|
||||
self.pkgs_list = RpmPkgsList(oeRuntimeTest.tc.d, oeRuntimeTest.tc.d.getVar('IMAGE_ROOTFS'), oeRuntimeTest.tc.d.getVar('arch_var'), oeRuntimeTest.tc.d.getVar('os_var'))
|
||||
with open(installed_pkgs_file, "w+") as installed_pkgs:
|
||||
installed_pkgs.write(self.pkgs_list.list("arch"))
|
||||
|
||||
cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
|
||||
"-p", oeRuntimeTest.tc.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
|
||||
"-p", oeRuntimeTest.tc.d.getVar('PKGDATA_DIR'), "glob", installed_pkgs_file,
|
||||
globs]
|
||||
try:
|
||||
bb.note("Installing complementary packages ...")
|
||||
@@ -99,7 +99,7 @@ class PtestRunnerTest(oeRuntimeTest):
|
||||
return complementary_pkgs.split()
|
||||
|
||||
def setUpLocal(self):
|
||||
self.ptest_log = os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR",True), "ptest-%s.log" % oeRuntimeTest.tc.d.getVar('DATETIME', True))
|
||||
self.ptest_log = os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR",True), "ptest-%s.log" % oeRuntimeTest.tc.d.getVar('DATETIME'))
|
||||
|
||||
@skipUnlessPassed('test_ssh')
|
||||
def test_ptestrunner(self):
|
||||
|
||||
@@ -5,11 +5,11 @@ import re
|
||||
class DateTest(oeRuntimeTest):
|
||||
|
||||
def setUpLocal(self):
|
||||
if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
|
||||
if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager") == "systemd":
|
||||
self.target.run('systemctl stop systemd-timesyncd')
|
||||
|
||||
def tearDownLocal(self):
|
||||
if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
|
||||
if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager") == "systemd":
|
||||
self.target.run('systemctl start systemd-timesyncd')
|
||||
|
||||
@testcase(211)
|
||||
|
||||
@@ -3,7 +3,7 @@ from oeqa.oetest import oeRuntimeTest, skipModule
|
||||
from oeqa.utils.decorators import *
|
||||
|
||||
def setUpModule():
|
||||
multilibs = oeRuntimeTest.tc.d.getVar("MULTILIBS", True) or ""
|
||||
multilibs = oeRuntimeTest.tc.d.getVar("MULTILIBS") or ""
|
||||
if "multilib:lib32" not in multilibs:
|
||||
skipModule("this isn't a multilib:lib32 image")
|
||||
|
||||
|
||||
@@ -193,10 +193,10 @@ class ParseLogsTest(oeRuntimeTest):
|
||||
self.ignore_errors[machine] = self.ignore_errors[machine] + video_related
|
||||
|
||||
def getMachine(self):
|
||||
return oeRuntimeTest.tc.d.getVar("MACHINE", True)
|
||||
return oeRuntimeTest.tc.d.getVar("MACHINE")
|
||||
|
||||
def getWorkdir(self):
|
||||
return oeRuntimeTest.tc.d.getVar("WORKDIR", True)
|
||||
return oeRuntimeTest.tc.d.getVar("WORKDIR")
|
||||
|
||||
#get some information on the CPU of the machine to display at the beginning of the output. This info might be useful in some cases.
|
||||
def getHardwareInfo(self):
|
||||
|
||||
@@ -7,7 +7,7 @@ from oeqa.utils.decorators import *
|
||||
def setUpModule():
|
||||
if not oeRuntimeTest.hasFeature("package-management"):
|
||||
skipModule("rpm module skipped: target doesn't have package-management in IMAGE_FEATURES")
|
||||
if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
|
||||
if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES").split()[0]:
|
||||
skipModule("rpm module skipped: target doesn't have rpm as primary package manager")
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ class RpmInstallRemoveTest(oeRuntimeTest):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(self):
|
||||
pkgarch = oeRuntimeTest.tc.d.getVar('TUNE_PKGARCH', True).replace("-", "_")
|
||||
rpmdir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), "rpm", pkgarch)
|
||||
pkgarch = oeRuntimeTest.tc.d.getVar('TUNE_PKGARCH').replace("-", "_")
|
||||
rpmdir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR'), "rpm", pkgarch)
|
||||
# pick rpm-doc as a test file to get installed, because it's small and it will always be built for standard targets
|
||||
for f in fnmatch.filter(os.listdir(rpmdir), "rpm-doc-*.%s.rpm" % pkgarch):
|
||||
testrpmfile = f
|
||||
|
||||
@@ -11,7 +11,7 @@ class ScpTest(oeRuntimeTest):
|
||||
@testcase(220)
|
||||
@skipUnlessPassed('test_ssh')
|
||||
def test_scp_file(self):
|
||||
test_log_dir = oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True)
|
||||
test_log_dir = oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR")
|
||||
test_file_path = os.path.join(test_log_dir, 'test_scp_file')
|
||||
with open(test_file_path, 'w') as test_scp_file:
|
||||
test_scp_file.seek(2 ** 22 - 1)
|
||||
|
||||
@@ -11,7 +11,7 @@ def setUpModule():
|
||||
skipModule("Image doesn't have package management feature")
|
||||
if not oeRuntimeTest.hasPackage("smartpm"):
|
||||
skipModule("Image doesn't have smart installed")
|
||||
if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
|
||||
if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES").split()[0]:
|
||||
skipModule("Rpm is not the primary package manager")
|
||||
|
||||
class SmartTest(oeRuntimeTest):
|
||||
@@ -75,16 +75,16 @@ class SmartRepoTest(SmartTest):
|
||||
rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo")
|
||||
index_cmds = []
|
||||
rpm_dirs_found = False
|
||||
archs = (oeRuntimeTest.tc.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
|
||||
archs = (oeRuntimeTest.tc.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").replace('-', '_').split()
|
||||
for arch in archs:
|
||||
rpm_dir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR_RPM', True), arch)
|
||||
idx_path = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True), 'rpm', arch)
|
||||
db_path = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True), 'rpmdb', arch)
|
||||
rpm_dir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR_RPM'), arch)
|
||||
idx_path = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR'), 'rpm', arch)
|
||||
db_path = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR'), 'rpmdb', arch)
|
||||
if not os.path.isdir(rpm_dir):
|
||||
continue
|
||||
if os.path.exists(db_path):
|
||||
bb.utils.remove(dbpath, True)
|
||||
lockfilename = oeRuntimeTest.tc.d.getVar('DEPLOY_DIR_RPM', True) + "/rpm.lock"
|
||||
lockfilename = oeRuntimeTest.tc.d.getVar('DEPLOY_DIR_RPM') + "/rpm.lock"
|
||||
lf = bb.utils.lockfile(lockfilename, False)
|
||||
oe.path.copyhardlinktree(rpm_dir, idx_path)
|
||||
# Full indexes overload a 256MB image so reduce the number of rpms
|
||||
@@ -98,7 +98,7 @@ class SmartRepoTest(SmartTest):
|
||||
result = oe.utils.multiprocess_exec(index_cmds, self.create_index)
|
||||
if result:
|
||||
bb.fatal('%s' % ('\n'.join(result)))
|
||||
self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('WORKDIR', True), oeRuntimeTest.tc.target.server_ip)
|
||||
self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('WORKDIR'), oeRuntimeTest.tc.target.server_ip)
|
||||
self.repo_server.start()
|
||||
|
||||
@classmethod
|
||||
@@ -113,9 +113,9 @@ class SmartRepoTest(SmartTest):
|
||||
|
||||
@testcase(719)
|
||||
def test_smart_channel_add(self):
|
||||
image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
|
||||
image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE')
|
||||
deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
|
||||
pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
|
||||
pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS').replace("-","_").split()
|
||||
for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
|
||||
if arch in pkgarchs:
|
||||
self.smart('channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url))
|
||||
|
||||
@@ -6,7 +6,7 @@ from oeqa.utils.decorators import *
|
||||
def setUpModule():
|
||||
if not oeRuntimeTest.hasFeature("systemd"):
|
||||
skipModule("target doesn't have systemd in DISTRO_FEATURES")
|
||||
if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True):
|
||||
if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"):
|
||||
skipModule("systemd is not the init manager for this image")
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from oeqa.utils.decorators import *
|
||||
|
||||
def setUpModule():
|
||||
#check if DEFAULTTUNE is set and it's value is: x86-64-x32
|
||||
defaulttune = oeRuntimeTest.tc.d.getVar("DEFAULTTUNE", True)
|
||||
defaulttune = oeRuntimeTest.tc.d.getVar("DEFAULTTUNE")
|
||||
if "x86-64-x32" not in defaulttune:
|
||||
skipModule("DEFAULTTUNE is not set to x86-64-x32")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user