Browse Source

Merge "Fix Tempest tests targeting user based access rules"

tags/1.0.0.0b3
Jenkins 3 years ago
parent
commit
5871b47093
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      contrib/tempest/tempest/api/share/test_rules.py

+ 5
- 5
contrib/tempest/tempest/api/share/test_rules.py View File

@@ -29,7 +29,7 @@ def _create_delete_ro_access_rule(self):
29 29
     :param self: instance of test class
30 30
     """
31 31
     rule = self.shares_client.create_access_rule(
32
-        self.share["id"], 'ip', '2.2.2.2', 'ro')
32
+        self.share["id"], self.access_type, self.access_to, 'ro')
33 33
     self.assertEqual('ro', rule['access_level'])
34 34
     self.shares_client.wait_for_access_rule_status(
35 35
         self.share["id"], rule["id"], "active")
@@ -47,17 +47,18 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest):
47 47
             msg = "IP rule tests for %s protocol are disabled" % cls.protocol
48 48
             raise cls.skipException(msg)
49 49
         cls.share = cls.create_share(cls.protocol)
50
+        cls.access_type = "ip"
51
+        cls.access_to = "2.2.2.2"
50 52
 
51 53
     @test.attr(type=["gate", ])
52 54
     def test_create_delete_access_rules_with_one_ip(self):
53 55
 
54 56
         # test data
55
-        access_type = "ip"
56 57
         access_to = "1.1.1.1"
57 58
 
58 59
         # create rule
59 60
         rule = self.shares_client.create_access_rule(
60
-            self.share["id"], access_type, access_to)
61
+            self.share["id"], self.access_type, access_to)
61 62
         self.assertEqual('rw', rule['access_level'])
62 63
         self.shares_client.wait_for_access_rule_status(
63 64
             self.share["id"], rule["id"], "active")
@@ -69,12 +70,11 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest):
69 70
     def test_create_delete_access_rule_with_cidr(self):
70 71
 
71 72
         # test data
72
-        access_type = "ip"
73 73
         access_to = "1.2.3.4/32"
74 74
 
75 75
         # create rule
76 76
         rule = self.shares_client.create_access_rule(
77
-            self.share["id"], access_type, access_to)
77
+            self.share["id"], self.access_type, access_to)
78 78
         self.assertEqual('rw', rule['access_level'])
79 79
         self.shares_client.wait_for_access_rule_status(
80 80
             self.share["id"], rule["id"], "active")

Loading…
Cancel
Save