[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4 of 4] xl: add "check-xl-vif-parse" test script



On Tue, 2012-03-20 at 01:28 +0000, Mathieu Gagnà wrote:
> This test script runs "xl -N network-attach 0 <foobar>" against various
> rate syntax and checks that the output is as expected.
> 
> Signed-off-by: Mathieu Gagnà <mgagne@xxxxxxxx>

Great to see a testsuite! Thanks.

> [...]+
> +# test invalid rate
> +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": 214748364,
> +    "rate_interval_usecs": 50000
> +}
> +
> +END
> +one 0 rate=foo

I think the result for all these ought to be a syntax error rather than
success with a default value?

> +one 0 rate=10MB
> +one 0 rate=10MB/m
> +one 0 rate=10ZB
> +one 0 rate=10ZB/s
> +one 0 rate=10ZB/m
> +
> +# test Kb/s unit
> +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
> +}
> +
> +END
> +one 0 rate=16Kb/s
> +one 0 rate=16Kb/s@50ms
> +one 0 rate=2KB/s
> +one 0 rate=2KB/s@50ms

Took me a while to spot b vs B but this looks good.

> +[...]
> +# test bytes/s overflow
> +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": 214748364,
> +    "rate_interval_usecs": 50000
> +}
> +
> +END
> +one 0 rate=40Gb/s
> +one 0 rate=40Gb/s@50ms
> +one 0 rate=40GB/s
> +one 0 rate=40GB/s@50ms

40Gb is not beyond the realms of current hardware (although its a bit of
a stretch for the PV net protocol). Stefano suggested using a 64 but
type which might be a good idea for that reason. 

The kernel appears to do the right error handling with overflow. I
suppose it would be worth mentining in the documentation that the
enforcement of these limits is dependent on netback implementing it (at
least Linux does, don't know bout *BSD) and the limitations are kernel
specific.

[...]
> +# test invalid interval
> +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": 4294967295,
> +    "rate_interval_usecs": 0
> +}
> +
> +END
> +one 0 rate=10Mb/s@foo

This ought to be a syntax error.

Ian.

> +one 0 rate=10Mb/s@10h
> +one 0 rate=10MB/s@foo
> +one 0 rate=10MB/s@10h
> +
> +# test bytes/s with interval overflow
> +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": 4294967295,
> +    "rate_interval_usecs": 0
> +}
> +
> +END
> +one 0 rate=200Gb/s@10s
> +one 0 rate=25GB/s@10s
> +
> +complete
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.