tests: Fix libxlxml2domconfigtest with latest xen

shadow_memkb is populated from a libxl API call, and the value can
change. For example:
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=2c992810854a15b41be920519ce83a4a328d5168

Mock libxl_get_required_shadow_memory to give consistent output

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2022-10-27 08:51:25 -04:00
parent de842f37a1
commit 72d4709ab9
15 changed files with 25 additions and 14 deletions

View File

@ -109,6 +109,17 @@ VIR_MOCK_STUB_RET_ARGS(bind,
const struct sockaddr *, addr,
socklen_t, addrlen)
VIR_MOCK_IMPL_RET_ARGS(libxl_get_required_shadow_memory,
unsigned long,
unsigned long, maxmem_kb,
unsigned int, smp_cpus)
{
/* silence gcc warning about unused function */
if (0)
real_libxl_get_required_shadow_memory(maxmem_kb, smp_cpus);
return 1234;
}
VIR_MOCK_IMPL_RET_ARGS(__xstat, int,
int, ver,
const char *, path,

View File

@ -15,7 +15,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 12288,
"shadow_memkb": 1234,
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {

View File

@ -14,7 +14,7 @@
],
"max_memkb": 524288,
"target_memkb": 524288,
"shadow_memkb": 8192,
"shadow_memkb": 1234,
"sched_params": {
},

View File

@ -14,7 +14,7 @@
],
"max_memkb": 524288,
"target_memkb": 524288,
"shadow_memkb": 8192,
"shadow_memkb": 1234,
"sched_params": {
},

View File

@ -15,7 +15,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 12288,
"shadow_memkb": 1234,
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {

View File

@ -11,7 +11,7 @@
],
"max_memkb": 592896,
"target_memkb": 403456,
"shadow_memkb": 5656,
"shadow_memkb": 1234,
"sched_params": {
},
"apic": "True",

View File

@ -11,7 +11,7 @@
],
"max_memkb": 592896,
"target_memkb": 403456,
"shadow_memkb": 5656,
"shadow_memkb": 1234,
"cpuid": [
{
"leaf": 1,

View File

@ -11,7 +11,7 @@
],
"max_memkb": 592896,
"target_memkb": 403456,
"shadow_memkb": 5656,
"shadow_memkb": 1234,
"cpuid": [
{
"leaf": 1,

View File

@ -15,7 +15,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 12288,
"shadow_memkb": 1234,
"event_channels": 2047,
"device_model_version": "qemu_xen",
"device_model": "/bin/true",

View File

@ -15,7 +15,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 12288,
"shadow_memkb": 1234,
"max_grant_frames": 64,
"device_model_version": "qemu_xen",
"device_model": "/bin/true",

View File

@ -17,7 +17,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 12288,
"shadow_memkb": 1234,
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {

View File

@ -14,7 +14,7 @@
],
"max_memkb": 524288,
"target_memkb": 524288,
"shadow_memkb": 8192,
"shadow_memkb": 1234,
"sched_params": {
},

View File

@ -15,7 +15,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 12288,
"shadow_memkb": 1234,
"rtc_timeoffset": 3600,
"localtime": "True",
"device_model_version": "qemu_xen",

View File

@ -103,7 +103,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 14336,
"shadow_memkb": 1234,
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {

View File

@ -103,7 +103,7 @@
"max_memkb": 1048576,
"target_memkb": 1048576,
"video_memkb": 8192,
"shadow_memkb": 14336,
"shadow_memkb": 1234,
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {