Signed-off-by: Yu Mingfei <[email protected]>
---
 tests/cfg/virsh_schedinfo_qemu_posix.cfg | 77 ++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 tests/cfg/virsh_schedinfo_qemu_posix.cfg

diff --git a/tests/cfg/virsh_schedinfo_qemu_posix.cfg 
b/tests/cfg/virsh_schedinfo_qemu_posix.cfg
new file mode 100644
index 0000000..4abc983
--- /dev/null
+++ b/tests/cfg/virsh_schedinfo_qemu_posix.cfg
@@ -0,0 +1,77 @@
+- virsh_schedinfo_qemu_posix:
+    type = virsh_schedinfo_qemu_posix
+    schedinfo_options = ""
+    schedinfo_options_suffix = ""
+    start_vm = yes
+    variants:
+        - normal_test:
+            status_error = no
+            variants:
+                - valid_domname:
+                    schedinfo_vm_ref = domname
+                - valid_domid:
+                    schedinfo_vm_ref = domid
+                - valid_domuuid:
+                    schedinfo_vm_ref = domuuid
+            variants:
+                # Do not set, just show the parameters
+                - show_schedinfo:
+                # The cpu_shares parameter has a valid value range of 0-262144.
+                # Negative values are wrapped to positive,
+                # and larger values are capped at the maximum.
+                # Therefore -1 is a useful shorthand for 262144.
+                # On the Linux kernel, the values 0 and 1 are automatically
+                # converted to a minimal value of 2.
+                - set_cpu_shares:
+                    schedinfo_set_ref = cpu_shares
+                    # The filename in cgroup for cpu_shares
+                    schedinfo_cgroup_ref = cpu.shares
+                    variants:
+                        - value_negative:
+                            schedinfo_set_value = -1
+                            schedinfo_set_value_expected = 262144
+                        - value_zero:
+                            schedinfo_set_value = 0
+                            schedinfo_set_value_expected = 2
+                        - value_normal:
+                            schedinfo_set_value = 512
+                            schedinfo_set_value_expected = 512
+                        - value_maximum:
+                            schedinfo_set_value = 262144
+                            schedinfo_set_value_expected = 262144
+                        - value_exceed:
+                            schedinfo_set_value = 262145
+                            schedinfo_set_value_expected = 262144
+                # TODO: to support more parameters
+        - error_test:
+            status_error = yes
+            variants:
+                - invalid_options:
+                    variants:
+                        - invalid_domid:
+                            schedinfo_vm_ref = 9999
+                        - invalid_domuuid:
+                            schedinfo_vm_ref = 
99999999-9999-9999-9999-999999999999
+                        - none:
+                            schedinfo_vm_ref = ""
+                        - hex_domid:
+                            schedinfo_vm_ref = hex_id
+                - additional_args:
+                    schedinfo_options_suffix = xyz
+                - set_cpu_shares:
+                    schedinfo_set_ref = cpu_shares
+                    schedinfo_cgroup_ref = cpu.shares
+                    variants:
+                        - value_none:
+                            schedinfo_set_value = ""
+                        - value_invalid:
+                            schedinfo_set_value = xyz
+                - set_xyz:
+                    schedinfo_set_ref = xyz
+                    variants:
+                        - value_valid:
+                            schedinfo_set_value = 1
+                        - value_invalid:
+                            schedinfo_set_value = xyz
+                - set_none:
+                    schedinfo_set_ref = none
-- 
1.7.11.7

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to