acl: API cleanup
[vpp.git] / src / plugins / acl / test / test_acl_plugin.py
index 8cac81c..d5e195f 100644 (file)
@@ -490,8 +490,7 @@ class TestACLplugin(VppTestCase):
 
         self.logger.info("ACLP_TEST_START_0001")
         # Create a permit-1234 ACL
-        r = [AclRule(is_permit=1, proto=17, ports=1234)]
-        r[0].sport_to = 1235
+        r = [AclRule(is_permit=1, proto=17, ports=1234, sport_to=1235)]
         # Test 1: add a new ACL
         first_acl = VppAcl(self, rules=r, tag="permit 1234")
         first_acl.add_vpp_config()
@@ -513,9 +512,8 @@ class TestACLplugin(VppTestCase):
                                  encoded_rule[rule_key])
 
         # Create a deny-1234 ACL
-        r_deny = [AclRule(is_permit=0, proto=17, ports=1234),
+        r_deny = [AclRule(is_permit=0, proto=17, ports=1234, sport_to=1235),
                   AclRule(is_permit=1, proto=17, ports=0)]
-        r_deny[0].sport_to = 1235
         second_acl = VppAcl(self, rules=r_deny, tag="deny 1234;permit all")
         second_acl.add_vpp_config()
         self.assertTrue(second_acl.query_vpp_config())