diff mbox series

tools/xl: fix vif and vcpupin parse tests

Message ID 20220408133146.48117-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series tools/xl: fix vif and vcpupin parse tests | expand

Commit Message

Roger Pau Monné April 8, 2022, 1:31 p.m. UTC
Current vif and vcpupin parse tests are out of sync.  First of all, xl
returns 1 on failure, so replace the expected error code.

Secondly fix the expected output from some vif tests, as xl will no
longer print the unpopulated fields.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
We should find a way for those tests to be run as part of osstest, or
else they will go stale again sooner or later.
---
 tools/xl/check-xl-vcpupin-parse |  2 +-
 tools/xl/check-xl-vif-parse     | 52 +--------------------------------
 2 files changed, 2 insertions(+), 52 deletions(-)

Comments

Anthony PERARD April 8, 2022, 4:05 p.m. UTC | #1
On Fri, Apr 08, 2022 at 03:31:46PM +0200, Roger Pau Monne wrote:
> Current vif and vcpupin parse tests are out of sync.  First of all, xl
> returns 1 on failure, so replace the expected error code.
> 
> Secondly fix the expected output from some vif tests, as xl will no
> longer print the unpopulated fields.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

> ---
> We should find a way for those tests to be run as part of osstest, or
> else they will go stale again sooner or later.

I guess having those two tests case in "tools/tests/" would be better,
then having osstest runs all tests in "tools/tests/" might be the way to
go.

Thanks,
diff mbox series

Patch

diff --git a/tools/xl/check-xl-vcpupin-parse b/tools/xl/check-xl-vcpupin-parse
index 21f8421ad0..633616a597 100755
--- a/tools/xl/check-xl-vcpupin-parse
+++ b/tools/xl/check-xl-vcpupin-parse
@@ -158,7 +158,7 @@  END
 RANDOM=$seed
 
 echo "# Testing a wrong configuration" >> $outfile
-write foo 255 ""
+write foo 1 ""
 
 echo "# Testing the 'all' syntax" >> $outfile
 write "all" 0 "cpumap: all"
diff --git a/tools/xl/check-xl-vif-parse b/tools/xl/check-xl-vif-parse
index 02c6dbaeb6..04bd9463d8 100755
--- a/tools/xl/check-xl-vif-parse
+++ b/tools/xl/check-xl-vif-parse
@@ -40,7 +40,7 @@  complete () {
     fi
 }
 
-e=255
+e=1
 
 
 #---------- test data ----------
@@ -62,16 +62,6 @@  one $e rate=10ZB/m
 # test b/s and B/s rate units
 expected <<END
 vif: {
-    "backend_domid": 0,
-    "devid": 0,
-    "mtu": 0,
-    "model": null,
-    "mac": "00:00:00:00:00:00",
-    "ip": null,
-    "bridge": null,
-    "ifname": null,
-    "script": null,
-    "nictype": null,
     "rate_bytes_per_interval": 100000,
     "rate_interval_usecs": 50000
 }
@@ -86,16 +76,6 @@  one 0 rate=2000000B/s@50ms
 # test Kb/s and KB/s rate units
 expected <<END
 vif: {
-    "backend_domid": 0,
-    "devid": 0,
-    "mtu": 0,
-    "model": null,
-    "mac": "00:00:00:00:00:00",
-    "ip": null,
-    "bridge": null,
-    "ifname": null,
-    "script": null,
-    "nictype": null,
     "rate_bytes_per_interval": 100,
     "rate_interval_usecs": 50000
 }
@@ -109,16 +89,6 @@  one 0 rate=2KB/s@50ms
 # test Mb/s and MB/s rate units
 expected <<END
 vif: {
-    "backend_domid": 0,
-    "devid": 0,
-    "mtu": 0,
-    "model": null,
-    "mac": "00:00:00:00:00:00",
-    "ip": null,
-    "bridge": null,
-    "ifname": null,
-    "script": null,
-    "nictype": null,
     "rate_bytes_per_interval": 100000,
     "rate_interval_usecs": 50000
 }
@@ -132,16 +102,6 @@  one 0 rate=2MB/s@50ms
 # test Gb/s and GB/s rate units
 expected <<END
 vif: {
-    "backend_domid": 0,
-    "devid": 0,
-    "mtu": 0,
-    "model": null,
-    "mac": "00:00:00:00:00:00",
-    "ip": null,
-    "bridge": null,
-    "ifname": null,
-    "script": null,
-    "nictype": null,
     "rate_bytes_per_interval": 50000000,
     "rate_interval_usecs": 50000
 }
@@ -173,16 +133,6 @@  one $e rate=10MB/s@10h
 # test replenishment interval in seconds
 expected <<END
 vif: {
-    "backend_domid": 0,
-    "devid": 0,
-    "mtu": 0,
-    "model": null,
-    "mac": "00:00:00:00:00:00",
-    "ip": null,
-    "bridge": null,
-    "ifname": null,
-    "script": null,
-    "nictype": null,
     "rate_bytes_per_interval": 10000000,
     "rate_interval_usecs": 1000000
 }