summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRunar Borge <runar@borge.nu>2020-02-06 21:51:51 +0100
committerRunar Borge <runar@borge.nu>2020-02-06 21:51:51 +0100
commit1d2a470a30920a54d2ffc93908a79c60a395130c (patch)
tree32265b443d0554cb07b247b31deb6b14de9ebdd8 /scripts
parent102e7c1020f3d863b95c66d6423af8975eb24902 (diff)
downloadvyos-build-1d2a470a30920a54d2ffc93908a79c60a395130c.tar.gz
vyos-build-1d2a470a30920a54d2ffc93908a79c60a395130c.zip
Testsuite: redo smoketest executor and fix exitcode validator
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-qemu-install45
1 files changed, 24 insertions, 21 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install
index a6cc9b60..94300d34 100755
--- a/scripts/check-qemu-install
+++ b/scripts/check-qemu-install
@@ -288,27 +288,30 @@ try:
#################################################
log.info("Executing test-suite ")
- def cr(child, command):
- child.sendline(command)
- i = child.expect(['\n +Invalid command:',
- '\n +Set failed',
- 'No such file or directory',
- 'SMOKETEST FAILED!',
- r'\n\S+@\S+[$#]'], timeout=1800)
-
- if i==0:
- raise Exception('Invalid command detected')
- elif i==1:
- raise Exception('Set syntax failed :/')
- elif i==2:
- log.error("Did not find VyOS smoketest, this should be an exception")
- raise Exception("WTF? did not find VyOS smoketest, this should be an exception")
- elif i==3:
- log.error("Smoketest failed with an non-zero exitcode")
-
- cr(c, '/usr/bin/vyos-smoketest || echo "SMOKETEST FAILED!"')
-
- log.info("Smoke test status")
+ c.sendline('/usr/bin/vyos-smoketest')
+ i = c.expect(['\n +Invalid command:',
+ '\n +Set failed',
+ 'No such file or directory',
+ r'\n\S+@\S+[$#]'], timeout=1800)
+
+ if i==0:
+ raise Exception('Invalid command detected')
+ elif i==1:
+ raise Exception('Set syntax failed :/')
+ elif i==2:
+ log.error("Did not find VyOS smoketest, this should be an exception")
+ raise Exception("WTF? did not find VyOS smoketest, this should be an exception")
+
+ c.sendline('echo EXITCODE:$\x16?')
+ i = c.expect(['EXITCODE:0', 'EXITCODE:\d+'], timeout=10)
+ if i==0:
+ log.info('Smoketest finished successfully!')
+ pass
+ if i==1:
+ log.error('Smoketest failed :/')
+ raise Exception("Smoketest-failed, please look into debug output")
+
+ #log.info("Smoke test status")
#data = c.before.decode()
#################################################