X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_acl_plugin.py;h=361ced14c21aee7d1e086e4a5bb6c5e6c3a55e77;hb=54c6dc450031443663d40b836a8b0bffdcc2bdea;hp=97fca1a1bb3702ba028301b36039ccdaad63b6ad;hpb=987abe9eeb65a3950401073c770012a7898593b7;p=vpp.git diff --git a/test/test_acl_plugin.py b/test/test_acl_plugin.py index 97fca1a1bb3..361ced14c21 100644 --- a/test/test_acl_plugin.py +++ b/test/test_acl_plugin.py @@ -85,8 +85,6 @@ class TestACLplugin(VppTestCase): """ super(TestACLplugin, cls).setUpClass() - random.seed() - try: # Create 2 pg interfaces cls.create_pg_interfaces(range(2)) @@ -532,7 +530,7 @@ class TestACLplugin(VppTestCase): r[i_rule][rule_key]) # Add a deny-1234 ACL - r_deny = ({'is_permit': 0, 'is_ipv6': 0, 'proto': 17, + r_deny = [{'is_permit': 0, 'is_ipv6': 0, 'proto': 17, 'srcport_or_icmptype_first': 1234, 'srcport_or_icmptype_last': 1235, 'src_ip_prefix_len': 0, @@ -549,7 +547,7 @@ class TestACLplugin(VppTestCase): 'dstport_or_icmpcode_first': 0, 'dstport_or_icmpcode_last': 0, 'dst_ip_addr': '\x00\x00\x00\x00', - 'dst_ip_prefix_len': 0}) + 'dst_ip_prefix_len': 0}] reply = self.vapi.acl_add_replace(acl_index=4294967295, r=r_deny, tag="deny 1234;permit all") @@ -560,15 +558,15 @@ class TestACLplugin(VppTestCase): # Test 2: try to modify a nonexistent ACL reply = self.vapi.acl_add_replace(acl_index=432, r=r, - tag="FFFF:FFFF", expected_retval=-1) - self.assertEqual(reply.retval, -1) + tag="FFFF:FFFF", expected_retval=-6) + self.assertEqual(reply.retval, -6) # The ACL number should pass through self.assertEqual(reply.acl_index, 432) # apply an ACL on an interface inbound, try to delete ACL, must fail self.vapi.acl_interface_set_acl_list(sw_if_index=self.pg0.sw_if_index, n_input=1, acls=[first_acl]) - reply = self.vapi.acl_del(acl_index=first_acl, expected_retval=-1) + reply = self.vapi.acl_del(acl_index=first_acl, expected_retval=-142) # Unapply an ACL and then try to delete it - must be ok self.vapi.acl_interface_set_acl_list(sw_if_index=self.pg0.sw_if_index, n_input=0, @@ -579,7 +577,7 @@ class TestACLplugin(VppTestCase): self.vapi.acl_interface_set_acl_list(sw_if_index=self.pg0.sw_if_index, n_input=0, acls=[second_acl]) - reply = self.vapi.acl_del(acl_index=second_acl, expected_retval=-1) + reply = self.vapi.acl_del(acl_index=second_acl, expected_retval=-143) # Unapply the ACL and then try to delete it - must be ok self.vapi.acl_interface_set_acl_list(sw_if_index=self.pg0.sw_if_index, n_input=0, @@ -590,7 +588,7 @@ class TestACLplugin(VppTestCase): self.vapi.acl_interface_set_acl_list(sw_if_index=self.pg0.sw_if_index, n_input=1, acls=[first_acl], - expected_retval=-1) + expected_retval=-6) self.logger.info("ACLP_TEST_FINISH_0001")