summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/targetcontrol.py
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-12-14 21:13:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-16 10:23:23 +0000
commitc4e2c59088765d1f1de7ec57cde91980f887c2ff (patch)
treea2fda8ac5916fb59a711e9220c2177008cca9347 /meta/lib/oeqa/targetcontrol.py
parentd5e67725ac11e3296cad104470931ffa16824b90 (diff)
downloadpoky-c4e2c59088765d1f1de7ec57cde91980f887c2ff.tar.gz
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>
Diffstat (limited to 'meta/lib/oeqa/targetcontrol.py')
-rw-r--r--meta/lib/oeqa/targetcontrol.py52
1 files changed, 26 insertions, 26 deletions
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 24669f461d..d1f441f841 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -19,7 +19,7 @@ from oeqa.controllers.testtargetloader import TestTargetLoader
19from abc import ABCMeta, abstractmethod 19from abc import ABCMeta, abstractmethod
20 20
21def get_target_controller(d): 21def get_target_controller(d):
22 testtarget = d.getVar("TEST_TARGET", True) 22 testtarget = d.getVar("TEST_TARGET")
23 # old, simple names 23 # old, simple names
24 if testtarget == "qemu": 24 if testtarget == "qemu":
25 return QemuTarget(d) 25 return QemuTarget(d)
@@ -33,7 +33,7 @@ def get_target_controller(d):
33 except AttributeError: 33 except AttributeError:
34 # nope, perhaps a layer defined one 34 # nope, perhaps a layer defined one
35 try: 35 try:
36 bbpath = d.getVar("BBPATH", True).split(':') 36 bbpath = d.getVar("BBPATH").split(':')
37 testtargetloader = TestTargetLoader() 37 testtargetloader = TestTargetLoader()
38 controller = testtargetloader.get_controller_module(testtarget, bbpath) 38 controller = testtargetloader.get_controller_module(testtarget, bbpath)
39 except ImportError as e: 39 except ImportError as e:
@@ -51,9 +51,9 @@ class BaseTarget(object, metaclass=ABCMeta):
51 self.connection = None 51 self.connection = None
52 self.ip = None 52 self.ip = None
53 self.server_ip = None 53 self.server_ip = None
54 self.datetime = d.getVar('DATETIME', True) 54 self.datetime = d.getVar('DATETIME')
55 self.testdir = d.getVar("TEST_LOG_DIR", True) 55 self.testdir = d.getVar("TEST_LOG_DIR")
56 self.pn = d.getVar("PN", True) 56 self.pn = d.getVar("PN")
57 57
58 @abstractmethod 58 @abstractmethod
59 def deploy(self): 59 def deploy(self):
@@ -80,7 +80,7 @@ class BaseTarget(object, metaclass=ABCMeta):
80 @classmethod 80 @classmethod
81 def match_image_fstype(self, d, image_fstypes=None): 81 def match_image_fstype(self, d, image_fstypes=None):
82 if not image_fstypes: 82 if not image_fstypes:
83 image_fstypes = d.getVar('IMAGE_FSTYPES', True).split(' ') 83 image_fstypes = d.getVar('IMAGE_FSTYPES').split(' ')
84 possible_image_fstypes = [fstype for fstype in self.supported_image_fstypes if fstype in image_fstypes] 84 possible_image_fstypes = [fstype for fstype in self.supported_image_fstypes if fstype in image_fstypes]
85 if possible_image_fstypes: 85 if possible_image_fstypes:
86 return possible_image_fstypes[0] 86 return possible_image_fstypes[0]
@@ -119,14 +119,14 @@ class QemuTarget(BaseTarget):
119 119
120 self.image_fstype = self.get_image_fstype(d) 120 self.image_fstype = self.get_image_fstype(d)
121 self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime) 121 self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
122 self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype) 122 self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
123 self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin') 123 self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
124 dump_target_cmds = d.getVar("testimage_dump_target", True) 124 dump_target_cmds = d.getVar("testimage_dump_target")
125 dump_host_cmds = d.getVar("testimage_dump_host", True) 125 dump_host_cmds = d.getVar("testimage_dump_host")
126 dump_dir = d.getVar("TESTIMAGE_DUMP_DIR", True) 126 dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
127 if d.getVar("QEMU_USE_KVM", False) is not None \ 127 if d.getVar("QEMU_USE_KVM", False) is not None \
128 and d.getVar("QEMU_USE_KVM", False) == "True" \ 128 and d.getVar("QEMU_USE_KVM", False) == "True" \
129 and "x86" in d.getVar("MACHINE", True): 129 and "x86" in d.getVar("MACHINE"):
130 use_kvm = True 130 use_kvm = True
131 else: 131 else:
132 use_kvm = False 132 use_kvm = False
@@ -141,26 +141,26 @@ class QemuTarget(BaseTarget):
141 logger.addHandler(loggerhandler) 141 logger.addHandler(loggerhandler)
142 oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True) 142 oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
143 143
144 if d.getVar("DISTRO", True) == "poky-tiny": 144 if d.getVar("DISTRO") == "poky-tiny":
145 self.runner = QemuTinyRunner(machine=d.getVar("MACHINE", True), 145 self.runner = QemuTinyRunner(machine=d.getVar("MACHINE"),
146 rootfs=self.rootfs, 146 rootfs=self.rootfs,
147 tmpdir = d.getVar("TMPDIR", True), 147 tmpdir = d.getVar("TMPDIR"),
148 deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True), 148 deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"),
149 display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True), 149 display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"),
150 logfile = self.qemulog, 150 logfile = self.qemulog,
151 kernel = self.kernel, 151 kernel = self.kernel,
152 boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True))) 152 boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")))
153 else: 153 else:
154 self.runner = QemuRunner(machine=d.getVar("MACHINE", True), 154 self.runner = QemuRunner(machine=d.getVar("MACHINE"),
155 rootfs=self.rootfs, 155 rootfs=self.rootfs,
156 tmpdir = d.getVar("TMPDIR", True), 156 tmpdir = d.getVar("TMPDIR"),
157 deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True), 157 deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"),
158 display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True), 158 display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"),
159 logfile = self.qemulog, 159 logfile = self.qemulog,
160 boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)), 160 boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")),
161 use_kvm = use_kvm, 161 use_kvm = use_kvm,
162 dump_dir = dump_dir, 162 dump_dir = dump_dir,
163 dump_host_cmds = d.getVar("testimage_dump_host", True)) 163 dump_host_cmds = d.getVar("testimage_dump_host"))
164 164
165 self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner) 165 self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
166 166
@@ -214,14 +214,14 @@ class SimpleRemoteTarget(BaseTarget):
214 214
215 def __init__(self, d): 215 def __init__(self, d):
216 super(SimpleRemoteTarget, self).__init__(d) 216 super(SimpleRemoteTarget, self).__init__(d)
217 addr = d.getVar("TEST_TARGET_IP", True) or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.') 217 addr = d.getVar("TEST_TARGET_IP") or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
218 self.ip = addr.split(":")[0] 218 self.ip = addr.split(":")[0]
219 try: 219 try:
220 self.port = addr.split(":")[1] 220 self.port = addr.split(":")[1]
221 except IndexError: 221 except IndexError:
222 self.port = None 222 self.port = None
223 bb.note("Target IP: %s" % self.ip) 223 bb.note("Target IP: %s" % self.ip)
224 self.server_ip = d.getVar("TEST_SERVER_IP", True) 224 self.server_ip = d.getVar("TEST_SERVER_IP")
225 if not self.server_ip: 225 if not self.server_ip:
226 try: 226 try:
227 self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1] 227 self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]