summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-09-06 20:54:38 +0200
committerChristian Breunig <christian@breunig.cc>2024-09-07 21:32:34 +0200
commite86bfd7ab96333fb3dec62a15b9e9720d95dbda8 (patch)
tree09389f5bdffa61dadae519252737d889df9200bb
parent6ef7069098245cee78918b84821909fcdb42b39d (diff)
downloadvyos-build-e86bfd7ab96333fb3dec62a15b9e9720d95dbda8.tar.gz
vyos-build-e86bfd7ab96333fb3dec62a15b9e9720d95dbda8.zip
Testsuite: T861: add explicit --smoketest argument
In the past the CLI based smoketest was always executed under an else branch in the testcase if-statement. Instead of using negative logic move all testcases to positive logic adding an empty "catch all" else path.
-rw-r--r--Makefile6
-rwxr-xr-xscripts/check-qemu-install13
2 files changed, 13 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index f084c442..85510131 100644
--- a/Makefile
+++ b/Makefile
@@ -21,12 +21,12 @@ checkiso:
.PHONY: test
.ONESHELL:
test: checkiso
- scripts/check-qemu-install --debug --configd --match="$(MATCH)" --uefi build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --configd --match="$(MATCH)" --smoketest --uefi build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
.PHONY: test-no-interfaces
.ONESHELL:
test-no-interfaces: checkiso
- scripts/check-qemu-install --debug --configd --match="$(MATCH)" --uefi --no-interfaces build/live-image-amd64.hybrid.iso
+ scripts/check-qemu-install --debug --configd --match="$(MATCH)" --smoketest --uefi --no-interfaces build/live-image-amd64.hybrid.iso
.PHONY: testc
.ONESHELL:
@@ -36,7 +36,7 @@ testc: checkiso
.PHONY: testraid
.ONESHELL:
testraid: checkiso
- scripts/check-qemu-install --debug --configd --raid --configtest build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
+ scripts/check-qemu-install --debug --configd --raid build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
.PHONY: testtpm
.ONESHELL:
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install
index eb126e92..921384cc 100755
--- a/scripts/check-qemu-install
+++ b/scripts/check-qemu-install
@@ -72,6 +72,8 @@ parser.add_argument('--configd', help='Execute testsuite with config daemon', ac
default=False)
parser.add_argument('--no-interfaces', help='Execute testsuite without interface tests to save time',
action='store_true', default=False)
+parser.add_argument('--smoketest', help='Execute script based CLI smoketests',
+ action='store_true', default=False)
parser.add_argument('--configtest', help='Execute load/commit config tests',
action='store_true', default=False)
parser.add_argument('--tpmtest', help='Execute TPM encrypted config tests',
@@ -634,7 +636,7 @@ try:
c.sendline('cat /proc/mdstat')
c.expect(op_mode_prompt)
- elif not args.configtest:
+ elif args.smoketest:
# run default smoketest suite
if args.match:
# Remove tests that we don't want to run
@@ -670,7 +672,7 @@ try:
raise Exception("Smoketest-failed, please look into debug output")
# else, run configtest suite
- else:
+ elif args.configtest:
log.info('Adding a legacy WireGuard default keypair for migrations')
c.sendline('sudo mkdir -p /config/auth/wireguard/default')
c.expect(op_mode_prompt)
@@ -695,7 +697,7 @@ try:
if i==0:
raise Exception('Invalid command detected')
elif i==1:
- tmp = '(W)hy (T)he (F)ace? VyOS smoketest not found!'
+ tmp = 'VyOS smoketest not found!'
log.error(tmp)
raise Exception(tmp)
@@ -709,6 +711,9 @@ try:
log.error(tmp)
raise Exception(tmp)
+ else:
+ log.info('No testcase selected!')
+
shutdownVM(c, log, 'Powering off system')
c.close()
@@ -752,3 +757,5 @@ if EXCEPTION:
log.error('Hmm... system got an exception while processing.')
log.error('The ISO image is not considered usable!')
sys.exit(1)
+
+sys.exit(0)