Updated SXP CSIT with new feature PeerSequence filter, 87/37787/6
authorMartin Mihálek <mamihale@cisco.com>
Tue, 19 Apr 2016 08:16:04 +0000 (10:16 +0200)
committerVratko Polák <vrpolak@cisco.com>
Fri, 22 Apr 2016 09:19:52 +0000 (09:19 +0000)
added Berrilium test plan which skips test with this feature.
Changed position of Topology setup in filtering tests,
to cover more scenarios.

Change-Id: I378e14c17023a32e7da6cc10d0374161c25c072d
Signed-off-by: Martin Mihálek <mamihale@cisco.com>
csit/libraries/Sxp.py
csit/suites/sxp/filtering/010_Inbound_Filtering.robot
csit/suites/sxp/filtering/020_Outbound_Filtering.robot
csit/suites/sxp/filtering/030_Inbound_Filtering_Discarding.robot
csit/suites/sxp/filtering/040_Peer_Sequence_filtering.robot [new file with mode: 0644]
csit/testplans/sxp-filtering-beryllium.txt [new file with mode: 0644]

index e5048b93dd654cd101819b40fc95ff5abe1a7c05..cd2aefaf9f23ed65b9cce02a5e93e95731951ad9 100644 (file)
@@ -46,7 +46,7 @@ def lower_version(ver1, ver2):
         return ver2
 
 
         return ver2
 
 
-def get_filter_entry(seq, entry_type, sgt="", esgt="", acl="", eacl="", pl="", epl=""):
+def get_filter_entry(seq, entry_type, sgt="", esgt="", acl="", eacl="", pl="", epl="", ps=""):
     """Generate xml containing FilterEntry data
 
     :param seq: Sequence of entry
     """Generate xml containing FilterEntry data
 
     :param seq: Sequence of entry
