mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
Testsuite: T861: remove option to disable KVM and use soft-emulation
This code path was unused during CI runs.
This commit is contained in:
parent
7f23b57b19
commit
e5627bf050
@ -69,7 +69,6 @@ parser.add_argument('--logfile', help='Log to file')
|
|||||||
parser.add_argument('--match', help='Smoketests to run')
|
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('--configd', help='Execute testsuite with config daemon', action='store_true',
|
parser.add_argument('--configd', help='Execute testsuite with config daemon', action='store_true',
|
||||||
default=False)
|
default=False)
|
||||||
parser.add_argument('--no-interfaces', help='Execute testsuite without interface tests to save time',
|
parser.add_argument('--no-interfaces', help='Execute testsuite without interface tests to save time',
|
||||||
@ -118,13 +117,7 @@ def get_half_cpus():
|
|||||||
cpu /= 2
|
cpu /= 2
|
||||||
return int(cpu)
|
return int(cpu)
|
||||||
|
|
||||||
def get_qemu_cmd(name, enable_kvm, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False):
|
def get_qemu_cmd(name, enable_uefi, disk_img, raid=None, iso_img=None, tpm=False):
|
||||||
kvm = "-enable-kvm"
|
|
||||||
cpu = "-cpu host"
|
|
||||||
if not enable_kvm:
|
|
||||||
kvm = "--no-kvm"
|
|
||||||
cpu = ""
|
|
||||||
|
|
||||||
uefi = ""
|
uefi = ""
|
||||||
uuid = "f48b60b2-e6ad-49ef-9d09-4245d0585e52"
|
uuid = "f48b60b2-e6ad-49ef-9d09-4245d0585e52"
|
||||||
if enable_uefi:
|
if enable_uefi:
|
||||||
@ -157,9 +150,9 @@ def get_qemu_cmd(name, enable_kvm, enable_uefi, disk_img, raid=None, iso_img=Non
|
|||||||
-nographic \
|
-nographic \
|
||||||
-machine accel=kvm \
|
-machine accel=kvm \
|
||||||
-uuid {uuid} \
|
-uuid {uuid} \
|
||||||
{cpu} \
|
-cpu host \
|
||||||
{cdrom} \
|
{cdrom} \
|
||||||
{kvm} \
|
-enable-kvm \
|
||||||
-monitor unix:/tmp/qemu-monitor-socket-{disk_img},server,nowait \
|
-monitor unix:/tmp/qemu-monitor-socket-{disk_img},server,nowait \
|
||||||
-netdev user,id=n0,net=192.0.2.0/24,dhcpstart=192.0.2.101,dns=192.0.2.10 -device virtio-net-pci,netdev=n0,mac={macbase}:00,romfile="" \
|
-netdev user,id=n0,net=192.0.2.0/24,dhcpstart=192.0.2.101,dns=192.0.2.10 -device virtio-net-pci,netdev=n0,mac={macbase}:00,romfile="" \
|
||||||
-netdev user,id=n1 -device virtio-net-pci,netdev=n1,mac={macbase}:01,romfile="" \
|
-netdev user,id=n1 -device virtio-net-pci,netdev=n1,mac={macbase}:01,romfile="" \
|
||||||
@ -252,14 +245,9 @@ if not os.path.isfile(args.iso):
|
|||||||
log.error('Unable to find iso image to install')
|
log.error('Unable to find iso image to install')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if args.no_kvm:
|
if not os.path.exists('/dev/kvm'):
|
||||||
log.error('KVM forced off by command line')
|
|
||||||
kvm=False
|
|
||||||
elif not os.path.exists('/dev/kvm'):
|
|
||||||
log.error('KVM not enabled on host, proceeding with software emulation')
|
log.error('KVM not enabled on host, proceeding with software emulation')
|
||||||
kvm=False
|
sys.exit(1)
|
||||||
else:
|
|
||||||
kvm=True
|
|
||||||
|
|
||||||
# Creating diskimage!!
|
# Creating diskimage!!
|
||||||
diskname_raid = None
|
diskname_raid = None
|
||||||
@ -298,7 +286,7 @@ def start_swtpm():
|
|||||||
return tpm_process
|
return tpm_process
|
||||||
|
|
||||||
if args.qemu_cmd:
|
if args.qemu_cmd:
|
||||||
tmp = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, diskname_raid, args.iso)
|
tmp = get_qemu_cmd('TESTVM', args.uefi, args.disk, diskname_raid, args.iso)
|
||||||
os.system(tmp)
|
os.system(tmp)
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
@ -309,7 +297,7 @@ try:
|
|||||||
# Installing image to disk
|
# Installing image to disk
|
||||||
#################################################
|
#################################################
|
||||||
log.info('Installing system')
|
log.info('Installing system')
|
||||||
cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, diskname_raid, args.iso)
|
cmd = get_qemu_cmd('TESTVM', args.uefi, args.disk, diskname_raid, args.iso)
|
||||||
log.debug(f'Executing command: {cmd}')
|
log.debug(f'Executing command: {cmd}')
|
||||||
c = pexpect.spawn(cmd, logfile=stl, timeout=60)
|
c = pexpect.spawn(cmd, logfile=stl, timeout=60)
|
||||||
|
|
||||||
@ -508,7 +496,7 @@ try:
|
|||||||
|
|
||||||
# Booting back into VM
|
# Booting back into VM
|
||||||
log.info('Booting TPM-backed system')
|
log.info('Booting TPM-backed system')
|
||||||
cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, diskname_raid, tpm=args.tpmtest)
|
cmd = get_qemu_cmd('TESTVM', args.uefi, args.disk, diskname_raid, tpm=args.tpmtest)
|
||||||
log.debug(f'Executing command: {cmd}')
|
log.debug(f'Executing command: {cmd}')
|
||||||
c = pexpect.spawn(cmd, logfile=stl)
|
c = pexpect.spawn(cmd, logfile=stl)
|
||||||
|
|
||||||
@ -543,7 +531,7 @@ try:
|
|||||||
|
|
||||||
# Booting back into VM
|
# Booting back into VM
|
||||||
log.info('Booting system with cleared TPM')
|
log.info('Booting system with cleared TPM')
|
||||||
cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, diskname_raid, tpm=args.tpmtest)
|
cmd = get_qemu_cmd('TESTVM', args.uefi, args.disk, diskname_raid, tpm=args.tpmtest)
|
||||||
log.debug(f'Executing command: {cmd}')
|
log.debug(f'Executing command: {cmd}')
|
||||||
c = pexpect.spawn(cmd, logfile=stl)
|
c = pexpect.spawn(cmd, logfile=stl)
|
||||||
|
|
||||||
@ -595,7 +583,7 @@ try:
|
|||||||
# Booting RAID-1 system with one missing disk
|
# Booting RAID-1 system with one missing disk
|
||||||
#################################################
|
#################################################
|
||||||
log.info('Booting RAID-1 system')
|
log.info('Booting RAID-1 system')
|
||||||
cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, diskname_raid)
|
cmd = get_qemu_cmd('TESTVM', args.uefi, args.disk, diskname_raid)
|
||||||
|
|
||||||
# We need to swap boot indexes to boot from second harddisk so we can
|
# We need to swap boot indexes to boot from second harddisk so we can
|
||||||
# recreate the RAID on the first disk
|
# recreate the RAID on the first disk
|
||||||
@ -645,7 +633,7 @@ try:
|
|||||||
shutdownVM(c, log, f'Shutdown VM and start from recovered RAID member "{args.disk}"')
|
shutdownVM(c, log, f'Shutdown VM and start from recovered RAID member "{args.disk}"')
|
||||||
|
|
||||||
log.info('Booting RAID-1 system')
|
log.info('Booting RAID-1 system')
|
||||||
cmd = get_qemu_cmd('TESTVM', kvm, args.uefi, args.disk, diskname_raid)
|
cmd = get_qemu_cmd('TESTVM', args.uefi, args.disk, diskname_raid)
|
||||||
log.debug(f'Executing command: {cmd}')
|
log.debug(f'Executing command: {cmd}')
|
||||||
c = pexpect.spawn(cmd, logfile=stl)
|
c = pexpect.spawn(cmd, logfile=stl)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user