[PATCH 0/3] tests: qemuxml2argv negative tests for hugepages and numatune

Han Han (3): tests: negative test for hugepages with anonymous memory backing tests: negative test for hugepages with ondemand mode tests: negative test of binding memnode cellid to an nonexist guest cell .../qemuxml2argvdata/hugepages-anonymous.err | 1 + .../qemuxml2argvdata/hugepages-anonymous.xml | 25 +++++++++++++++ tests/qemuxml2argvdata/hugepages-ondemand.err | 1 + tests/qemuxml2argvdata/hugepages-ondemand.xml | 25 +++++++++++++++ ...une-memnode-cellid-nonexist-guest-cell.err | 1 + ...une-memnode-cellid-nonexist-guest-cell.xml | 31 +++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 7 files changed, 87 insertions(+) create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.err create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.xml create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.err create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.xml create mode 100644 tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.err create mode 100644 tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.xml -- 2.30.2

Signed-off-by: Han Han <hhan@redhat.com> --- .../qemuxml2argvdata/hugepages-anonymous.err | 1 + .../qemuxml2argvdata/hugepages-anonymous.xml | 25 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 27 insertions(+) create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.err create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.xml diff --git a/tests/qemuxml2argvdata/hugepages-anonymous.err b/tests/qemuxml2argvdata/hugepages-anonymous.err new file mode 100644 index 0000000000..f4ebbf1d1d --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-anonymous.err @@ -0,0 +1 @@ +unsupported configuration: hugepages are not allowed with anonymous memory source diff --git a/tests/qemuxml2argvdata/hugepages-anonymous.xml b/tests/qemuxml2argvdata/hugepages-anonymous.xml new file mode 100644 index 0000000000..e7ed1f1c51 --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-anonymous.xml @@ -0,0 +1,25 @@ +<domain type='qemu'> + <name>QEMUGuest</name> + <uuid>9f4b6512-e73a-4a25-93e8-5307802821ce</uuid> + <memory unit='KiB'>24682468</memory> + <currentMemory unit='KiB'>24682468</currentMemory> + <memoryBacking> + <hugepages/> + <source type="anonymous"/> + </memoryBacking> + <vcpu placement='static'>32</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 12c2b68fd7..6cf1044173 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1268,6 +1268,7 @@ mymain(void) QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST_PARSE_ERROR("hugepages-memaccess-invalid", NONE); + DO_TEST_PARSE_ERROR("hugepages-anonymous", NONE); DO_TEST("hugepages-memaccess", QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA); -- 2.30.2

Signed-off-by: Han Han <hhan@redhat.com> --- tests/qemuxml2argvdata/hugepages-ondemand.err | 1 + tests/qemuxml2argvdata/hugepages-ondemand.xml | 25 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 27 insertions(+) create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.err create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.xml diff --git a/tests/qemuxml2argvdata/hugepages-ondemand.err b/tests/qemuxml2argvdata/hugepages-ondemand.err new file mode 100644 index 0000000000..9f27a76b68 --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-ondemand.err @@ -0,0 +1 @@ +unsupported configuration: hugepages are not allowed with memory allocation ondemand diff --git a/tests/qemuxml2argvdata/hugepages-ondemand.xml b/tests/qemuxml2argvdata/hugepages-ondemand.xml new file mode 100644 index 0000000000..58920d0150 --- /dev/null +++ b/tests/qemuxml2argvdata/hugepages-ondemand.xml @@ -0,0 +1,25 @@ +<domain type='qemu'> + <name>QEMUGuest</name> + <uuid>9f4b6512-e73a-4a25-93e8-5307802821ce</uuid> + <memory unit='KiB'>24682468</memory> + <currentMemory unit='KiB'>24682468</currentMemory> + <memoryBacking> + <hugepages/> + <allocation mode="ondemand"/> + </memoryBacking> + <vcpu placement='static'>32</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6cf1044173..ea38238823 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1269,6 +1269,7 @@ mymain(void) QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST_PARSE_ERROR("hugepages-memaccess-invalid", NONE); DO_TEST_PARSE_ERROR("hugepages-anonymous", NONE); + DO_TEST_PARSE_ERROR("hugepages-ondemand", NONE); DO_TEST("hugepages-memaccess", QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA); -- 2.30.2

