[PATCH v2 3/3] tests: Test BlkioParameters related functions for test driver

Martin Kletzander mkletzan at redhat.com
Thu Aug 19 11:27:12 UTC 2021


On Thu, Aug 19, 2021 at 06:04:31PM +0800, Luke Yue wrote:
>Signed-off-by: Luke Yue <lukedyue at gmail.com>
>---
> examples/xml/test/testdomfv0.xml     | 11 ++++++
> examples/xml/test/testnodeinline.xml | 11 ++++++
> tests/virshtest.c                    | 55 ++++++++++++++++++++++++++++
> 3 files changed, 77 insertions(+)
>
>diff --git a/tests/virshtest.c b/tests/virshtest.c
>index 751e8ffc49..87da1f5889 100644
>--- a/tests/virshtest.c
>+++ b/tests/virshtest.c
>@@ -30,6 +30,8 @@ main(void)
>                 tainted: custom device tree blob used\n\
>                 tainted: use of deprecated configuration settings\n\
>                 deprecated configuration: CPU model Deprecated-Test"
>+# define GET_BLKIO_PARAMETER "/dev/hda,700"
>+# define SET_BLKIO_PARAMETER "/dev/hda,1000"
>
> static const char *dominfo_fc4 = "\
> Id:             2\n\
>@@ -70,6 +72,25 @@ Security label: " SECURITY_LABEL "\n\
> Messages:       " FC5_MESSAGES "\n\
> \n";
>
>+static const char *get_blkio_parameters = "\
>+weight         : 800\n\
>+device_weight  : " GET_BLKIO_PARAMETER "\n\
>+device_read_iops_sec: " GET_BLKIO_PARAMETER "\n\
>+device_write_iops_sec: " GET_BLKIO_PARAMETER "\n\
>+device_read_bytes_sec: " GET_BLKIO_PARAMETER "\n\
>+device_write_bytes_sec: " GET_BLKIO_PARAMETER "\n\
>+\n";
>+
>+static const char *set_blkio_parameters = "\
>+\n\
>+weight         : 500\n\
>+device_weight  : " SET_BLKIO_PARAMETER "\n\
>+device_read_iops_sec: " SET_BLKIO_PARAMETER "\n\
>+device_write_iops_sec: " SET_BLKIO_PARAMETER "\n\
>+device_read_bytes_sec: " SET_BLKIO_PARAMETER "\n\
>+device_write_bytes_sec: " SET_BLKIO_PARAMETER "\n\
>+\n";
>+

It could be a bit more thorough to set and test different values, but
that can be done later, this is still a great improvement, thanks.

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210819/3f411710/attachment-0001.sig>


More information about the libvir-list mailing list