]> xenbits.xensource.com Git - libvirt.git/commitdiff
virshtest: Add test case for script friendly options
authorPeter Krempa <pkrempa@redhat.com>
Thu, 5 Sep 2024 12:33:30 +0000 (14:33 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 5 Sep 2024 13:24:55 +0000 (15:24 +0200)
Add a bunch of tests verifying that script-friendly options of certain
commands are not changed incompatibly thus potentially breaking user
scripts.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
tests/virshtest.c
tests/virshtestdata/script-friendly-options.in [new file with mode: 0644]
tests/virshtestdata/script-friendly-options.out [new file with mode: 0644]

index b86c39285aa5ba9f86c102e58a8561554cb84778..a7f62df563ec41a87ee9166d24b043d9b5cecc40 100644 (file)
@@ -352,6 +352,8 @@ mymain(void)
                  "checkpoint-create test --redefine checkpoint-c2.xml ;"
                  "checkpoint-info test c2");
 
+    DO_TEST_SCRIPT("script-friendly-options", NULL, VIRSH_CUSTOM);
+
     /* completion doesn't work on non-readline builds */
     need_readline = true;
 
diff --git a/tests/virshtestdata/script-friendly-options.in b/tests/virshtestdata/script-friendly-options.in
new file mode 100644 (file)
index 0000000..08d2a87
--- /dev/null
@@ -0,0 +1,11 @@
+echo "Following script-friendly outputs of commands must not change"
+list --uuid;
+list --uuid --all;
+list --name;
+list --name --all;
+list --uuid --name --all;
+domstate fv0
+domstate fv0 --reason
+domname ef861801-45b9-11cb-88e3-afbfe5370493
+domid fv0
+domstats fv0
diff --git a/tests/virshtestdata/script-friendly-options.out b/tests/virshtestdata/script-friendly-options.out
new file mode 100644 (file)
index 0000000..2ab1ba0
--- /dev/null
@@ -0,0 +1,33 @@
+Following script-friendly outputs of commands must not change
+4dea22b3-1d52-d8f3-2516-782e98ab3fa0
+ef861801-45b9-11cb-88e3-afbfe5370493
+08721f99-3d1d-4aec-96eb-97803297bb36
+
+4dea22b3-1d52-d8f3-2516-782e98ab3fa0
+ef861801-45b9-11cb-88e3-afbfe5370493
+08721f99-3d1d-4aec-96eb-97803297bb36
+
+fv0
+fc4
+fc5
+
+fv0
+fc4
+fc5
+
+4dea22b3-1d52-d8f3-2516-782e98ab3fa0 fv0
+ef861801-45b9-11cb-88e3-afbfe5370493 fc4
+08721f99-3d1d-4aec-96eb-97803297bb36 fc5
+
+running
+
+running (unknown)
+
+fc4
+
+1
+
+Domain: 'fv0'
+  state.state=1
+  state.reason=0
+