libvirt/tests/virsh-output-commands
Peter Krempa ed46c9921f tests: virsh: Add simple testsuite for using --print-xml of various commands
The test uses a script and compares the output against a template file.
VIR_TEST_REGENREATE_OUTPUT can be used on test failures. This test will
be marked as expensive once the refactors it guards are done.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-11-23 14:44:39 +01:00

81 lines
4.6 KiB
Bash
Executable File

#!/bin/bash
attach_disk()
{
./virsh attach-disk --print-xml --domain testdom $@ --source /nonexistent/file
}
set -x
./virsh attach-disk
./virsh attach-disk --print-xml --domain testdom $@ --source ""
./virsh attach-disk --print-xml --domain testdom $@ --source "" --sourcetype file
./virsh attach-disk --print-xml --domain testdom $@ --source "" --sourcetype blah
attach_disk --target hda
attach_disk --target hda --sourcetype file
attach_disk --target hda --sourcetype block
attach_disk --target hda --sourcetype nothing
attach_disk --target hda --sourcetype file --type disk
attach_disk --target hda --sourcetype block --type disk
attach_disk --target hda --sourcetype file --type cdrom
attach_disk --target hda --sourcetype block --type cdrom
attach_disk --target hda --sourcetype file --type blah
attach_disk --target hda --sourcetype block --type blah
attach_disk --target hda --sourcetype file --type disk --driver testdriver
attach_disk --target hda --sourcetype file --type disk --subdriver qcow2
attach_disk --target hda --sourcetype file --type disk --subdriver raw
attach_disk --target hda --sourcetype file --type disk --cache none
attach_disk --target hda --sourcetype file --type disk --subdriver qcow2 --cache none
attach_disk --target hda --sourcetype file --type disk --subdriver qcow2 --serial TEST_SERIAL
attach_disk --target hda --sourcetype file --type disk --mode readonly
attach_disk --target hda --sourcetype file --type disk --mode shareable
attach_disk --target hda --sourcetype file --type disk --mode whatever
attach_disk --target hda --sourcetype file --type disk --subdriver qcow2 --alias testalias
attach_disk --target hda --sourcetype file --type disk --rawio
attach_disk --target hda --sourcetype file --type disk --multifunction
attach_disk --target hda --sourcetype file --type disk --subdriver qcow2 --alias testalias --iothread 3 --mode readonly --cache none --driver qemu
attach_disk --target hda --sourcetype file --type disk --address ide:1.2.3
attach_disk --target hda --sourcetype file --type disk --address ide:1.2.4
attach_disk --target hda --sourcetype file --type disk --address ide:1:2:5
attach_disk --target sda --sourcetype file --type disk --address ide:1.2.3
attach_disk --target vda --sourcetype file --type disk --address ide:1.2.3
attach_disk --target sda --sourcetype file --type disk --address usb:12.34
attach_disk --target sda --sourcetype file --type disk --address usb:12.3
attach_disk --target sda --sourcetype file --type disk --address usb:12:34
attach_disk --target vda --sourcetype file --type disk --address usb:12.34
attach_disk --target hda --sourcetype file --type disk --address usb:12.34
attach_disk --target sda --sourcetype file --type disk --address scsi:1.2.3
attach_disk --target sda --sourcetype file --type disk --address scsi:1.2.4
attach_disk --target sda --sourcetype file --type disk --address scsi:1:2:5
attach_disk --target hda --sourcetype file --type disk --address scsi:1.2.3
attach_disk --target vda --sourcetype file --type disk --address scsi:1.2.3
attach_disk --target sda --sourcetype file --type disk --address sata:1.2.3
attach_disk --target sda --sourcetype file --type disk --address sata:1.2.4
attach_disk --target sda --sourcetype file --type disk --address sata:1:2:5
attach_disk --target hda --sourcetype file --type disk --address sata:1.2.3
attach_disk --target vda --sourcetype file --type disk --address sata:1.2.3
attach_disk --target vda --sourcetype file --type disk --address pci:12.34.56.78
attach_disk --target vda --sourcetype file --type disk --address pci:12:34:56:78
attach_disk --target vda --sourcetype file --type disk --address pci:12.34.56.aa
attach_disk --target hda --sourcetype file --type disk --address pci:12.34.56.aa
attach_disk --target sda --sourcetype file --type disk --address pci:12.34.56.aa
attach_disk --target vda --sourcetype file --type disk --address pci:12.34.56.78 --multifunction
attach_disk --target vda --sourcetype file --type disk --address pci:12:34:56:78 --multifunction
attach_disk --target vda --sourcetype file --type disk --address pci:12.34.56.aa --multifunction
attach_disk --target vda --sourcetype file --type disk --address ccw:12.34.56
attach_disk --target vda --sourcetype file --type disk --address ccw:12:34:56
attach_disk --target vda --sourcetype file --type disk --address ccw:12.34.56
attach_disk --target hda --sourcetype file --type disk --address ccw:12.34.56
attach_disk --target sda --sourcetype file --type disk --address ccw:12.34.56
attach_disk --target vda --sourcetype file --type disk --address test:12.34.56
attach_disk --target vda --sourcetype file --type disk --address test:12:34:56
attach_disk --target vda --sourcetype file --type disk --address test:12.34.56