mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
Add test cases for new ways to access variables in filters
This patch adds a couple of XML parser / schema validator test cases for the new 'ways' to access variables via index or iterator.
This commit is contained in:
parent
64484d550d
commit
0c42e1d9aa
6
tests/nwfilterxml2xmlin/iter-test1.xml
Normal file
6
tests/nwfilterxml2xmlin/iter-test1.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<filter name='testcase' chain='root'>
|
||||
<uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
|
||||
<rule action='accept' direction='out'>
|
||||
<tcp srcipaddr='$A' srcportstart='$B' dscp='2'/>
|
||||
</rule>
|
||||
</filter>
|
23
tests/nwfilterxml2xmlin/iter-test2.xml
Normal file
23
tests/nwfilterxml2xmlin/iter-test2.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<filter name='testcase' chain='root'>
|
||||
<uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
|
||||
<rule action='accept' direction='out'>
|
||||
<tcp srcipaddr='$A' srcportstart='$B[@0]' dscp='1'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out'>
|
||||
<udp srcipaddr='$A[@1]' srcportstart='$B[@2]' dscp='2'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out'>
|
||||
<sctp srcipaddr='$A[@1]' srcportstart='$B[@2]' dstportstart='$C[@2]'
|
||||
dscp='3'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out'>
|
||||
<tcp srcipaddr='$A[@1]' srcportstart='$B[@2]' dstportstart='$C[@3]'
|
||||
dscp='4'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out'>
|
||||
<udp srcipaddr='$A[@1]' dstipaddr='$A[@2]' dscp='5'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out'>
|
||||
<sctp srcipaddr='$A' dstipaddr='$A' dscp='6'/>
|
||||
</rule>
|
||||
</filter>
|
13
tests/nwfilterxml2xmlin/iter-test3.xml
Normal file
13
tests/nwfilterxml2xmlin/iter-test3.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<filter name='testcase' chain='root'>
|
||||
<uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
|
||||
<rule action='accept' direction='out'>
|
||||
<tcp srcipaddr='$A[ 0]' srcportstart='$B[ @0 ] ' dscp='1'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out'>
|
||||
<udp srcipaddr='$A[1 ]' srcportstart='$B[ @2 ]' dscp='2'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out'>
|
||||
<sctp srcipaddr='$A[ 1 ] ' srcportstart='$B[2 ] ' dstportstart='$C[ 2 ]'
|
||||
dscp='3'/>
|
||||
</rule>
|
||||
</filter>
|
6
tests/nwfilterxml2xmlout/iter-test1.xml
Normal file
6
tests/nwfilterxml2xmlout/iter-test1.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<filter name='testcase' chain='root'>
|
||||
<uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<tcp srcipaddr='$A' dscp='2' srcportstart='$B'/>
|
||||
</rule>
|
||||
</filter>
|
21
tests/nwfilterxml2xmlout/iter-test2.xml
Normal file
21
tests/nwfilterxml2xmlout/iter-test2.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<filter name='testcase' chain='root'>
|
||||
<uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<tcp srcipaddr='$A' dscp='1' srcportstart='$B'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<udp srcipaddr='$A[@1]' dscp='2' srcportstart='$B[@2]'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<sctp srcipaddr='$A[@1]' dscp='3' srcportstart='$B[@2]' dstportstart='$C[@2]'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<tcp srcipaddr='$A[@1]' dscp='4' srcportstart='$B[@2]' dstportstart='$C[@3]'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<udp srcipaddr='$A[@1]' dstipaddr='$A[@2]' dscp='5'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<sctp srcipaddr='$A' dstipaddr='$A' dscp='6'/>
|
||||
</rule>
|
||||
</filter>
|
12
tests/nwfilterxml2xmlout/iter-test3.xml
Normal file
12
tests/nwfilterxml2xmlout/iter-test3.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<filter name='testcase' chain='root'>
|
||||
<uuid>5c6d49af-b071-6127-b4ec-6f8ed4b55335</uuid>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<tcp srcipaddr='$A[0]' dscp='1' srcportstart='$B'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<udp srcipaddr='$A[1]' dscp='2' srcportstart='$B[@2]'/>
|
||||
</rule>
|
||||
<rule action='accept' direction='out' priority='500'>
|
||||
<sctp srcipaddr='$A[1]' dscp='3' srcportstart='$B[2]' dstportstart='$C[2]'/>
|
||||
</rule>
|
||||
</filter>
|
@ -153,6 +153,9 @@ mymain(void)
|
||||
DO_TEST("chain_prefixtest1", true); /* derived from arp-test */
|
||||
|
||||
DO_TEST("attr-value-test", false);
|
||||
DO_TEST("iter-test1", false);
|
||||
DO_TEST("iter-test2", false);
|
||||
DO_TEST("iter-test3", false);
|
||||
|
||||
return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user