@@ -65,6 +65,8 @@ def get_filter_entry(seq, entry_type, sgt="", esgt="", acl="", eacl="", pl="", e
     :type pl: string
     :param epl: ExtendedPrefixList matches to be added to entry
     :type epl: string
     :type pl: string
     :param epl: ExtendedPrefixList matches to be added to entry
     :type epl: string
+    :param ps: PeerSequence matches to be added to entry
+    :type ps: string
     :returns: String containing xml data for request
 
     """
     :returns: String containing xml data for request
 
     """
@@ -87,9 +89,14 @@ def get_filter_entry(seq, entry_type, sgt="", esgt="", acl="", eacl="", pl="", e
     elif eacl:
         args = eacl.split(',')
         entries += add_eacl_entry_xml(args[0], args[1], args[2], args[3])
     elif eacl:
         args = eacl.split(',')
         entries += add_eacl_entry_xml(args[0], args[1], args[2], args[3])
+    if ps:
+        args = ps.split(',')
+        entries += add_ps_entry_xml(args[0], args[1])
     # Wrap entries in ACL/PrefixList according to specified values
     if pl or epl:
         return add_pl_entry_default_xml(seq, entry_type, entries)
     # Wrap entries in ACL/PrefixList according to specified values
     if pl or epl:
         return add_pl_entry_default_xml(seq, entry_type, entries)
+    elif ps:
+        return add_ps_entry_default_xml(seq, entry_type, entries)
     return add_acl_entry_default_xml(seq, entry_type, entries)
 
 
     return add_acl_entry_default_xml(seq, entry_type, entries)
 
 
@@ -210,6 +217,26 @@ def add_eacl_entry_xml(ip, mask, amask, wmask):
     return templ.substitute({'ip': ip, 'mask': mask, 'amask': amask, 'wmask': wmask})
 
 
     return templ.substitute({'ip': ip, 'mask': mask, 'amask': amask, 'wmask': wmask})
 
 
+def add_ps_entry_default_xml(seq, entry_type, ps_entries):
+    """Generate xml containing PeerSequence data
+
+    :param seq: Sequence of PrefixList entry
+    :type seq: string
+    :param entry_type: Entry type (permit/deny)
+    :type entry_type: string
+    :param ps_entries: XML data containing PeerSequence entries
+    :type ps_entries: string
+    :returns: String containing xml data for request
+
+    """
+    templ = Template('''
+    <peer-sequence-entry xmlns="urn:opendaylight:sxp:controller">
+          <entry-type>$entry_type</entry-type>
+          <entry-seq>$seq</entry-seq>$ps_entries
+    </peer-sequence-entry>''')
+    return templ.substitute({'seq': seq, 'entry_type': entry_type, 'ps_entries': ps_entries})
+
+
 def add_pl_entry_default_xml(seq, entry_type, pl_entries):
     """Generate xml containing PrefixList data
 
 def add_pl_entry_default_xml(seq, entry_type, pl_entries):
     """Generate xml containing PrefixList data
 
@@ -268,6 +295,23 @@ def add_epl_entry_xml(prefix, op, mask):
     return templ.substitute({'prefix': prefix, 'mask': mask, 'op': op})
 
 
     return templ.substitute({'prefix': prefix, 'mask': mask, 'op': op})
 
 
+def add_ps_entry_xml(op, length):
+    """Generate xml containing Extended PrefixList data
+
+    :param op: PrefixList option (ge/le/eq)
+    :type op: string
+    :param length: PeerSequence length
+    :type length: string
+    :returns: String containing xml data for request
+
+    """
+    templ = Template('''
+        <peer-sequence-length>$length</peer-sequence-length>
+        <peer-sequence-range>$op</peer-sequence-range>
+        ''')
+    return templ.substitute({'length': length, 'op': op})
+
+
 def parse_peer_groups(groups_json):
     """Parse JSON string into Array of PeerGroups
 
 def parse_peer_groups(groups_json):
     """Parse JSON string into Array of PeerGroups
 
@@ -667,11 +711,11 @@ def get_connections_from_node_xml(ip):
     return data
 
 
     return data
 
 
-def get_bindings_from_node_xml(ip, range):
+def get_bindings_from_node_xml(ip, binding_range):
     """Generate xml for Get Bindings request
 
     """Generate xml for Get Bindings request
 
-    :param range: All or only Local bindings
-    :type ip: string
+    :param binding_range: All or only Local bindings
+    :type binding_range: string
     :param ip: Ipv4 address of node
     :type ip: string
     :returns: String containing xml data for request
     :param ip: Ipv4 address of node
     :type ip: string
     :returns: String containing xml data for request
@@ -681,5 +725,5 @@ def get_bindings_from_node_xml(ip, range):
   <requested-node xmlns="urn:opendaylight:sxp:controller">$ip</requested-node>
   <bindings-range xmlns="urn:opendaylight:sxp:controller">$range</bindings-range>
 </input>''')
   <requested-node xmlns="urn:opendaylight:sxp:controller">$ip</requested-node>
   <bindings-range xmlns="urn:opendaylight:sxp:controller">$range</bindings-range>
 </input>''')
-    data = templ.substitute({'ip': ip, 'range': range})
+    data = templ.substitute({'ip': ip, 'range': binding_range})
     return data
     return data
index eae9726cdc6ce12daa7a167da5b9fac0ed5ceb36..e895a49509200cc93ac070a3f36c7047f1f09ca8 100644 (file)
@@ -2,7 +2,6 @@
 Documentation     Test suite to verify Inbound filtering functionality
 Suite Setup       Setup SXP Environment
 Suite Teardown    Clean SXP Environment
 Documentation     Test suite to verify Inbound filtering functionality
 Suite Setup       Setup SXP Environment
 Suite Teardown    Clean SXP Environment
-Test Setup        Setup Topology Complex
 Test Teardown     Clean Nodes
 Library           RequestsLibrary
 Library           SSHLibrary
 Test Teardown     Clean Nodes
 Library           RequestsLibrary
 Library           SSHLibrary
@@ -24,6 +23,7 @@ Access List Filtering
     ${entry2}    Get Filter Entry    20    permit    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
     ${entry2}    Get Filter Entry    20    permit    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
+    Setup Topology Complex
     Wait Until Keyword Succeeds    4    1    Check One Group 4-2
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    acl=10.0.0.0,0.255.255.255
     Wait Until Keyword Succeeds    4    1    Check One Group 4-2
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    acl=10.0.0.0,0.255.255.255
@@ -42,6 +42,7 @@ Access List Sgt Filtering
     ${entry2}    Get Filter Entry    20    permit    sgt=50    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
     ${entry2}    Get Filter Entry    20    permit    sgt=50    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
+    Setup Topology Complex
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    acl=10.0.0.0,0.255.255.255
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    acl=10.0.0.0,0.255.255.255
@@ -56,6 +57,7 @@ Prefix List Filtering
     ${entry2}    Get Filter Entry    20    permit    epl=10.0.0.0/8,le,16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
     ${entry2}    Get Filter Entry    20    permit    epl=10.0.0.0/8,le,16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
+    Setup Topology Complex
     Wait Until Keyword Succeeds    4    1    Check One Group 4-2
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    pl=10.0.0.0/8
     Wait Until Keyword Succeeds    4    1    Check One Group 4-2
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    pl=10.0.0.0/8
@@ -74,6 +76,7 @@ Prefix List Sgt Filtering
     ${entry2}    Get Filter Entry    20    permit    pl=10.50.0.0/16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
     ${entry2}    Get Filter Entry    20    permit    pl=10.50.0.0/16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound    ${entries}
+    Setup Topology Complex
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    pl=10.0.0.0/8
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    pl=10.0.0.0/8
index 151762cce2c90e4c1c464aec9a7e9822e85dae99..0a86aea87ea11446b1301b9382040db58278fe17 100644 (file)
@@ -2,7 +2,6 @@
 Documentation     Test suite to verify Outbound filtering functionality
 Suite Setup       Setup SXP Environment
 Suite Teardown    Clean SXP Environment
 Documentation     Test suite to verify Outbound filtering functionality
 Suite Setup       Setup SXP Environment
 Suite Teardown    Clean SXP Environment
-Test Setup        Setup Nodes
 Test Teardown     Clean Nodes
 Library           RequestsLibrary
 Library           SSHLibrary
 Test Teardown     Clean Nodes
 Library           RequestsLibrary
 Library           SSHLibrary
@@ -25,6 +24,7 @@ Access List Filtering
     ${entry3}    Get Filter Entry    30    permit    acl=10.0.0.0,0.255.255.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
     ${entry3}    Get Filter Entry    30    permit    acl=10.0.0.0,0.255.255.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
+    Setup Nodes
     Wait Until Keyword Succeeds    4    1    Check One Group 4-5
     Delete Filter    GROUP    outbound
     ${entry1}    Get Filter Entry    10    permit    acl=10.20.0.0,0.0.255.255
     Wait Until Keyword Succeeds    4    1    Check One Group 4-5
     Delete Filter    GROUP    outbound
     ${entry1}    Get Filter Entry    10    permit    acl=10.20.0.0,0.0.255.255
@@ -42,6 +42,7 @@ Access List Sgt Filtering
     ${entry3}    Get Filter Entry    30    permit    sgt=30    acl=10.10.10.0,0.0.0.255
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
     ${entry3}    Get Filter Entry    30    permit    sgt=30    acl=10.10.10.0,0.0.0.255
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
+    Setup Nodes
     Wait Until Keyword Succeeds    4    1    Check One Group 2-5
     Delete Filter    GROUP    outbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    acl=10.10.0.0,0.0.255.255
     Wait Until Keyword Succeeds    4    1    Check One Group 2-5
     Delete Filter    GROUP    outbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    acl=10.10.0.0,0.0.255.255
@@ -57,6 +58,7 @@ Prefix List Filtering
     ${entry3}    Get Filter Entry    30    permit    epl=10.0.0.0/8,le,24
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
     ${entry3}    Get Filter Entry    30    permit    epl=10.0.0.0/8,le,24
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
+    Setup Nodes
     Wait Until Keyword Succeeds    4    1    Check One Group 4-5
     Delete Filter    GROUP    outbound
     ${entry1}    Get Filter Entry    10    permit    pl=10.20.0.0/16
     Wait Until Keyword Succeeds    4    1    Check One Group 4-5
     Delete Filter    GROUP    outbound
     ${entry1}    Get Filter Entry    10    permit    pl=10.20.0.0/16
@@ -74,6 +76,7 @@ Prefix List Sgt Filtering
     ${entry3}    Get Filter Entry    30    permit    sgt=30    pl=10.10.10.0/24
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
     ${entry3}    Get Filter Entry    30    permit    sgt=30    pl=10.10.10.0/24
     ${entries}    Combine Strings    ${entry1}    ${entry2}    ${entry3}
     Add Filter    GROUP    outbound    ${entries}
+    Setup Nodes
     Wait Until Keyword Succeeds    4    1    Check One Group 2-5
     Delete Filter    GROUP    outbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    pl=10.10.0.0/16
     Wait Until Keyword Succeeds    4    1    Check One Group 2-5
     Delete Filter    GROUP    outbound
     ${entries}    Get Filter Entry    10    permit    esgt=20,40    pl=10.10.0.0/16
index 6a1e4c72df14618ec43486241e550f9f107e29db..0e7030e3ea7bd8a9354353376361cd909c18bbc1 100644 (file)
@@ -30,13 +30,13 @@ Access List Filtering
 
 Access List Sgt Filtering
     [Documentation]    Test ACL and SGT filter behaviour during filter update
 
 Access List Sgt Filtering
     [Documentation]    Test ACL and SGT filter behaviour during filter update
-    Setup Nodes
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    acl=10.10.10.0,0.0.0.255
     ${entry2}    Get Filter Entry    20    permit    sgt=50    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    acl=10.10.10.0,0.0.0.255
     ${entry2}    Get Filter Entry    20    permit    sgt=50    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
+    Setup Nodes
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
@@ -56,13 +56,13 @@ Prefix List Filtering
 
 Prefix List Sgt Filtering
     [Documentation]    Test Prefix List and SGT filter behaviour during filter update
 
 Prefix List Sgt Filtering
     [Documentation]    Test Prefix List and SGT filter behaviour during filter update
-    Setup Nodes
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    pl=10.10.10.0/24
     ${entry2}    Get Filter Entry    20    permit    pl=10.50.0.0/16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    pl=10.10.10.0/24
     ${entry2}    Get Filter Entry    20    permit    pl=10.50.0.0/16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
+    Setup Nodes
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
@@ -82,13 +82,13 @@ Access List Filtering Legacy
 
 Access List Sgt Filtering Legacy
     [Documentation]    Test ACL and SGT filter behaviour during filter update
 
 Access List Sgt Filtering Legacy
     [Documentation]    Test ACL and SGT filter behaviour during filter update
-    Setup Nodes Legacy Par One
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    acl=10.10.10.0,0.0.0.255
     ${entry2}    Get Filter Entry    20    permit    sgt=50    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    acl=10.10.10.0,0.0.0.255
     ${entry2}    Get Filter Entry    20    permit    sgt=50    acl=10.0.0.0,0.254.0.0
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
+    Setup Nodes Legacy Par One
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
@@ -108,13 +108,13 @@ Prefix List Filtering Legacy
 
 Prefix List Sgt Filtering Legacy
     [Documentation]    Test Prefix List and SGT filter behaviour during filter update
 
 Prefix List Sgt Filtering Legacy
     [Documentation]    Test Prefix List and SGT filter behaviour during filter update
-    Setup Nodes Legacy Par One
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    pl=10.10.10.0/24
     ${entry2}    Get Filter Entry    20    permit    pl=10.50.0.0/16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
     ${peers}    Add Peers    127.0.0.3    127.0.0.5
     Add PeerGroup    GROUP    ${peers}
     ${entry1}    Get Filter Entry    10    permit    sgt=30    pl=10.10.10.0/24
     ${entry2}    Get Filter Entry    20    permit    pl=10.50.0.0/16
     ${entries}    Combine Strings    ${entry1}    ${entry2}
     Add Filter    GROUP    inbound-discarding    ${entries}
+    Setup Nodes Legacy Par One
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
     Delete Filter    GROUP    inbound-discarding
     Wait Until Keyword Succeeds    4    1    Check One Group 5-3
diff --git a/csit/suites/sxp/filtering/040_Peer_Sequence_filtering.robot b/csit/suites/sxp/filtering/040_Peer_Sequence_filtering.robot
new file mode 100644 (file)
index 0000000..18ad8d7
--- /dev/null
@@ -0,0 +1,360 @@
+*** Settings ***
+Documentation     Test suite to verify Outbound filtering functionality
+Suite Setup       Setup SXP Environment
+Suite Teardown    Clean SXP Environment
+Test Teardown     Clean Nodes
+Library           RequestsLibrary
+Library           SSHLibrary
+Library           ../../../libraries/Sxp.py
+Library           ../../../libraries/Common.py
+Resource          ../../../libraries/SxpLib.robot
+Resource          ../../../libraries/Utils.robot
+Resource          ../../../libraries/KarafKeywords.robot
+Resource          ../../../variables/Variables.py
+
+*** Variables ***
+
+*** Test Cases ***
+Peer Sequence Filtering
+    [Documentation]    Test PeerSequence filter behaviour
+    ${peers}    Add Peers    127.0.0.2
+    Add PeerGroup    GROUP    ${peers}
+    ${entry1}    Get Filter Entry    10    permit    ps=le,0
+    ${entries}    Combine Strings    ${entry1}
+    Add Filter    GROUP    outbound    ${entries}
+    Setup Nodes
+    Wait Until Keyword Succeeds    4    1    Check PeerSequence One
+    Delete Filter    GROUP    outbound
+    ${peers}    Add Peers    127.0.0.2
+    Add PeerGroup    GROUP    ${peers}
+    ${entry1}    Get Filter Entry    10    permit    ps=le,1
+    ${entries}    Combine Strings    ${entry1}
+    Add Filter    GROUP    outbound    ${entries}
+    Wait Until Keyword Succeeds    4    1    Check PeerSequence Two
+    Delete Filter    GROUP    outbound
+    ${peers}    Add Peers    127.0.0.2
+    Add PeerGroup    GROUP    ${peers}
+    ${entry1}    Get Filter Entry    10    permit    ps=le,2
+    ${entries}    Combine Strings    ${entry1}
+    Add Filter    GROUP    outbound    ${entries}
+    Wait Until Keyword Succeeds    4    1    Check PeerSequence Three
+    Delete Filter    GROUP    outbound
+    ${peers}    Add Peers    127.0.0.2
+    Add PeerGroup    GROUP    ${peers}
+    ${entry1}    Get Filter Entry    10    deny    ps=eq,1
+    ${entry2}    Get Filter Entry    20    permit    ps=ge,0
+    ${entries}    Combine Strings    ${entry1}    ${entry2}
+    Add Filter    GROUP    outbound    ${entries}
+    Wait Until Keyword Succeeds    4    1    Check PeerSequence Mix
+    Delete Filter    GROUP    outbound
+
+Inbound PL Combinations Filtering
+    [Documentation]    Test PeerSequence filter combined with PrefixList filter
+    @{scopes}    Create List    inbound    inbound-discarding
+    : FOR    ${scope}    IN    @{scopes}
+    \    Add PeerGroup    GROUP
+    \    ${entry1}    Get Filter Entry    10    permit    ps=le,1
+    \    ${entries}    Combine Strings    ${entry1}
+    \    Add Filter    GROUP    ${scope}    ${entries}
+    \    Setup Nodes Inbound Test
+    \    ${peers}    Add Peers    127.0.0.2
+    \    Add PeerGroup    GROUP2    ${peers}
+    \    ${entry1}    Get Filter Entry    10    permit    pl=1.1.0.0/16
+    \    ${entries}    Combine Strings    ${entry1}
+    \    Add Filter    GROUP2    ${scope}    ${entries}
+    \    Wait Until Keyword Succeeds    4    1    Check Inbound PL Combinations Filtering
+    \    Clean Nodes
+
+Inbound ACL Combinations Filtering
+    [Documentation]    Test PeerSequence filter combined with ACL filter
+    @{scopes}    Create List    inbound    inbound-discarding
+    : FOR    ${scope}    IN    @{scopes}
+    \    ${peers}    Add Peers    127.0.0.2
+    \    Add PeerGroup    GROUP2    ${peers}
+    \    ${entry1}    Get Filter Entry    10    permit    ps=le,2
+    \    ${entries}    Combine Strings    ${entry1}
+    \    Add Filter    GROUP2    ${scope}    ${entries}
+    \    Setup Nodes Inbound Test
+    \    ${entry1}    Get Filter Entry    10    permit    acl=1.1.1.0,0.0.0.255
+    \    ${entries}    Combine Strings    ${entry1}
+    \    Add Filter    GROUP2    ${scope}    ${entries}
+    \    ${peers}    Add Peers    127.0.0.5
+    \    Add PeerGroup    GROUP5    ${peers}
+    \    ${entry1}    Get Filter Entry    10    permit    sgt=40
+    \    ${entries}    Combine Strings    ${entry1}
+    \    Add Filter    GROUP5    ${scope}    ${entries}
+    \    Wait Until Keyword Succeeds    4    1    Check Inbound ACL Combinations Filtering
+    \    Clean Nodes
+
+Outbound PL Combinations Filtering
+    [Documentation]    Test PeerSequence filter combined with PrefixList filter
+    Add PeerGroup    GROUP
+    ${entry1}    Get Filter Entry    10    permit    pl=1.1.1.0/24
+    ${entries}    Combine Strings    ${entry1}
+    Add Filter    GROUP    outbound    ${entries}
+    Setup Nodes Outbound Test
+    ${peers}    Add Peers    127.0.0.2
+    Add PeerGroup    GROUP2    ${peers}
+    ${entry1}    Get Filter Entry    10    permit    ps=le,1
+    ${entries}    Combine Strings    ${entry1}
+    Add Filter    GROUP2    outbound    ${entries}
+    Wait Until Keyword Succeeds    4    1    Check Outbound PL Combinations Filtering
+
+Outbound ACL Combinations Filtering
+    [Documentation]    Test PeerSequence filter combined with ACL filter
+    Add PeerGroup    GROUP
+    ${entry1}    Get Filter Entry    10    permit    ps=eq,0
+    ${entry2}    Get Filter Entry    20    permit    ps=ge,2
+    ${entries}    Combine Strings    ${entry1}    ${entry2}
+    Add Filter    GROUP    outbound    ${entries}
+    Setup Nodes Outbound Test
+    ${peers}    Add Peers    127.0.0.2
+    Add PeerGroup    GROUP2    ${peers}
+    ${entry1}    Get Filter Entry    10    permit    acl=1.1.0.0,0.0.255.255
+    ${entries}    Combine Strings    ${entry1}
+    Add Filter    GROUP2    outbound    ${entries}
+    Wait Until Keyword Succeeds    4    1    Check Outbound ACL Combinations Filtering
+
+*** Keywords ***
+Setup Nodes
+    [Arguments]    ${version}=version4    ${password}=none
+    [Documentation]    Setup Topology for PeerSequence tests
+    Add Binding    10    10.10.10.10/32    127.0.0.1
+    Add Binding    10    10.10.10.0/24    127.0.0.1
+    Add Binding    10    10.10.0.0/16    127.0.0.1
+    Add Binding    10    10.0.0.0/8    127.0.0.1
+    : FOR    ${node}    IN RANGE    2    6
+    \    Add Binding    ${node}0    10.10.10.${node}0/32    127.0.0.${node}
+    \    Add Binding    ${node}0    10.10.${node}0.0/24    127.0.0.${node}
+    \    Add Binding    ${node}0    10.${node}0.0.0/16    127.0.0.${node}
+    \    Add Binding    ${node}0    ${node}0.0.0.0/8    127.0.0.${node}
+    Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.2    ${password}
+    Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.1    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.2
+    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3    ${password}
+    Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
+    Add Connection    ${version}    speaker    127.0.0.3    64999    127.0.0.4    ${password}
+    Add Connection    ${version}    listener    127.0.0.4    64999    127.0.0.3    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.4
+    ...    64999    127.0.0.3
+    Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.5    ${password}
+    Add Connection    ${version}    listener    127.0.0.5    64999    127.0.0.4    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.5
+    ...    64999    127.0.0.4
+
+Setup Nodes Inbound Test
+    [Arguments]    ${version}=version4    ${password}=none
+    [Documentation]    Setup Topology for inbound PeerSequence and other filters tests
+    : FOR    ${node}    IN RANGE    2    6
+    \    Add Binding    ${node}0    1.1.1.${node}/32    127.0.0.${node}
+    \    Add Binding    ${node}0    1.1.${node}.0/24    127.0.0.${node}
+    \    Add Binding    ${node}0    1.${node}.0.0/16    127.0.0.${node}
+    \    Add Binding    ${node}0    ${node}.0.0.0/8    127.0.0.${node}
+    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2    ${password}
+    Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
+    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.5    ${password}
+    Add Connection    ${version}    listener    127.0.0.5    64999    127.0.0.1    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.5
+    Add Connection    ${version}    both    127.0.0.3    64999    127.0.0.2    ${password}
+    Add Connection    ${version}    both    127.0.0.2    64999    127.0.0.3    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.2
+    ...    64999    127.0.0.3
+    Add Connection    ${version}    both    127.0.0.3    64999    127.0.0.4    ${password}
+    Add Connection    ${version}    both    127.0.0.4    64999    127.0.0.3    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.4
+    ...    64999    127.0.0.3
+    Add Connection    ${version}    both    127.0.0.4    64999    127.0.0.5    ${password}
+    Add Connection    ${version}    both    127.0.0.5    64999    127.0.0.4    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.5
+    ...    64999    127.0.0.4
+
+Setup Nodes Outbound Test
+    [Arguments]    ${version}=version4    ${password}=none
+    [Documentation]    Setup Topology for outbound PeerSequence and other filters tests
+    Add Binding    10    1.1.1.1/32    127.0.0.1
+    Add Binding    10    1.1.1.0/24    127.0.0.1
+    Add Binding    10    1.1.0.0/16    127.0.0.1
+    Add Binding    10    1.0.0.0/8    127.0.0.1
+    : FOR    ${node}    IN RANGE    3    6
+    \    Add Binding    ${node}0    1.1.1.${node}/32    127.0.0.${node}
+    \    Add Binding    ${node}0    1.1.${node}.0/24    127.0.0.${node}
+    \    Add Binding    ${node}0    1.${node}.0.0/16    127.0.0.${node}
+    \    Add Binding    ${node}0    ${node}.0.0.0/8    127.0.0.${node}
+    Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.2    ${password}
+    Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.1    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.2
+    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3    ${password}
+    Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
+    Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.4    ${password}
+    Add Connection    ${version}    listener    127.0.0.4    64999    127.0.0.1    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.4
+    Add Connection    ${version}    both    127.0.0.4    64999    127.0.0.5    ${password}
+    Add Connection    ${version}    both    127.0.0.5    64999    127.0.0.4    ${password}
+    Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    both    127.0.0.5
+    ...    64999    127.0.0.4
+
+Check PeerSequence One
+    [Documentation]    Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 1
+    ${resp}    Get Bindings    127.0.0.2
+    Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
+    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
+    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
+    Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
+    : FOR    ${node}    IN RANGE    3    6
+    \    Should Not Contain Binding    ${resp}    ${node}0    10.10.10.${node}0/32
+    \    Should Not Contain Binding    ${resp}    ${node}0    10.10.${node}0.0/24
+    \    Should Not Contain Binding    ${resp}    ${node}0    10.${node}0.0.0/16
+    \    Should Not Contain Binding    ${resp}    ${node}0    ${node}0.0.0.0/8
+
+Check PeerSequence Two
+    [Documentation]    Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 2
+    ${resp}    Get Bindings    127.0.0.2
+    Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
+    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
+    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
+    Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
+    Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
+    Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
+    Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
+    : FOR    ${node}    IN RANGE    4    6
+    \    Should Not Contain Binding    ${resp}    ${node}0    10.10.10.${node}0/32
+    \    Should Not Contain Binding    ${resp}    ${node}0    10.10.${node}0.0/24
+    \    Should Not Contain Binding    ${resp}    ${node}0    10.${node}0.0.0/16
+    \    Should Not Contain Binding    ${resp}    ${node}0    ${node}0.0.0.0/8
+
+Check PeerSequence Three
+    [Documentation]    Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 3
+    ${resp}    Get Bindings    127.0.0.2
+    Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
+    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
+    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
+    Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    30    10.10.10.30/32    sxp
+    Should Contain Binding    ${resp}    30    10.10.30.0/24    sxp
+    Should Contain Binding    ${resp}    30    10.30.0.0/16    sxp
+    Should Contain Binding    ${resp}    30    30.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
+    Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
+    Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
+    Should Contain Binding    ${resp}    40    40.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    50    10.10.10.50/32
+    Should Not Contain Binding    ${resp}    50    10.10.50.0/24
+    Should Not Contain Binding    ${resp}    50    10.50.0.0/16
+    Should Not Contain Binding    ${resp}    50    50.0.0.0/8
+
+Check PeerSequence Mix
+    [Documentation]    Node 127.0.0.2 should not contain bindings with peer sequence 1
+    ${resp}    Get Bindings    127.0.0.2
+    Should Contain Binding    ${resp}    10    10.10.10.10/32    sxp
+    Should Contain Binding    ${resp}    10    10.10.10.0/24    sxp
+    Should Contain Binding    ${resp}    10    10.10.0.0/16    sxp
+    Should Contain Binding    ${resp}    10    10.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    30    10.10.10.30/32    sxp
+    Should Not Contain Binding    ${resp}    30    10.10.30.0/24    sxp
+    Should Not Contain Binding    ${resp}    30    10.30.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    30    30.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    40    10.10.10.40/32    sxp
+    Should Contain Binding    ${resp}    40    10.10.40.0/24    sxp
+    Should Contain Binding    ${resp}    40    10.40.0.0/16    sxp
+    Should Contain Binding    ${resp}    40    40.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    50    10.10.10.50/32
+    Should Contain Binding    ${resp}    50    10.10.50.0/24
+    Should Contain Binding    ${resp}    50    10.50.0.0/16
+    Should Contain Binding    ${resp}    50    50.0.0.0/8
+
+Check Inbound PL Combinations Filtering
+    [Documentation]    Node 127.0.0.1 should containt bindings with peer sequence lower than 1 and pl 1.1.0.0/16
+    ${resp}    Get Bindings    127.0.0.1
+    Should Contain Binding    ${resp}    20    1.1.1.2/32    sxp
+    Should Contain Binding    ${resp}    20    1.1.2.0/24    sxp
+    Should Not Contain Binding    ${resp}    20    1.2.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    20    2.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    30    1.1.1.3/32    sxp
+    Should Not Contain Binding    ${resp}    30    1.1.3.0/24    sxp
+    Should Not Contain Binding    ${resp}    30    1.3.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    30    3.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    40    1.1.1.4/32    sxp
+    Should Not Contain Binding    ${resp}    40    1.1.4.0/24    sxp
+    Should Not Contain Binding    ${resp}    40    1.4.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    40    4.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    50    1.1.1.5/32    sxp
+    Should Contain Binding    ${resp}    50    1.1.5.0/24    sxp
+    Should Contain Binding    ${resp}    50    1.5.0.0/16    sxp
+    Should Contain Binding    ${resp}    50    5.0.0.0/8    sxp
+
+Check Inbound ACL Combinations Filtering
+    [Documentation]    Node 127.0.0.1 should containt bindings with peer sequence lower than 2 and acl 1.1.1.0 0.0.0.255
+    ${resp}    Get Bindings    127.0.0.1
+    Should Contain Binding    ${resp}    20    1.1.1.2/32    sxp
+    Should Not Contain Binding    ${resp}    20    1.1.2.0/24    sxp
+    Should Not Contain Binding    ${resp}    20    1.2.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    20    2.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    30    1.1.1.3/32    sxp
+    Should Not Contain Binding    ${resp}    30    1.1.3.0/24    sxp
+    Should Not Contain Binding    ${resp}    30    1.3.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    30    3.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    40    1.1.1.4/32    sxp
+    Should Contain Binding    ${resp}    40    1.1.4.0/24    sxp
+    Should Contain Binding    ${resp}    40    1.4.0.0/16    sxp
+    Should Contain Binding    ${resp}    40    4.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    50    1.1.1.5/32    sxp
+    Should Not Contain Binding    ${resp}    50    1.1.5.0/24    sxp
+    Should Not Contain Binding    ${resp}    50    1.5.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    50    5.0.0.0/8    sxp
+
+Check Outbound PL Combinations Filtering
+    [Documentation]    Node 127.0.0.2 should containt bindings with peer sequence lower than 1 and pl 1.1.1.0/24
+    ${resp}    Get Bindings    127.0.0.2
+    Should Contain Binding    ${resp}    10    1.1.1.1/32    sxp
+    Should Contain Binding    ${resp}    10    1.1.1.0/24    sxp
+    Should Not Contain Binding    ${resp}    10    1.1.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    10    1.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    30    1.1.1.3/32    sxp
+    Should Not Contain Binding    ${resp}    30    1.1.3.0/24    sxp
+    Should Not Contain Binding    ${resp}    30    1.3.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    30    3.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    40    1.1.1.4/32    sxp
+    Should Not Contain Binding    ${resp}    40    1.1.4.0/24    sxp
+    Should Not Contain Binding    ${resp}    40    1.4.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    40    4.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    50    1.1.1.5/32    sxp
+    Should Not Contain Binding    ${resp}    50    1.1.5.0/24    sxp
+    Should Not Contain Binding    ${resp}    50    1.5.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    50    5.0.0.0/8    sxp
+
+Check Outbound ACL Combinations Filtering
+    [Documentation]    Node 127.0.0.2 should containt bindings with peer sequence equals to 0 or greter than 2 and acl 1.1.0.0 0.0.255.255
+    ${resp}    Get Bindings    127.0.0.2
+    Should Contain Binding    ${resp}    10    1.1.1.1/32    sxp
+    Should Contain Binding    ${resp}    10    1.1.1.0/24    sxp
+    Should Contain Binding    ${resp}    10    1.1.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    10    1.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    30    1.1.1.3/32    sxp
+    Should Not Contain Binding    ${resp}    30    1.1.3.0/24    sxp
+    Should Not Contain Binding    ${resp}    30    1.3.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    30    3.0.0.0/8    sxp
+    Should Not Contain Binding    ${resp}    40    1.1.1.4/32    sxp
+    Should Not Contain Binding    ${resp}    40    1.1.4.0/24    sxp
+    Should Not Contain Binding    ${resp}    40    1.4.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    40    4.0.0.0/8    sxp
+    Should Contain Binding    ${resp}    50    1.1.1.5/32    sxp
+    Should Contain Binding    ${resp}    50    1.1.5.0/24    sxp
+    Should Not Contain Binding    ${resp}    50    1.5.0.0/16    sxp
+    Should Not Contain Binding    ${resp}    50    5.0.0.0/8    sxp
+
+Clean Nodes
+    Clean Connections    127.0.0.1
+    Clean Connections    127.0.0.2
+    Clean Connections    127.0.0.3
+    Clean Connections    127.0.0.4
+    Clean Connections    127.0.0.5
+    Clean Peer Groups    127.0.0.1
+    Clean Bindings    127.0.0.1
+    Clean Bindings    127.0.0.2
+    Clean Bindings    127.0.0.3
+    Clean Bindings    127.0.0.4
+    Clean Bindings    127.0.0.5
diff --git a/csit/testplans/sxp-filtering-beryllium.txt b/csit/testplans/sxp-filtering-beryllium.txt
new file mode 100644 (file)
index 0000000..b1dd7d7
--- /dev/null
@@ -0,0 +1,5 @@
+# Place the suites in run order:
+integration/test/csit/suites/sxp/filtering/010_Inbound_Filtering.robot
+integration/test/csit/suites/sxp/filtering/020_Outbound_Filtering.robot
+integration/test/csit/suites/sxp/filtering/030_Inbound_Filtering_Discarding.robot
+