mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
Testsuite: extend QEMU interactions
* Change the way how networking is setup to ensure that the network interface inside the QEMU gues is actually u/U instead of u/D * Use common base MAC address * Run "show interfaces" after installation to check all requirements are met
This commit is contained in:
parent
c268b221d8
commit
f04127aedb
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# Copyright (C) 2019, VyOS maintainers and contributors
|
# Copyright (C) 2019-2021, VyOS maintainers and contributors
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License version 2 or later as
|
# it under the terms of the GNU General Public License version 2 or later as
|
||||||
@ -123,19 +123,17 @@ def get_qemu_cmd(name, enable_kvm, disk_img, iso_img=None):
|
|||||||
# test using half of the available CPUs on the system
|
# test using half of the available CPUs on the system
|
||||||
cpucount = get_half_cpus()
|
cpucount = get_half_cpus()
|
||||||
|
|
||||||
|
macbase = '52:54:00:00:00'
|
||||||
cmd = f'qemu-system-x86_64 \
|
cmd = f'qemu-system-x86_64 \
|
||||||
-name "{name}" \
|
-name "{name}" \
|
||||||
-smp {cpucount} \
|
-smp {cpucount} \
|
||||||
-m 2G \
|
-m 2G \
|
||||||
-nic user,model=virtio,mac=52:54:99:12:34:56 \
|
-netdev user,id=n1 -device virtio-net-pci,netdev=n1,mac={macbase}:01 \
|
||||||
-nic user,model=virtio,mac=52:54:99:12:34:57 \
|
-netdev user,id=n2 -device virtio-net-pci,netdev=n2,mac={macbase}:02 \
|
||||||
-nic user,model=virtio,mac=52:54:99:12:34:58 \
|
-netdev user,id=n3 -device virtio-net-pci,netdev=n3,mac={macbase}:03 \
|
||||||
-nic user,model=virtio,mac=52:54:99:12:34:59 \
|
-netdev user,id=n4 -device virtio-net-pci,netdev=n4,mac={macbase}:04 \
|
||||||
-machine accel=kvm \
|
-machine accel=kvm \
|
||||||
-nographic \
|
-nographic {cpu} {cdrom} {kvm} \
|
||||||
{cpu} \
|
|
||||||
{cdrom} \
|
|
||||||
{kvm} \
|
|
||||||
-drive format=raw,file={disk_img}'
|
-drive format=raw,file={disk_img}'
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
@ -315,9 +313,12 @@ try:
|
|||||||
log.info('Basic CLI configuration mode test')
|
log.info('Basic CLI configuration mode test')
|
||||||
c.sendline('configure')
|
c.sendline('configure')
|
||||||
c.expect(r'vyos@vyos#')
|
c.expect(r'vyos@vyos#')
|
||||||
c.sendline('run show version')
|
|
||||||
c.sendline('exit')
|
c.sendline('exit')
|
||||||
c.expect(r'vyos@vyos:~\$')
|
c.expect(r'vyos@vyos:~\$')
|
||||||
|
c.sendline('show version')
|
||||||
|
c.expect(r'vyos@vyos:~\$')
|
||||||
|
c.sendline('show interfaces')
|
||||||
|
c.expect(r'vyos@vyos:~\$')
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# Executing test-suite
|
# Executing test-suite
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user