[libvirt] [PATCH v2 2/2] tests: Adding test case for 'domrename' command inside virshtest.

Peter Krempa pkrempa at redhat.com
Mon Jan 8 09:39:53 UTC 2018


On Mon, Jan 08, 2018 at 01:03:00 -0200, Julio Faracco wrote:
> This commit adds a domrename test case inside the 'virshtest' test for
> test driver.
> 
> Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
> ---
>  tests/virshtest.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/tests/virshtest.c b/tests/virshtest.c
> index 67453bd..f1cd5df 100644
> --- a/tests/virshtest.c
> +++ b/tests/virshtest.c
> @@ -40,6 +40,7 @@ static const char *domuuid_fc4 = DOM_UUID "\n\n";
>  static const char *domid_fc4 = "2\n\n";
>  static const char *domname_fc4 = "fc4\n\n";
>  static const char *domstate_fc4 = "running\n\n";
> +static const char *domrename_fc4 = "Domain successfully renamed\n\n";
>  
>  static int testFilterLine(char *buffer,
>                            const char *toRemove)
> @@ -237,6 +238,14 @@ static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED)
>    return testCompareOutputLit(exp, NULL, argv);
>  }
>  
> +static int testCompareDomrenameByName(const void *data ATTRIBUTE_UNUSED)
> +{
> +  const char *const argv[] = { VIRSH_CUSTOM, "domrename", "fc4",
> +                                                          "fc4new", NULL };
> +  const char *exp = domrename_fc4;
> +  return testCompareOutputLit(exp, NULL, argv);

This is not checking that the VM was actually renamed, only that the
success message was reported, which is pretty useless.
-------------- 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/20180108/77459688/attachment-0001.sig>


More information about the libvir-list mailing list