From d15b7c3859827435ecf693b3b678a3f140d1ff09 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 9 Sep 2024 16:46:10 +0200 Subject: [PATCH] qemuxmlconfttest: Add test case for invalid disk target Add a test case that the numeric overflow when parsing disk target is detected. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- .../disk-target-overflow.x86_64-latest.err | 1 + .../qemuxmlconfdata/disk-target-overflow.xml | 29 +++++++++++++++++++ tests/qemuxmlconftest.c | 1 + 3 files changed, 31 insertions(+) create mode 100644 tests/qemuxmlconfdata/disk-target-overflow.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/disk-target-overflow.xml diff --git a/tests/qemuxmlconfdata/disk-target-overflow.x86_64-latest.err b/tests/qemuxmlconfdata/disk-target-overflow.x86_64-latest.err new file mode 100644 index 0000000000..cae259fad7 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-target-overflow.x86_64-latest.err @@ -0,0 +1 @@ +XML error: Unknown disk name 'hdaxxxxxxxxxx' and no address specified diff --git a/tests/qemuxmlconfdata/disk-target-overflow.xml b/tests/qemuxmlconfdata/disk-target-overflow.xml new file mode 100644 index 0000000000..8c8a2ab843 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-target-overflow.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 5497fb2ba1..323fd9d721 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1622,6 +1622,7 @@ mymain(void) DO_TEST_CAPS_LATEST("controller-virtio-scsi"); DO_TEST_CAPS_LATEST("controller-scsi-auto"); DO_TEST_CAPS_LATEST("disk-sata-device"); + DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-target-overflow"); DO_TEST_CAPS_LATEST("disk-aio"); DO_TEST_CAPS_LATEST("disk-aio-io_uring"); DO_TEST_CAPS_LATEST("disk-source-pool");