summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-02-28 11:23:07 +0100
committerPatrick Vacek <patrickvacek@gmail.com>2018-02-28 12:16:19 +0100
commit0fb122d88290a7476d694547f4d05a15d5ec38d1 (patch)
tree767d072a3da54a8ce692b8dc65632ca42ae3fe70 /lib
parentc0d6f4c7949ddfc01977096b985c46c28aa8ed4f (diff)
downloadmeta-updater-0fb122d88290a7476d694547f4d05a15d5ec38d1.tar.gz
Add qemu layer for qemu tests if not present.
The layers required for the grub test are now also only added if not already present. This should make the tests runnable from an environment configured for raspberry pi.
Diffstat (limited to 'lib')
-rw-r--r--lib/oeqa/selftest/cases/updater.py61
1 files changed, 53 insertions, 8 deletions
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py
index fe18981..a9c3206 100644
--- a/lib/oeqa/selftest/cases/updater.py
+++ b/lib/oeqa/selftest/cases/updater.py
@@ -139,10 +139,22 @@ class AutoProvTests(OESelftestTestCase):
139 def setUpLocal(self): 139 def setUpLocal(self):
140 self.append_config('MACHINE = "qemux86-64"') 140 self.append_config('MACHINE = "qemux86-64"')
141 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 141 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "')
142 layer = "meta-updater-qemux86-64"
143 result = runCmd('bitbake-layers show-layers')
144 if re.search(layer, result.output) is None:
145 # This is a bit of a hack but I can't see a better option.
146 path = os.path.abspath(os.path.dirname(__file__))
147 metadir = path + "/../../../../../"
148 self.meta_qemu = metadir + layer
149 runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu)
150 else:
151 self.meta_qemu = None
142 self.qemu, self.s = qemu_launch(machine='qemux86-64') 152 self.qemu, self.s = qemu_launch(machine='qemux86-64')
143 153
144 def tearDownLocal(self): 154 def tearDownLocal(self):
145 qemu_terminate(self.s) 155 qemu_terminate(self.s)
156 if self.meta_qemu:
157 runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True)
146 158
147 def qemu_command(self, command): 159 def qemu_command(self, command):
148 return qemu_send_command(self.qemu.ssh_port, command) 160 return qemu_send_command(self.qemu.ssh_port, command)
@@ -178,19 +190,30 @@ class GrubTests(OESelftestTestCase):
178 self.append_config('MACHINE = "intel-corei7-64"') 190 self.append_config('MACHINE = "intel-corei7-64"')
179 self.append_config('OSTREE_BOOTLOADER = "grub"') 191 self.append_config('OSTREE_BOOTLOADER = "grub"')
180 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 192 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "')
193 layer_intel = "meta-intel"
194 layer_minnow = "meta-updater-minnowboard"
195 result = runCmd('bitbake-layers show-layers')
181 # This is a bit of a hack but I can't see a better option. 196 # This is a bit of a hack but I can't see a better option.
182 path = os.path.abspath(os.path.dirname(__file__)) 197 path = os.path.abspath(os.path.dirname(__file__))
183 metadir = path + "/../../../../../" 198 metadir = path + "/../../../../../"
184 self.meta_intel = metadir + "meta-intel" 199 if re.search(layer_intel, result.output) is None:
185 self.meta_minnow = metadir + "meta-updater-minnowboard" 200 self.meta_intel = metadir + layer_intel
186 runCmd('bitbake-layers add-layer "%s"' % self.meta_intel) 201 runCmd('bitbake-layers add-layer "%s"' % self.meta_intel)
187 runCmd('bitbake-layers add-layer "%s"' % self.meta_minnow) 202 else:
203 self.meta_intel = None
204 if re.search(layer_minnow, result.output) is None:
205 self.meta_minnow = metadir + layer_minnow
206 runCmd('bitbake-layers add-layer "%s"' % self.meta_minnow)
207 else:
208 self.meta_minnow = None
188 self.qemu, self.s = qemu_launch(efi=True, machine='intel-corei7-64') 209 self.qemu, self.s = qemu_launch(efi=True, machine='intel-corei7-64')
189 210
190 def tearDownLocal(self): 211 def tearDownLocal(self):
191 qemu_terminate(self.s) 212 qemu_terminate(self.s)
192 runCmd('bitbake-layers remove-layer "%s"' % self.meta_intel, ignore_status=True) 213 if self.meta_intel:
193 runCmd('bitbake-layers remove-layer "%s"' % self.meta_minnow, ignore_status=True) 214 runCmd('bitbake-layers remove-layer "%s"' % self.meta_intel, ignore_status=True)
215 if self.meta_minnow:
216 runCmd('bitbake-layers remove-layer "%s"' % self.meta_minnow, ignore_status=True)
194 217
195 def qemu_command(self, command): 218 def qemu_command(self, command):
196 return qemu_send_command(self.qemu.ssh_port, command) 219 return qemu_send_command(self.qemu.ssh_port, command)
@@ -227,11 +250,22 @@ class ImplProvTests(OESelftestTestCase):
227 def setUpLocal(self): 250 def setUpLocal(self):
228 self.append_config('MACHINE = "qemux86-64"') 251 self.append_config('MACHINE = "qemux86-64"')
229 self.append_config('SOTA_CLIENT_PROV = " aktualizr-implicit-prov "') 252 self.append_config('SOTA_CLIENT_PROV = " aktualizr-implicit-prov "')
230 # note: this will build aktualizr-native as a side-effect 253 layer = "meta-updater-qemux86-64"
254 result = runCmd('bitbake-layers show-layers')
255 if re.search(layer, result.output) is None:
256 # This is a bit of a hack but I can't see a better option.
257 path = os.path.abspath(os.path.dirname(__file__))
258 metadir = path + "/../../../../../"
259 self.meta_qemu = metadir + layer
260 runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu)
261 else:
262 self.meta_qemu = None
231 self.qemu, self.s = qemu_launch(machine='qemux86-64') 263 self.qemu, self.s = qemu_launch(machine='qemux86-64')
232 264
233 def tearDownLocal(self): 265 def tearDownLocal(self):
234 qemu_terminate(self.s) 266 qemu_terminate(self.s)
267 if self.meta_qemu:
268 runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True)
235 269
236 def qemu_command(self, command): 270 def qemu_command(self, command):
237 return qemu_send_command(self.qemu.ssh_port, command) 271 return qemu_send_command(self.qemu.ssh_port, command)
@@ -284,11 +318,22 @@ class HsmTests(OESelftestTestCase):
284 self.append_config('MACHINE = "qemux86-64"') 318 self.append_config('MACHINE = "qemux86-64"')
285 self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"') 319 self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"')
286 self.append_config('SOTA_CLIENT_FEATURES = "hsm"') 320 self.append_config('SOTA_CLIENT_FEATURES = "hsm"')
287 # note: this will build aktualizr-native as a side-effect 321 layer = "meta-updater-qemux86-64"
322 result = runCmd('bitbake-layers show-layers')
323 if re.search(layer, result.output) is None:
324 # This is a bit of a hack but I can't see a better option.
325 path = os.path.abspath(os.path.dirname(__file__))
326 metadir = path + "/../../../../../"
327 self.meta_qemu = metadir + layer
328 runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu)
329 else:
330 self.meta_qemu = None
288 self.qemu, self.s = qemu_launch(machine='qemux86-64') 331 self.qemu, self.s = qemu_launch(machine='qemux86-64')
289 332
290 def tearDownLocal(self): 333 def tearDownLocal(self):
291 qemu_terminate(self.s) 334 qemu_terminate(self.s)
335 if self.meta_qemu:
336 runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True)
292 337
293 def qemu_command(self, command): 338 def qemu_command(self, command):
294 return qemu_send_command(self.qemu.ssh_port, command) 339 return qemu_send_command(self.qemu.ssh_port, command)