Signed-off-by: Han Han <hhan@redhat.com> --- ...une-memnode-cellid-nonexist-guest-cell.err | 1 + ...une-memnode-cellid-nonexist-guest-cell.xml | 31 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 33 insertions(+) create mode 100644 tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.err create mode 100644 tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.xml diff --git a/tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.err b/tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.err new file mode 100644 index 0000000000..b830c6a28c --- /dev/null +++ b/tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.err @@ -0,0 +1 @@ +XML error: Argument 'cellid' in memnode element must correspond to existing guest's NUMA cell diff --git a/tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.xml b/tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.xml new file mode 100644 index 0000000000..710628cfb0 --- /dev/null +++ b/tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>QEMUGuest</name> + <uuid>9f4b6512-e73a-4a25-93e8-5307802821ce</uuid> + <memory unit='KiB'>24682468</memory> + <currentMemory unit='KiB'>24682468</currentMemory> + <vcpu placement='static'>32</vcpu> + <numatune> + <memory mode='strict' nodeset='0-1'/> + <memnode cellid='1' mode='preferred' nodeset='0'/> + </numatune> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + <numa> + <cell id='0' cpus='0-4' memory='512000' unit='KiB'/> + </numa> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <controller type='usb' index='0'/> + <controller type='pci' index='0' model='pci-root'/> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ea38238823..31c8894ffc 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2158,6 +2158,7 @@ mymain(void) QEMU_CAPS_OBJECT_MEMORY_RAM); DO_TEST_PARSE_ERROR("numatune-memnode-nocpu", NONE); DO_TEST_PARSE_ERROR("numatune-memnodes-problematic", NONE); + DO_TEST_PARSE_ERROR("numatune-memnode-cellid-nonexist-guest-cell", NONE); DO_TEST("numad", NONE); DO_TEST("numad-auto-vcpu-static-numatune", NONE); DO_TEST_PARSE_ERROR("numad-auto-vcpu-static-numatune-no-nodeset", NONE); -- 2.30.2

On 3/30/21 8:36 AM, Han Han wrote:
Han Han (3): tests: negative test for hugepages with anonymous memory backing tests: negative test for hugepages with ondemand mode tests: negative test of binding memnode cellid to an nonexist guest cell
.../qemuxml2argvdata/hugepages-anonymous.err | 1 + .../qemuxml2argvdata/hugepages-anonymous.xml | 25 +++++++++++++++ tests/qemuxml2argvdata/hugepages-ondemand.err | 1 + tests/qemuxml2argvdata/hugepages-ondemand.xml | 25 +++++++++++++++ ...une-memnode-cellid-nonexist-guest-cell.err | 1 + ...une-memnode-cellid-nonexist-guest-cell.xml | 31 +++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 7 files changed, 87 insertions(+) create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.err create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.xml create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.err create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.xml create mode 100644 tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.err create mode 100644 tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.xml
Han, what's the story behind these? I'm not particularly fan of testing that something does not work. Did we have regression in this area lately? Michal

On Mon, Apr 19, 2021 at 8:56 PM Michal Privoznik <mprivozn@redhat.com> wrote:
On 3/30/21 8:36 AM, Han Han wrote:
Han Han (3): tests: negative test for hugepages with anonymous memory backing tests: negative test for hugepages with ondemand mode tests: negative test of binding memnode cellid to an nonexist guest cell
.../qemuxml2argvdata/hugepages-anonymous.err | 1 + .../qemuxml2argvdata/hugepages-anonymous.xml | 25 +++++++++++++++ tests/qemuxml2argvdata/hugepages-ondemand.err | 1 + tests/qemuxml2argvdata/hugepages-ondemand.xml | 25 +++++++++++++++ ...une-memnode-cellid-nonexist-guest-cell.err | 1 + ...une-memnode-cellid-nonexist-guest-cell.xml | 31 +++++++++++++++++++ tests/qemuxml2argvtest.c | 3 ++ 7 files changed, 87 insertions(+) create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.err create mode 100644 tests/qemuxml2argvdata/hugepages-anonymous.xml create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.err create mode 100644 tests/qemuxml2argvdata/hugepages-ondemand.xml create mode 100644
tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-cellid-nonexist-guest-cell.xml
Han,
what's the story behind these? I'm not particularly fan of testing that something does not work. Did we have regression in this area lately?
No regression lately. I only intended to cover some negative cases in unit tests.
Michal
participants (2)
-
Han Han
-
Michal Privoznik