[libvirt] [PATCH 2/2] Tests : Make nwfilter testcases robust against optional locking flags.

Martin Kletzander mkletzan at redhat.com
Tue Nov 25 12:27:37 UTC 2014


On Tue, Nov 25, 2014 at 05:12:48PM +0530, Prerna Saxena wrote:
>Commit dc33e6e4a5a5d42 introduces iptables/ebtables to adding locking
>flags if/when these are available. However, the nwfilter testcases
>list outputs without taking into account whether locking flags have been passed.
>
>This shows up false testcase failures such as :
> 2) ebiptablesTearOldRules                                            ...
>Offset 1035
>Expect [t nat -D PREROUTING -i vnet0 -j libvirt-I-vnet0
>ebtables -t nat -D POSTROUTING -o vnet0 -j libvirt-O-vnet0
>ebtables -t nat -L libvirt-I-vnet0
>ebtables -t nat -L libvirt-O-vnet0
>...snip...]
>Actual [-concurrent -t nat -D PREROUTING -i vnet0 -j libvirt-I-vnet0
>ebtables --concurrent -t nat -D POSTROUTING -o vnet0 -j libvirt-O-vnet0
>ebtables --concurrent -t nat -L libvirt-I-vnet0
>ebtables --concurrent -t nat -L libvirt-O-vnet0
>...snip...]
>
>This scrubs all reference to locking flags from test results buffer,
>so that achieved output matches the expected results.
>

Instead of parsing and re-creating the string (which also doesn't
check whether we use the locking flag properly), it would be way
better if we could unify the result.

From the top of my head, we can either expose the
virFirewallCheckUpdateLock() as non-static and mock it in tests to
always set the lock flags to true or we can create new functions that
will override setting of the flags.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141125/649a96f5/attachment-0001.sig>


More information about the libvir-list mailing list