summaryrefslogtreecommitdiffstats
path: root/lib/oeqa
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-02-20 11:56:55 +0100
committerPatrick Vacek <patrickvacek@gmail.com>2018-02-20 11:56:55 +0100
commite77c7c7b6121ed9ad207d7fd1603a32e59540f00 (patch)
treecdb4b045a58ebbb066e3bcd7b3ceebf0477a961f /lib/oeqa
parent5c141641e143883e06b815371dd69551dbf3d52a (diff)
downloadmeta-updater-e77c7c7b6121ed9ad207d7fd1603a32e59540f00.tar.gz
Replace write_config with append_config.
Also fix a minor provisioning check ordering problem.
Diffstat (limited to 'lib/oeqa')
-rw-r--r--lib/oeqa/selftest/updater.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py
index 0ef3e16..703df91 100644
--- a/lib/oeqa/selftest/updater.py
+++ b/lib/oeqa/selftest/updater.py
@@ -57,7 +57,7 @@ class GeneralTests(oeSelfTest):
57 def test_credentials(self): 57 def test_credentials(self):
58 logger = logging.getLogger("selftest") 58 logger = logging.getLogger("selftest")
59 logger.info('Running bitbake to build core-image-minimal') 59 logger.info('Running bitbake to build core-image-minimal')
60 self.write_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 60 self.append_config('SOTA_CLIENT_PROV = "aktualizr-auto-prov"')
61 bitbake('core-image-minimal') 61 bitbake('core-image-minimal')
62 credentials = get_bb_var('SOTA_PACKED_CREDENTIALS') 62 credentials = get_bb_var('SOTA_PACKED_CREDENTIALS')
63 # skip the test if the variable SOTA_PACKED_CREDENTIALS is not set 63 # skip the test if the variable SOTA_PACKED_CREDENTIALS is not set
@@ -74,7 +74,8 @@ class GeneralTests(oeSelfTest):
74 74
75 def test_java(self): 75 def test_java(self):
76 result = runCmd('which java', ignore_status=True) 76 result = runCmd('which java', ignore_status=True)
77 self.assertEqual(result.status, 0, "Java not found.") 77 self.assertEqual(result.status, 0,
78 "Java not found. Do you have a JDK installed on your host machine?")
78 79
79 def test_add_package(self): 80 def test_add_package(self):
80 print('') 81 print('')
@@ -84,7 +85,7 @@ class GeneralTests(oeSelfTest):
84 logger = logging.getLogger("selftest") 85 logger = logging.getLogger("selftest")
85 86
86 logger.info('Running bitbake with man in the image package list') 87 logger.info('Running bitbake with man in the image package list')
87 self.write_config('IMAGE_INSTALL_append = " man "') 88 self.append_config('IMAGE_INSTALL_append = " man "')
88 bitbake('-c cleanall man') 89 bitbake('-c cleanall man')
89 bitbake('core-image-minimal') 90 bitbake('core-image-minimal')
90 result = runCmd('oe-pkgdata-util find-path /usr/bin/man') 91 result = runCmd('oe-pkgdata-util find-path /usr/bin/man')
@@ -94,7 +95,7 @@ class GeneralTests(oeSelfTest):
94 logger.info('First image %s has size %i' % (path1, size1)) 95 logger.info('First image %s has size %i' % (path1, size1))
95 96
96 logger.info('Running bitbake without man in the image package list') 97 logger.info('Running bitbake without man in the image package list')
97 self.write_config('IMAGE_INSTALL_remove = " man "') 98 self.append_config('IMAGE_INSTALL_remove = " man "')
98 bitbake('-c cleanall man') 99 bitbake('-c cleanall man')
99 bitbake('core-image-minimal') 100 bitbake('core-image-minimal')
100 result = runCmd('oe-pkgdata-util find-path /usr/bin/man', ignore_status=True) 101 result = runCmd('oe-pkgdata-util find-path /usr/bin/man', ignore_status=True)
@@ -230,7 +231,7 @@ class GrubTests(oeSelfTest):
230 value = stdout.decode()[:-1] 231 value = stdout.decode()[:-1]
231 self.assertEqual(value, machine, 232 self.assertEqual(value, machine,
232 'MACHINE does not match hostname: ' + machine + ', ' + value + 233 'MACHINE does not match hostname: ' + machine + ', ' + value +
233 '\nIs TianoCore ovmf installed?') 234 '\nIs TianoCore ovmf installed on your host machine?')
234 print(value) 235 print(value)
235 print('Checking output of aktualizr-info:') 236 print('Checking output of aktualizr-info:')
236 ran_ok = False 237 ran_ok = False
@@ -246,8 +247,8 @@ class GrubTests(oeSelfTest):
246class HsmTests(oeSelfTest): 247class HsmTests(oeSelfTest):
247 248
248 def setUpLocal(self): 249 def setUpLocal(self):
249 self.write_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"') 250 self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"')
250 self.write_config('SOTA_CLIENT_FEATURES = "hsm"') 251 self.append_config('SOTA_CLIENT_FEATURES = "hsm"')
251 self.qemu, self.s = qemu_launch(machine='qemux86-64') 252 self.qemu, self.s = qemu_launch(machine='qemux86-64')
252 253
253 def tearDownLocal(self): 254 def tearDownLocal(self):
@@ -349,7 +350,7 @@ class HsmTests(oeSelfTest):
349 for delay in [5, 5, 5, 5, 10]: 350 for delay in [5, 5, 5, 5, 10]:
350 sleep(delay) 351 sleep(delay)
351 stdout, stderr, retcode = self.qemu_command('aktualizr-info') 352 stdout, stderr, retcode = self.qemu_command('aktualizr-info')
352 if retcode == 0 and stderr == b'' and stdout.decode().find('Provisioned on server: yes') >= 0: 353 if retcode == 0 and stderr == b'' and stdout.decode().find('Fetched metadata: yes') >= 0:
353 ran_ok = True 354 ran_ok = True
354 break 355 break
355 self.assertIn(b'Device ID: ', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode()) 356 self.assertIn(b'Device ID: ', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode())