diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-02-06 22:00:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-06 22:00:48 +0100 |
commit | 9f1bcac933fd77efc5c249f83b3af17ec3cef498 (patch) | |
tree | 32265b443d0554cb07b247b31deb6b14de9ebdd8 /scripts/check-qemu-install | |
parent | d45dddd5823151152ca54fef06c1298d5506b5a0 (diff) | |
parent | fd7acd7d7d895b90254a3c8fd2485d0cea19111c (diff) | |
download | vyos-build-9f1bcac933fd77efc5c249f83b3af17ec3cef498.tar.gz vyos-build-9f1bcac933fd77efc5c249f83b3af17ec3cef498.zip |
Merge pull request #81 from runborg/smokefail
Testsuite: redo smoketest executor and fix exitcode validator
Diffstat (limited to 'scripts/check-qemu-install')
-rwxr-xr-x | scripts/check-qemu-install | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 0c443f18..94300d34 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -288,23 +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', - 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") - cr(c, '/usr/bin/vyos-smoketest') - - 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() ################################################# |