From 076a2b409667dd9f716a2a2085e1ffea9d58fe8b Mon Sep 17 00:00:00 2001 From: Jim Fehlig Date: Wed, 23 May 2018 15:09:45 -0600 Subject: [PATCH] tests: xmconfigtest: add tests for cmdline formating Commit 656151bf fixed formatting of the element. Perhaps it would have been noticed and fixed earlier if we had a test. With this change, all possible cases of formatting from xmconfig are covered 1. no 'extra=' or 'root=' in xm.cfg 2. 'extra=' but no 'root=' in xm.cfg 3. 'root=' but no 'extra=' in xm.cfg 4. both 'root=' and 'extra=' in xm.cfg Case 1 is covered by all existing paravirt tests since they have no 'extra=' or 'root='. Case 2 is covered by adding 'extra=' to a few of the existing paravirt tests. Cases 3 and 4 are covered by new tests that only test conversion of xm.cfg to xml. Signed-off-by: Jim Fehlig Reviewed-by: John Ferlan --- .../xmconfigdata/test-paravirt-extra-root.cfg | 13 +++++++ .../xmconfigdata/test-paravirt-extra-root.xml | 34 +++++++++++++++++++ tests/xmconfigdata/test-paravirt-maxvcpus.cfg | 1 + tests/xmconfigdata/test-paravirt-maxvcpus.xml | 1 + tests/xmconfigdata/test-paravirt-root.cfg | 12 +++++++ tests/xmconfigdata/test-paravirt-root.xml | 34 +++++++++++++++++++ tests/xmconfigdata/test-paravirt-vcpu.cfg | 1 + tests/xmconfigdata/test-paravirt-vcpu.xml | 1 + tests/xmconfigtest.c | 2 ++ 9 files changed, 99 insertions(+) create mode 100644 tests/xmconfigdata/test-paravirt-extra-root.cfg create mode 100644 tests/xmconfigdata/test-paravirt-extra-root.xml create mode 100644 tests/xmconfigdata/test-paravirt-root.cfg create mode 100644 tests/xmconfigdata/test-paravirt-root.xml diff --git a/tests/xmconfigdata/test-paravirt-extra-root.cfg b/tests/xmconfigdata/test-paravirt-extra-root.cfg new file mode 100644 index 0000000000..2569f2f22c --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-extra-root.cfg @@ -0,0 +1,13 @@ +name = "XenGuest1" +uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809" +memory = 512 +vcpus = 2 +localtime = 0 +on_poweroff = "destroy" +on_reboot = "restart" +on_crash = "restart" +vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ] +bootloader = "/usr/bin/pygrub" +root = "/dev/xvda2" +extra = "console=hvc0" +disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ] diff --git a/tests/xmconfigdata/test-paravirt-extra-root.xml b/tests/xmconfigdata/test-paravirt-extra-root.xml new file mode 100644 index 0000000000..325b07d8e1 --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-extra-root.xml @@ -0,0 +1,34 @@ + + XenGuest1 + c7a5fdb0-cdaf-9455-926a-d65c16db1809 + 524288 + 524288 + 2 + /usr/bin/pygrub + + linux + root=/dev/xvda2 console=hvc0 + + + destroy + restart + restart + + + + + + + + + +