[libvirt] [tck PATCH v2 02/13] scripts: strip quotes from URI before checking it

Daniel P. Berrangé posted 13 patches 6 years, 11 months ago
[libvirt] [tck PATCH v2 02/13] scripts: strip quotes from URI before checking it
Posted by Daniel P. Berrangé 6 years, 11 months ago
The config file may have the URI listed with or without quotes, and the
nwfilter tests didn't strip quotes before checking against the
whitelisted URI.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 scripts/networks/networkApplyTest.sh    | 2 +-
 scripts/nwfilter/nwfilter2vmtest.sh     | 2 +-
 scripts/nwfilter/nwfilter_concurrent.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/networks/networkApplyTest.sh b/scripts/networks/networkApplyTest.sh
index da48eef..2a6431e 100644
--- a/scripts/networks/networkApplyTest.sh
+++ b/scripts/networks/networkApplyTest.sh
@@ -12,7 +12,7 @@ uri=$(sed -n '/^uri[     ]*=[     ]*/ {
 $ {
   x
   p
-}' < "$LIBVIRT_TCK_CONFIG")
+}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g')
 : "${uri:=qemu:///system}"
 
 LIBVIRT_URI=${uri}
diff --git a/scripts/nwfilter/nwfilter2vmtest.sh b/scripts/nwfilter/nwfilter2vmtest.sh
index 90a5255..ae28b73 100644
--- a/scripts/nwfilter/nwfilter2vmtest.sh
+++ b/scripts/nwfilter/nwfilter2vmtest.sh
@@ -16,7 +16,7 @@ VIRSH=virsh
 $ {
   x
   p
-}' < "$LIBVIRT_TCK_CONFIG")
+}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g')
 : "${uri:=qemu:///system}"
 
 LIBVIRT_URI=${uri}
diff --git a/scripts/nwfilter/nwfilter_concurrent.sh b/scripts/nwfilter/nwfilter_concurrent.sh
index 4c9b878..c42dd78 100644
--- a/scripts/nwfilter/nwfilter_concurrent.sh
+++ b/scripts/nwfilter/nwfilter_concurrent.sh
@@ -12,7 +12,7 @@ uri=$(sed -n '/^uri[     ]*=[     ]*/ {
 $ {
   x
   p
-}' < "$LIBVIRT_TCK_CONFIG")
+}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g')
 : "${uri:=qemu:///system}"
 
 LIBVIRT_URI=${uri}
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [tck PATCH v2 02/13] scripts: strip quotes from URI before checking it
Posted by Laine Stump 6 years, 11 months ago
On 05/21/2018 12:46 PM, Daniel P. Berrangé wrote:
> The config file may have the URI listed with or without quotes, and the
> nwfilter tests didn't strip quotes before checking against the
> whitelisted URI.

I'm curious what you were doing that you ended up setting this.  Running
tests against qemu:///session?

>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Laine Stump <laine@laine.org>

> ---
>  scripts/networks/networkApplyTest.sh    | 2 +-
>  scripts/nwfilter/nwfilter2vmtest.sh     | 2 +-
>  scripts/nwfilter/nwfilter_concurrent.sh | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/networks/networkApplyTest.sh b/scripts/networks/networkApplyTest.sh
> index da48eef..2a6431e 100644
> --- a/scripts/networks/networkApplyTest.sh
> +++ b/scripts/networks/networkApplyTest.sh
> @@ -12,7 +12,7 @@ uri=$(sed -n '/^uri[     ]*=[     ]*/ {
>  $ {
>    x
>    p
> -}' < "$LIBVIRT_TCK_CONFIG")
> +}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g')
>  : "${uri:=qemu:///system}"
>  
>  LIBVIRT_URI=${uri}
> diff --git a/scripts/nwfilter/nwfilter2vmtest.sh b/scripts/nwfilter/nwfilter2vmtest.sh
> index 90a5255..ae28b73 100644
> --- a/scripts/nwfilter/nwfilter2vmtest.sh
> +++ b/scripts/nwfilter/nwfilter2vmtest.sh
> @@ -16,7 +16,7 @@ VIRSH=virsh
>  $ {
>    x
>    p
> -}' < "$LIBVIRT_TCK_CONFIG")
> +}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g')
>  : "${uri:=qemu:///system}"
>  
>  LIBVIRT_URI=${uri}
> diff --git a/scripts/nwfilter/nwfilter_concurrent.sh b/scripts/nwfilter/nwfilter_concurrent.sh
> index 4c9b878..c42dd78 100644
> --- a/scripts/nwfilter/nwfilter_concurrent.sh
> +++ b/scripts/nwfilter/nwfilter_concurrent.sh
> @@ -12,7 +12,7 @@ uri=$(sed -n '/^uri[     ]*=[     ]*/ {
>  $ {
>    x
>    p
> -}' < "$LIBVIRT_TCK_CONFIG")
> +}' < "$LIBVIRT_TCK_CONFIG" | sed -e 's/"//g')
>  : "${uri:=qemu:///system}"
>  
>  LIBVIRT_URI=${uri}


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [tck PATCH v2 02/13] scripts: strip quotes from URI before checking it
Posted by Daniel P. Berrangé 6 years, 11 months ago
On Fri, Jun 01, 2018 at 04:04:09PM -0400, Laine Stump wrote:
> On 05/21/2018 12:46 PM, Daniel P. Berrangé wrote:
> > The config file may have the URI listed with or without quotes, and the
> > nwfilter tests didn't strip quotes before checking against the
> > whitelisted URI.
> 
> I'm curious what you were doing that you ended up setting this.  Running
> tests against qemu:///session?

No, I simply set

  uri = "qemu:///system"

in the /etc/libvirt-tck/default.cfg because I want to be explicit about
what HV i'm testing rather than let it autodetect and surprise me one
day by picking the wrong one.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list