summaryrefslogtreecommitdiffstats
path: root/test/hook.py
AgeCommit message (Expand)AuthorFilesLines
2020-12-07tests: py2 cleanup - remove subclassing of objectPaul Vinciguerra1-1/+1
2019-06-24tests: refactor VppDiedError.Paul Vinciguerra1-20/+4
2019-03-27make-test: fix ValueError raised by hook in python3Naveen Joy1-1/+1
2019-03-11VPP-1508: Use scapy.compat to manage packet level library differences.Paul Vinciguerra1-1/+4
2019-03-11Test: Fix hook.py: AttributeErrorPaul Vinciguerra1-1/+1
2019-02-28Remove unused imports from hooksNaveen Joy1-4/+0
2019-02-26make test: Add exception handling around subprocess.Paul Vinciguerra1-5/+16
2019-02-04Fix inheritance problem in test/hook.py.Paul Vinciguerra1-16/+16
2019-02-01VTL: Fix issue with ipaddress library use under python2.Paul Vinciguerra1-0/+5
2018-12-13test/hook.py. Add human-friendly annotations to log msgs.Paul Vinciguerra1-3/+19
2018-10-10Setup, teardown, DEBUG=core, FAILFAST fixesjuraj.linkes1-21/+14
2018-08-30Fix the default step when using STEP=1 while testingjuraj.linkes1-1/+1
2018-08-23CSIT-1139: Implement parallel test executionjuraj.linkes1-5/+5
2018-03-31make test: print a warning in case a core_pattern contains a filter programAndrew Yourtchenko1-0/+2
2018-03-24make test: enhance core-file informationKlement Sekera1-2/+12
2018-03-23make test: code cleanupKlement Sekera1-3/+5
2018-03-14make test: early core detection, code cleanupKlement Sekera1-0/+2
2018-02-01IPv4/6 reassemblyKlement Sekera1-9/+5
2017-11-06make test: fix DEBUG=core errorKlement Sekera1-1/+1
2017-08-10make test: detect hung testsKlement Sekera1-22/+7
2017-01-11make test: improve documentation and PEP8 complianceKlement Sekera1-2/+2
2016-12-07BFD: basic asynchronous session up/downKlement Sekera1-8/+12
2016-11-28make test: detect early vpp crashKlement Sekera1-2/+1
2016-11-02Improve debug-cli in test frameworkKlement Sekera1-1/+1
2016-10-31add vpp debugging support to test frameworkKlement Sekera1-8/+104
2016-10-26refactor test frameworkKlement Sekera1-0/+128
ss="p">): """ :param VppInterface src_if: Packets are send to this interface, using this interfaces remote host. :param list dst_ifs: IPv4 ICMP requests are send to interfaces addresses. :return: List of generated packets. """ pkts = [] for i in dst_ifs: p = (Ether(dst=src_if.local_mac, src=src_if.remote_mac) / IP(src=src_if.remote_ip4, dst=i.local_ip4) / ICMP(id=i.sw_if_index, type='echo-request')) pkts.append(p) return pkts def verify_icmp(self, capture, request_src_if, dst_ifs): """ :param capture: Capture to verify. :param VppInterface request_src_if: Interface where was send packets. :param list dst_ifs: Interfaces where was generated IPv4 ICMP requests. """ rcvd_icmp_pkts = [] for pkt in capture: try: ip = pkt[IP] icmp = pkt[ICMP] except IndexError: pass else: info = (ip.src, ip.dst, icmp.type, icmp.id) rcvd_icmp_pkts.append(info) for i in dst_ifs: # 0 - icmp echo response info = (i.local_ip4, request_src_if.remote_ip4, 0, i.sw_if_index) self.assertIn(info, rcvd_icmp_pkts) def test_crud(self): # create loopbacks = self.create_loopback_interfaces(range(20)) for i in loopbacks: i.local_ip4_prefix_len = 32 i.config_ip4() i.admin_up() # read (check sw if dump, ip4 fib, ip6 fib) if_dump = self.vapi.sw_interface_dump() fib4_dump = self.vapi.ip_fib_dump() for i in loopbacks: self.assertTrue(i.is_interface_config_in_dump(if_dump)) self.assertTrue(i.is_ip4_entry_in_fib_dump(fib4_dump)) # check ping stream = self.create_icmp_stream(self.pg0, loopbacks) self.pg0.add_stream(stream) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg0.get_capture(expected_count=len(stream)) self.verify_icmp(capture, self.pg0, loopbacks) # delete for i in loopbacks: i.remove_vpp_config() # read (check not in sw if dump, ip4 fib, ip6 fib) if_dump = self.vapi.sw_interface_dump() fib4_dump = self.vapi.ip_fib_dump() for i in loopbacks: self.assertFalse(i.is_interface_config_in_dump(if_dump)) self.assertFalse(i.is_ip4_entry_in_fib_dump(fib4_dump)) # check not ping stream = self.create_icmp_stream(self.pg0, loopbacks) self.pg0.add_stream(stream) self.pg_enable_capture(self.pg_interfaces) self.pg_start() self.pg0.assert_nothing_captured() def test_down(self): # create loopbacks = self.create_loopback_interfaces(range(20)) for i in loopbacks: i.local_ip4_prefix_len = 32 i.config_ip4() i.admin_up() # disable for i in loopbacks: i.admin_down() i.unconfig_ip4() # read (check not in sw if dump, ip4 fib, ip6 fib) if_dump = self.vapi.sw_interface_dump() fib4_dump = self.vapi.ip_fib_dump() for i in loopbacks: self.assertTrue(i.is_interface_config_in_dump(if_dump)) self.assertFalse(i.is_ip4_entry_in_fib_dump(fib4_dump)) # check not ping stream = self.create_icmp_stream(self.pg0, loopbacks) self.pg0.add_stream(stream) self.pg_enable_capture(self.pg_interfaces) self.pg_start() self.pg0.assert_nothing_captured() if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)