mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
Compare commits
8 Commits
3e5696d501
...
f65c69c1a5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f65c69c1a5 | ||
|
|
5e1e6cb028 | ||
|
|
54e2359090 | ||
|
|
f2ac2fbcd6 | ||
|
|
3d0e999c80 | ||
|
|
7807f0d0e8 | ||
|
|
a245f81e06 | ||
|
|
1aceb0371c |
14
Makefile
14
Makefile
@ -28,6 +28,11 @@ test: checkiso
|
||||
test-no-interfaces: checkiso
|
||||
scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --cpu 4 --memory 8 build/live-image-amd64.hybrid.iso
|
||||
|
||||
.PHONY: test-no-interfaces-no-vpp
|
||||
.ONESHELL:
|
||||
test-no-interfaces-no-vpp: checkiso
|
||||
scripts/check-qemu-install --debug --configd --smoketest --uefi --no-interfaces --no-vpp build/live-image-amd64.hybrid.iso
|
||||
|
||||
.PHONY: test-interfaces
|
||||
.ONESHELL:
|
||||
test-interfaces: checkiso
|
||||
@ -36,12 +41,17 @@ test-interfaces: checkiso
|
||||
.PHONY: test-vpp
|
||||
.ONESHELL:
|
||||
test-vpp: checkiso
|
||||
scripts/check-qemu-install --debug --configd --match="vpp" --smoketest --uefi --cpu 4 --memory 8 build/live-image-amd64.hybrid.iso
|
||||
scripts/check-qemu-install --debug --configd --match="vpp" --smoketest --uefi --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 build/live-image-amd64.hybrid.iso
|
||||
|
||||
.PHONY: testc
|
||||
.ONESHELL:
|
||||
testc: checkiso
|
||||
scripts/check-qemu-install --debug --configd --cpu 2 --memory 7 --configtest build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
|
||||
scripts/check-qemu-install --debug --configd --match="!vpp" --cpu 2 --memory 7 --configtest build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
|
||||
|
||||
.PHONY: testcvpp
|
||||
.ONESHELL:
|
||||
testcvpp: checkiso
|
||||
scripts/check-qemu-install --debug --configd --match="vpp" --cpu 4 --memory 8 --huge-page-size 2M --huge-page-count 1800 --configtest build/live-image-amd64.hybrid.iso $(filter-out $@,$(MAKECMDGOALS))
|
||||
|
||||
.PHONY: testraid
|
||||
.ONESHELL:
|
||||
|
||||
10
data/live-build-config/includes.binary/compat
Normal file
10
data/live-build-config/includes.binary/compat
Normal file
@ -0,0 +1,10 @@
|
||||
# VyOS 1.3.x image upgrade scipt checked if an image file was a valid ISO file
|
||||
# by grepping it for "ISO9660".
|
||||
# (The correct way to do that would be to use file/libmagic,
|
||||
# but we cannot change the past).
|
||||
# At some point something has changed in xorriso or some other tool
|
||||
# and images no longer include that string.
|
||||
# so the image validity check fails.
|
||||
# To allow direct upgrades from older versions,
|
||||
# we artificially include that string to make the old check pass.
|
||||
ISO9660
|
||||
@ -99,6 +99,10 @@ parser.add_argument('--cpu', help='Set QEMU CPU', type=int, default=2)
|
||||
parser.add_argument('--memory', help='Set QEMU memory', type=int, default=4)
|
||||
parser.add_argument('--vyconf', help='Execute testsuite with vyconfd', action='store_true',
|
||||
default=False)
|
||||
parser.add_argument('--no-vpp', help='Execute testsuite without VPP tests',
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--huge-page-size', help='Huge page size (e.g., 2M, 1G)', type=str)
|
||||
parser.add_argument('--huge-page-count', help='Number of huge pages to allocate', type=int)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@ -411,6 +415,22 @@ try:
|
||||
exit(1)
|
||||
|
||||
#################################################
|
||||
# Configure boot options if required
|
||||
#################################################
|
||||
if args.huge_page_size and args.huge_page_count:
|
||||
c.sendline('configure')
|
||||
c.expect(cfg_mode_prompt)
|
||||
c.sendline(f'set system option kernel memory hugepage-size {args.huge_page_size} hugepage-count {args.huge_page_count}')
|
||||
c.expect(cfg_mode_prompt)
|
||||
c.sendline('set system option kernel disable-mitigations')
|
||||
c.expect(cfg_mode_prompt)
|
||||
c.sendline('commit')
|
||||
c.expect(cfg_mode_prompt)
|
||||
c.sendline('save')
|
||||
c.expect(cfg_mode_prompt)
|
||||
c.sendline('exit')
|
||||
c.expect(op_mode_prompt)
|
||||
#################################################
|
||||
# Installing into VyOS system
|
||||
#################################################
|
||||
log.info('Starting installer')
|
||||
@ -526,6 +546,14 @@ try:
|
||||
|
||||
loginVM(c, log)
|
||||
|
||||
#################################################
|
||||
# Boot options require a reboot
|
||||
#################################################
|
||||
if args.huge_page_size and args.huge_page_count:
|
||||
log.info('Rebooting to apply kernel boot options')
|
||||
c.sendline('reboot now')
|
||||
loginVM(c, log)
|
||||
|
||||
################################################
|
||||
# Always load the WiFi simulation module
|
||||
################################################
|
||||
@ -570,6 +598,12 @@ try:
|
||||
c.expect(op_mode_prompt)
|
||||
c.sendline('show system memory')
|
||||
c.expect(op_mode_prompt)
|
||||
c.sendline('show system memory detail | no-more')
|
||||
c.expect(op_mode_prompt)
|
||||
c.sendline('show configuration commands | match kernel')
|
||||
c.expect(op_mode_prompt)
|
||||
c.sendline('cat /proc/cmdline')
|
||||
c.expect(op_mode_prompt)
|
||||
c.sendline('show version all | grep -e "vpp" -e "vyos-1x"')
|
||||
c.expect(op_mode_prompt)
|
||||
|
||||
@ -806,6 +840,10 @@ try:
|
||||
# remove interface tests as they consume a lot of time
|
||||
c.sendline('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_interfaces_*')
|
||||
c.expect(op_mode_prompt)
|
||||
if args.no_vpp:
|
||||
# remove VPP tests
|
||||
c.sendline('sudo rm -f /usr/libexec/vyos/tests/smoke/cli/test_vpp*')
|
||||
c.expect(op_mode_prompt)
|
||||
|
||||
if args.vyconf:
|
||||
c.sendline('sudo /usr/libexec/vyos/set_vyconf_backend.py --no-prompt &> /dev/null')
|
||||
@ -837,6 +875,26 @@ try:
|
||||
|
||||
# else, run configtest suite
|
||||
elif args.configtest:
|
||||
# Remove config-tests that we don't want to run
|
||||
if args.match:
|
||||
if args.match.startswith("!"):
|
||||
# Exclude mode — delete only the matched names
|
||||
names = args.match[1:].split("|")
|
||||
match_str = '-o '.join([f'-name "{name}"' for name in names])
|
||||
cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 \\( {match_str} \\) -exec rm -rf {{}} +'
|
||||
cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 \\( {match_str} \\) -exec rm -rf {{}} +'
|
||||
else:
|
||||
# Include mode — keep only the matched names, delete the rest
|
||||
names = args.match.split("|")
|
||||
match_str = '-o '.join([f'-name "{name}"' for name in names])
|
||||
cleanup_config_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config -mindepth 1 -maxdepth 1 ! \\( {match_str} \\) -exec rm -rf {{}} +'
|
||||
cleanup_config_tests_dir_cmd = f'sudo find /usr/libexec/vyos/tests/config-tests -mindepth 1 -maxdepth 1 ! \\( {match_str} \\) -exec rm -rf {{}} +'
|
||||
|
||||
c.sendline(cleanup_config_dir_cmd)
|
||||
c.expect(op_mode_prompt)
|
||||
c.sendline(cleanup_config_tests_dir_cmd)
|
||||
c.expect(op_mode_prompt)
|
||||
|
||||
log.info('Adding a legacy WireGuard default keypair for migrations')
|
||||
c.sendline('sudo mkdir -p /config/auth/wireguard/default')
|
||||
c.expect(op_mode_prompt)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user