mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
smoketest: Allow selection of smoketests to run
Example: `make test MATCH="interfaces|policy"` will only run interfaces and policy tests
This commit is contained in:
parent
e7c29ed7be
commit
4727dc1756
4
Makefile
4
Makefile
@ -32,12 +32,12 @@ checkiso:
|
|||||||
.PHONY: test
|
.PHONY: test
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
test: checkiso
|
test: checkiso
|
||||||
scripts/check-qemu-install --debug --uefi build/live-image-amd64.hybrid.iso
|
scripts/check-qemu-install --debug --match="$(MATCH)" --uefi build/live-image-amd64.hybrid.iso
|
||||||
|
|
||||||
.PHONY: test-no-interfaces
|
.PHONY: test-no-interfaces
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
test-no-interfaces: checkiso
|
test-no-interfaces: checkiso
|
||||||
scripts/check-qemu-install --debug --no-interfaces build/live-image-amd64.hybrid.iso
|
scripts/check-qemu-install --debug --match="$(MATCH)" --no-interfaces build/live-image-amd64.hybrid.iso
|
||||||
|
|
||||||
.PHONY: testd
|
.PHONY: testd
|
||||||
.ONESHELL:
|
.ONESHELL:
|
||||||
|
|||||||
@ -63,6 +63,7 @@ parser.add_argument('--silent', help='Do not show output on stdout unless an err
|
|||||||
parser.add_argument('--debug', help='Send all debug output to stdout',
|
parser.add_argument('--debug', help='Send all debug output to stdout',
|
||||||
action='store_true', default=False)
|
action='store_true', default=False)
|
||||||
parser.add_argument('--logfile', help='Log to file')
|
parser.add_argument('--logfile', help='Log to file')
|
||||||
|
parser.add_argument('--match', help='Smoketests to run')
|
||||||
parser.add_argument('--uefi', help='Boot using UEFI', action='store_true', default=False)
|
parser.add_argument('--uefi', help='Boot using UEFI', action='store_true', default=False)
|
||||||
parser.add_argument('--raid', help='Perform a RAID-1 install', action='store_true', default=False)
|
parser.add_argument('--raid', help='Perform a RAID-1 install', action='store_true', default=False)
|
||||||
parser.add_argument('--no-kvm', help='Disable use of kvm', action='store_true', default=False)
|
parser.add_argument('--no-kvm', help='Disable use of kvm', action='store_true', default=False)
|
||||||
@ -486,6 +487,11 @@ try:
|
|||||||
|
|
||||||
elif not args.configtest:
|
elif not args.configtest:
|
||||||
# run default smoketest suite
|
# run default smoketest suite
|
||||||
|
if args.match:
|
||||||
|
# Remove tests that we don't want to run
|
||||||
|
match_str = '-o '.join([f'-name "test_*{name}*.py" ' for name in args.match.split("|")]).strip()
|
||||||
|
c.sendline(f'sudo find /usr/libexec/vyos/tests/smoke/cli/test_* -type f ! \( {match_str} \) -delete')
|
||||||
|
c.expect(op_mode_prompt)
|
||||||
if args.no_interfaces:
|
if args.no_interfaces:
|
||||||
# remove interface tests as they consume a lot of time
|
# remove interface tests as they consume a lot of time
|
||||||
c.sendline('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_interfaces_*')
|
c.sendline('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_interfaces_*')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user