mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
test: move nodedev xml2xml output to a separate dir
Currently, we're loading and parsing the xml from the input file, and then formatting it and then comparing it directly back to the input file. This works for now, but is severely limiting as it relies on the input file being fully-specified and in the exact order as the output xml format. If optional elements are ommitted in the input XML, the output xml may include default values for the ommitted elements and thus the output will not match the input. In order to allow more flexibility in testing, save the expected output to a seprate 'out' directory similar to what most of the other xml2xml tests are already doing. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
0ad0204ce7
commit
86ecc06c06
1
tests/nodedevxml2xmlout/DVD_GCC_4247N.xml
Symbolic link
1
tests/nodedevxml2xmlout/DVD_GCC_4247N.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/DVD_GCC_4247N.xml
|
1
tests/nodedevxml2xmlout/DVD_with_media.xml
Symbolic link
1
tests/nodedevxml2xmlout/DVD_with_media.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/DVD_with_media.xml
|
1
tests/nodedevxml2xmlout/ap_07_0038.xml
Symbolic link
1
tests/nodedevxml2xmlout/ap_07_0038.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/ap_07_0038.xml
|
1
tests/nodedevxml2xmlout/ap_card07.xml
Symbolic link
1
tests/nodedevxml2xmlout/ap_card07.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/ap_card07.xml
|
1
tests/nodedevxml2xmlout/ap_matrix.xml
Symbolic link
1
tests/nodedevxml2xmlout/ap_matrix.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/ap_matrix.xml
|
1
tests/nodedevxml2xmlout/ap_matrix_mdev_types.xml
Symbolic link
1
tests/nodedevxml2xmlout/ap_matrix_mdev_types.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/ap_matrix_mdev_types.xml
|
1
tests/nodedevxml2xmlout/ccw_0_0_ffff.xml
Symbolic link
1
tests/nodedevxml2xmlout/ccw_0_0_ffff.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/ccw_0_0_ffff.xml
|
1
tests/nodedevxml2xmlout/computer.xml
Symbolic link
1
tests/nodedevxml2xmlout/computer.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/computer.xml
|
1
tests/nodedevxml2xmlout/css_0_0_fffe_mdev_types.xml
Symbolic link
1
tests/nodedevxml2xmlout/css_0_0_fffe_mdev_types.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/css_0_0_fffe_mdev_types.xml
|
1
tests/nodedevxml2xmlout/css_0_0_ffff.xml
Symbolic link
1
tests/nodedevxml2xmlout/css_0_0_ffff.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/css_0_0_ffff.xml
|
1
tests/nodedevxml2xmlout/drm_renderD129.xml
Symbolic link
1
tests/nodedevxml2xmlout/drm_renderD129.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/drm_renderD129.xml
|
@ -0,0 +1 @@
|
||||
../nodedevschemadata/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml
|
@ -0,0 +1 @@
|
||||
../nodedevschemadata/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml
|
1
tests/nodedevxml2xmlout/net_00_13_02_b9_f9_d3.xml
Symbolic link
1
tests/nodedevxml2xmlout/net_00_13_02_b9_f9_d3.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/net_00_13_02_b9_f9_d3.xml
|
1
tests/nodedevxml2xmlout/net_00_15_58_2f_e9_55.xml
Symbolic link
1
tests/nodedevxml2xmlout/net_00_15_58_2f_e9_55.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/net_00_15_58_2f_e9_55.xml
|
1
tests/nodedevxml2xmlout/pci_0000_00_02_0_header_type.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_0000_00_02_0_header_type.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_00_02_0_header_type.xml
|
1
tests/nodedevxml2xmlout/pci_0000_00_1c_0_header_type.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_0000_00_1c_0_header_type.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_00_1c_0_header_type.xml
|
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_mdev_types.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_mdev_types.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_02_10_7_mdev_types.xml
|
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_sriov.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_sriov.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_02_10_7_sriov.xml
|
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_sriov_pf_vfs_all.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_sriov_pf_vfs_all.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all.xml
|
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_02_10_7_sriov_pf_vfs_all_header_type.xml
|
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_sriov_vfs.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_0000_02_10_7_sriov_vfs.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_02_10_7_sriov_vfs.xml
|
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_0000_02_10_7_sriov_zero_vfs_max_count.xml
|
1
tests/nodedevxml2xmlout/pci_1002_71c4.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_1002_71c4.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_1002_71c4.xml
|
1
tests/nodedevxml2xmlout/pci_8086_0c0c_snd_hda_intel.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_8086_0c0c_snd_hda_intel.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_0c0c_snd_hda_intel.xml
|
1
tests/nodedevxml2xmlout/pci_8086_10c9_sriov_pf.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_8086_10c9_sriov_pf.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_10c9_sriov_pf.xml
|
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_27c5_scsi_host.xml
|
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host_0.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host_0.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_27c5_scsi_host_0.xml
|
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host_0_unique_id.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host_0_unique_id.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_27c5_scsi_host_0_unique_id.xml
|
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_27c5_scsi_host_scsi_device_lun0.xml
|
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host_scsi_host.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_8086_27c5_scsi_host_scsi_host.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_27c5_scsi_host_scsi_host.xml
|
1
tests/nodedevxml2xmlout/pci_8086_4238_pcie_wireless.xml
Symbolic link
1
tests/nodedevxml2xmlout/pci_8086_4238_pcie_wireless.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/pci_8086_4238_pcie_wireless.xml
|
1
tests/nodedevxml2xmlout/scsi_target0_0_0.xml
Symbolic link
1
tests/nodedevxml2xmlout/scsi_target0_0_0.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/scsi_target0_0_0.xml
|
1
tests/nodedevxml2xmlout/scsi_target1_0_0.xml
Symbolic link
1
tests/nodedevxml2xmlout/scsi_target1_0_0.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/scsi_target1_0_0.xml
|
@ -0,0 +1 @@
|
||||
../nodedevschemadata/storage_serial_3600c0ff000d7a2a5d463ff4902000000.xml
|
@ -0,0 +1 @@
|
||||
../nodedevschemadata/storage_serial_SATA_HTS721010G9SA00_MPCZ12Y0GNGWSE.xml
|
1
tests/nodedevxml2xmlout/usb_device_1d6b_1_0000_00_1d_0.xml
Symbolic link
1
tests/nodedevxml2xmlout/usb_device_1d6b_1_0000_00_1d_0.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/usb_device_1d6b_1_0000_00_1d_0.xml
|
1
tests/nodedevxml2xmlout/usb_device_1d6b_1_0000_00_1d_0_if0.xml
Symbolic link
1
tests/nodedevxml2xmlout/usb_device_1d6b_1_0000_00_1d_0_if0.xml
Symbolic link
@ -0,0 +1 @@
|
||||
../nodedevschemadata/usb_device_1d6b_1_0000_00_1d_0_if0.xml
|
@ -14,7 +14,7 @@
|
||||
#define VIR_FROM_THIS VIR_FROM_NONE
|
||||
|
||||
static int
|
||||
testCompareXMLToXMLFiles(const char *xml)
|
||||
testCompareXMLToXMLFiles(const char *xml, const char *outfile)
|
||||
{
|
||||
char *xmlData = NULL;
|
||||
char *actual = NULL;
|
||||
@ -52,10 +52,8 @@ testCompareXMLToXMLFiles(const char *xml)
|
||||
if (!(actual = virNodeDeviceDefFormat(dev)))
|
||||
goto fail;
|
||||
|
||||
if (STRNEQ(xmlData, actual)) {
|
||||
virTestDifferenceFull(stderr, xmlData, xml, actual, NULL);
|
||||
if (virTestCompareToFile(actual, outfile) < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
@ -71,11 +69,15 @@ testCompareXMLToXMLHelper(const void *data)
|
||||
{
|
||||
int result = -1;
|
||||
char *xml = NULL;
|
||||
g_autofree char *outfile = NULL;
|
||||
|
||||
xml = g_strdup_printf("%s/nodedevschemadata/%s.xml", abs_srcdir,
|
||||
(const char *)data);
|
||||
|
||||
result = testCompareXMLToXMLFiles(xml);
|
||||
outfile = g_strdup_printf("%s/nodedevxml2xmlout/%s.xml", abs_srcdir,
|
||||
(const char *)data);
|
||||
|
||||
result = testCompareXMLToXMLFiles(xml, outfile);
|
||||
|
||||
VIR_FREE(xml);
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user