diff --git a/manila_tempest_tests/tests/api/admin/test_share_servers_migration.py b/manila_tempest_tests/tests/api/admin/test_share_servers_migration.py
index 99d712c..2535745 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_servers_migration.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_servers_migration.py
@@ -95,14 +95,11 @@
         # protocols.
         access_rules = self._get_access_rule_data_for_protocols()
         for rule in access_rules:
-            self.shares_v2_client.create_access_rule(
+            self.allow_access(
                 share['id'], access_type=rule.get('access_type'),
                 access_to=rule.get('access_to'),
                 access_level=rule.get('access_level')
             )
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, share['id'], constants.RULE_STATE_ACTIVE,
-            status_attr='access_rules_status')
 
         share = self.shares_v2_client.get_share(share['id'])['share']
 
@@ -124,8 +121,8 @@
             self.assertIn(snapshot['status'], statuses)
 
     def _validate_share_server_migration_complete(
-        self, share, dest_host, dest_server_id, snapshot_id=None,
-        share_network_id=None, version=CONF.share.max_api_microversion):
+            self, share, dest_host, dest_server_id, snapshot_id=None,
+            share_network_id=None, version=CONF.share.max_api_microversion):
         """Validates the share server migration complete. """
 
         # Check the export locations
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index d5cc439..34f8e41 100755
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -58,6 +58,8 @@
     r"(?=.*\[.*\b(%(p)s|%(n)s)\b.*\])(?=.*\[.*\b(%(a)s|%(b)s|%(ab)s)\b.*\])" %
     TAGS_MAPPER)
 
+LATEST_MICROVERSION = CONF.share.max_api_microversion
+
 
 def verify_test_has_appropriate_tags(self):
     if not TAGS_PATTERN.match(self.id()):
@@ -1046,7 +1048,8 @@
         return waiters.wait_for_message(self.shares_v2_client, share['id'])
 
     def allow_access(self, share_id, client=None, access_type=None,
-                     access_level='rw', access_to=None, status='active',
+                     access_level='rw', access_to=None, metadata=None,
+                     version=LATEST_MICROVERSION, status='active',
                      raise_rule_in_error_state=True, cleanup=True):
 
         client = client or self.shares_v2_client
@@ -1054,15 +1057,23 @@
         access_type = access_type or a_type
         access_to = access_to or a_to
 
-        rule = client.create_access_rule(share_id, access_type, access_to,
-                                         access_level)['access']
+        kwargs = {
+            'access_type': access_type,
+            'access_to': access_to,
+            'access_level': access_level
+        }
+        if client is self.shares_v2_client:
+            kwargs.update({'metadata': metadata, 'version': version})
+
+        rule = client.create_access_rule(share_id, **kwargs)['access']
         waiters.wait_for_resource_status(
             client, share_id, status, resource_name='access_rule',
-            rule_id=rule['id'],
+            rule_id=rule['id'], version=version,
             raise_rule_in_error_state=raise_rule_in_error_state)
         if cleanup:
-            self.addCleanup(client.wait_for_resource_deletion,
-                            rule_id=rule['id'], share_id=share_id)
+            self.addCleanup(
+                client.wait_for_resource_deletion, rule_id=rule['id'],
+                share_id=share_id, version=version)
             self.addCleanup(client.delete_access_rule, share_id, rule['id'])
         return rule
 
diff --git a/manila_tempest_tests/tests/api/test_access_rules_metadata.py b/manila_tempest_tests/tests/api/test_access_rules_metadata.py
index f218b8f..ee541ac 100644
--- a/manila_tempest_tests/tests/api/test_access_rules_metadata.py
+++ b/manila_tempest_tests/tests/api/test_access_rules_metadata.py
@@ -87,13 +87,10 @@
     def test_set_get_delete_access_metadata(self):
         data = {"key1": "v" * 255, "k" * 255: "value2"}
         # set metadata
-        access = self.shares_v2_client.create_access_rule(
-            self.share["id"], self.access_type,
-            self.access_to[self.access_type].pop(), 'rw',
-            metadata=data)['access']
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.share["id"], "active",
-            resource_name='access_rule', rule_id=access["id"])
+        access = self.allow_access(
+            self.share["id"], access_type=self.access_type,
+            access_to=self.access_to[self.access_type].pop(),
+            access_level='rw', metadata=data)
 
         # read metadata
         get_access = self.shares_v2_client.get_access_rule(
@@ -110,10 +107,6 @@
         access_without_md = self.shares_v2_client.get_access_rule(
             access["id"])['access']
         self.assertEqual({}, access_without_md['metadata'])
-        self.shares_v2_client.delete_access_rule(self.share["id"],
-                                                 access["id"])
-        self.shares_v2_client.wait_for_resource_deletion(
-            rule_id=access["id"], share_id=self.share["id"])
 
     @decorators.idempotent_id('8c294d7d-0702-49ce-b964-0945ec323370')
     @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
@@ -136,13 +129,10 @@
     def test_list_access_filter_by_metadata(self):
         data = {"key3": "v3", "key4": "value4"}
         # set metadata
-        access = self.shares_v2_client.create_access_rule(
-            self.share["id"], self.access_type,
-            self.access_to[self.access_type].pop(), 'rw',
-            metadata=data)['access']
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.share["id"], "active",
-            resource_name='access_rule', rule_id=access["id"])
+        access = self.allow_access(
+            self.share["id"], access_type=self.access_type,
+            access_to=self.access_to[self.access_type].pop(),
+            access_level='rw', metadata=data)
 
         # list metadata with metadata filter
         list_access = self.shares_v2_client.list_access_rules(
diff --git a/manila_tempest_tests/tests/api/test_replication.py b/manila_tempest_tests/tests/api/test_replication.py
index 20ba8fe..7873926 100644
--- a/manila_tempest_tests/tests/api/test_replication.py
+++ b/manila_tempest_tests/tests/api/test_replication.py
@@ -331,12 +331,9 @@
     def test_add_access_rule_create_replica_delete_rule(self):
         # Add access rule to the share
         access_type, access_to = self._get_access_rule_data_from_config()
-        rule = self.shares_v2_client.create_access_rule(
-            self.shares[0]["id"], access_type, access_to, 'ro')['access']
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.shares[0]["id"],
-            constants.RULE_STATE_ACTIVE, resource_name='access_rule',
-            rule_id=rule["id"])
+        self.allow_access(
+            self.shares[0]["id"], access_type=access_type, access_to=access_to,
+            access_level='ro')
 
         # Create the replica
         self._verify_create_replica()
@@ -346,12 +343,6 @@
             self.shares_v2_client, self.shares[0]["id"],
             constants.RULE_STATE_ACTIVE, status_attr='access_rules_status')
 
-        # Delete rule and wait for deletion
-        self.shares_v2_client.delete_access_rule(self.shares[0]["id"],
-                                                 rule["id"])
-        self.shares_v2_client.wait_for_resource_deletion(
-            rule_id=rule["id"], share_id=self.shares[0]['id'])
-
     @decorators.idempotent_id('3af3f19a-1195-464e-870b-1a3918914f1b')
     @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
     def test_create_replica_add_access_rule_delete_replica(self):
@@ -360,12 +351,9 @@
         share_replica = self._verify_create_replica()
 
         # Add access rule
-        self.shares_v2_client.create_access_rule(
-            self.shares[0]["id"], access_type, access_to, 'ro')
-
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.shares[0]["id"],
-            constants.RULE_STATE_ACTIVE, status_attr='access_rules_status')
+        self.allow_access(
+            self.shares[0]["id"], access_type=access_type, access_to=access_to,
+            access_level='ro')
 
         # Delete the replica
         self.delete_share_replica(share_replica["id"])
@@ -421,11 +409,9 @@
         share = self.create_shares([self.creation_data])[0]
         # Add access rule
         access_type, access_to = self._get_access_rule_data_from_config()
-        rule = self.shares_v2_client.create_access_rule(
-            share["id"], access_type, access_to, 'ro')['access']
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, share["id"], constants.RULE_STATE_ACTIVE,
-            resource_name='access_rule', rule_id=rule["id"])
+        self.allow_access(
+            share["id"], access_type=access_type, access_to=access_to,
+            access_level='ro')
 
         original_replica = self.shares_v2_client.list_share_replicas(
             share["id"])['share_replicas'][0]
diff --git a/manila_tempest_tests/tests/api/test_rules.py b/manila_tempest_tests/tests/api/test_rules.py
index 0128534..979bf06 100644
--- a/manila_tempest_tests/tests/api/test_rules.py
+++ b/manila_tempest_tests/tests/api/test_rules.py
@@ -22,7 +22,6 @@
 import testtools
 from testtools import testcase as tc
 
-from manila_tempest_tests.common import waiters
 from manila_tempest_tests.tests.api import base
 from manila_tempest_tests import utils
 
@@ -37,13 +36,14 @@
     :param self: instance of test class
     """
 
-    if utils.is_microversion_eq(version, '1.0'):
-        rule = self.shares_client.create_access_rule(
-            self.share["id"], self.access_type, self.access_to, 'ro')['access']
+    if utils.is_microversion_le(version, '2.9'):
+        client = self.shares_client
     else:
-        rule = self.shares_v2_client.create_access_rule(
-            self.share["id"], self.access_type, self.access_to, 'ro',
-            version=version)['access']
+        client = self.shares_v2_client
+
+    rule = self.allow_access(
+        self.share["id"], client=client, access_type=self.access_type,
+        access_to=self.access_to, access_level='ro', version=version)
 
     self.assertEqual('ro', rule['access_level'])
     for key in ('deleted', 'deleted_at', 'instance_mappings'):
@@ -55,14 +55,6 @@
     else:
         self.assertEqual("queued_to_apply", rule['state'])
 
-    if utils.is_microversion_le(version, '2.9'):
-        waiters.wait_for_resource_status(
-            self.shares_client, self.share["id"], "active",
-            resource_name='access_rule', rule_id=rule["id"])
-    else:
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.share["id"], "active",
-            status_attr='access_rules_status', version=version)
         # If the 'access_rules_status' transitions to 'active',
         # rule state must too
         rules = self.shares_v2_client.list_access_rules(
@@ -70,16 +62,6 @@
         rule = [r for r in rules if r['id'] == rule['id']][0]
         self.assertEqual("active", rule['state'])
 
-    if utils.is_microversion_eq(version, '1.0'):
-        self.shares_client.delete_access_rule(self.share["id"], rule["id"])
-        self.shares_client.wait_for_resource_deletion(
-            rule_id=rule["id"], share_id=self.share['id'])
-    else:
-        self.shares_v2_client.delete_access_rule(
-            self.share["id"], rule["id"], version=version)
-        self.shares_v2_client.wait_for_resource_deletion(
-            rule_id=rule["id"], share_id=self.share['id'], version=version)
-
 
 @ddt.ddt
 class ShareIpRulesForNFSTest(base.BaseSharesMixedTest):
@@ -123,14 +105,16 @@
             access_to = utils.rand_ip()
         else:
             access_to = utils.rand_ipv6_ip()
-        # create rule
-        if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                self.share["id"], self.access_type, access_to)['access']
+
+        if utils.is_microversion_le(version, '2.9'):
+            client = self.shares_client
         else:
-            rule = self.shares_v2_client.create_access_rule(
-                self.share["id"], self.access_type, access_to,
-                version=version)['access']
+            client = self.shares_v2_client
+
+        # create rule
+        rule = self.allow_access(
+            self.share["id"], client=client, access_type=self.access_type,
+            access_to=access_to, version=version)
 
         self.assertEqual('rw', rule['access_level'])
         for key in ('deleted', 'deleted_at', 'instance_mappings'):
@@ -142,30 +126,6 @@
         else:
             self.assertEqual("queued_to_apply", rule['state'])
 
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                status_attr='access_rules_status', version=version)
-
-        # delete rule and wait for deletion
-        if utils.is_microversion_eq(version, '1.0'):
-            self.shares_client.delete_access_rule(self.share["id"], rule["id"])
-            self.shares_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'])
-        else:
-            self.shares_v2_client.delete_access_rule(
-                self.share["id"], rule["id"], version=version)
-            self.shares_v2_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'], version=version)
-
     @decorators.idempotent_id('5d25168a-d646-443e-8cf1-3151eb7887f5')
     @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
     @ddt.data(*itertools.chain(
@@ -181,49 +141,19 @@
             access_to = utils.rand_ip(network=True)
         else:
             access_to = utils.rand_ipv6_ip(network=True)
-        # create rule
-        if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                self.share["id"], self.access_type, access_to)['access']
+        if utils.is_microversion_le(version, '2.9'):
+            client = self.shares_client
         else:
-            rule = self.shares_v2_client.create_access_rule(
-                self.share["id"], self.access_type, access_to,
-                version=version)['access']
+            client = self.shares_v2_client
+        # create rule
+        rule = self.allow_access(
+            self.share["id"], client=client, access_type=self.access_type,
+            access_to=access_to, version=version)
 
         for key in ('deleted', 'deleted_at', 'instance_mappings'):
             self.assertNotIn(key, rule.keys())
         self.assertEqual('rw', rule['access_level'])
 
-        # rules must start out in 'new' until 2.28 & 'queued_to_apply' after
-        if utils.is_microversion_le(version, "2.27"):
-            self.assertEqual("new", rule['state'])
-        else:
-            self.assertEqual("queued_to_apply", rule['state'])
-
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                status_attr='access_rules_status', version=version)
-
-        # delete rule and wait for deletion
-        if utils.is_microversion_eq(version, '1.0'):
-            self.shares_client.delete_access_rule(self.share["id"], rule["id"])
-            self.shares_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'])
-        else:
-            self.shares_v2_client.delete_access_rule(
-                self.share["id"], rule["id"], version=version)
-            self.shares_v2_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'], version=version)
-
     @decorators.idempotent_id('187a4fb0-ba1d-45b9-83c9-f0272e7e6f3e')
     @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
     @testtools.skipIf(
@@ -283,15 +213,15 @@
     @ddt.data(*utils.deduplicate(['1.0', '2.9', '2.27', '2.28',
                                  LATEST_MICROVERSION]))
     def test_create_delete_user_rule(self, version):
+        if utils.is_microversion_le(version, '2.9'):
+            client = self.shares_client
+        else:
+            client = self.shares_v2_client
 
         # create rule
-        if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                self.share["id"], self.access_type, self.access_to)['access']
-        else:
-            rule = self.shares_v2_client.create_access_rule(
-                self.share["id"], self.access_type, self.access_to,
-                version=version)['access']
+        rule = self.allow_access(
+            self.share["id"], client=client, access_type=self.access_type,
+            access_to=self.access_to, version=version)
 
         self.assertEqual('rw', rule['access_level'])
         for key in ('deleted', 'deleted_at', 'instance_mappings'):
@@ -303,30 +233,6 @@
         else:
             self.assertEqual("queued_to_apply", rule['state'])
 
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                status_attr='access_rules_status', version=version)
-
-        # delete rule and wait for deletion
-        if utils.is_microversion_eq(version, '1.0'):
-            self.shares_client.delete_access_rule(self.share["id"], rule["id"])
-            self.shares_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'])
-        else:
-            self.shares_v2_client.delete_access_rule(
-                self.share["id"], rule["id"], version=version)
-            self.shares_v2_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'], version=version)
-
     @decorators.idempotent_id('ccb08342-b7ef-4dda-84ba-8de9879d8862')
     @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
     @testtools.skipIf(
@@ -387,15 +293,15 @@
     @ddt.data(*utils.deduplicate(['1.0', '2.9', '2.27', '2.28',
                                  LATEST_MICROVERSION]))
     def test_create_delete_cert_rule(self, version):
+        if utils.is_microversion_le(version, '2.9'):
+            client = self.shares_client
+        else:
+            client = self.shares_v2_client
 
         # create rule
-        if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                self.share["id"], self.access_type, self.access_to)['access']
-        else:
-            rule = self.shares_v2_client.create_access_rule(
-                self.share["id"], self.access_type, self.access_to,
-                version=version)['access']
+        rule = self.allow_access(
+            self.share["id"], client=client, access_type=self.access_type,
+            access_to=self.access_to, version=version)
 
         self.assertEqual('rw', rule['access_level'])
         for key in ('deleted', 'deleted_at', 'instance_mappings'):
@@ -407,30 +313,6 @@
         else:
             self.assertEqual("queued_to_apply", rule['state'])
 
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                status_attr='access_rules_status', version=version)
-
-        # delete rule
-        if utils.is_microversion_eq(version, '1.0'):
-            self.shares_client.delete_access_rule(self.share["id"], rule["id"])
-            self.shares_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'])
-        else:
-            self.shares_v2_client.delete_access_rule(
-                self.share["id"], rule["id"], version=version)
-            self.shares_v2_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'], version=version)
-
     @decorators.idempotent_id('cdd93d8e-7255-4ed4-8ef0-929a62bb302c')
     @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
     @testtools.skipIf(
@@ -439,13 +321,13 @@
     @ddt.data(*utils.deduplicate(['1.0', '2.9', '2.27', '2.28',
                                  LATEST_MICROVERSION]))
     def test_create_delete_cert_ro_access_rule(self, version):
-        if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                self.share["id"], 'cert', 'client2.com', 'ro')['access']
+        if utils.is_microversion_le(version, '2.9'):
+            client = self.shares_client
         else:
-            rule = self.shares_v2_client.create_access_rule(
-                self.share["id"], 'cert', 'client2.com', 'ro',
-                version=version)['access']
+            client = self.shares_v2_client
+        rule = self.allow_access(
+            self.share["id"], client=client, access_type='cert',
+            access_to='client2.com', access_level='ro', version=version)
 
         self.assertEqual('ro', rule['access_level'])
         for key in ('deleted', 'deleted_at', 'instance_mappings'):
@@ -457,29 +339,6 @@
         else:
             self.assertEqual("queued_to_apply", rule['state'])
 
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                status_attr='access_rules_status', version=version)
-
-        if utils.is_microversion_eq(version, '1.0'):
-            self.shares_client.delete_access_rule(self.share["id"], rule["id"])
-            self.shares_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'])
-        else:
-            self.shares_v2_client.delete_access_rule(
-                self.share["id"], rule["id"], version=version)
-            self.shares_v2_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'], version=version)
-
 
 @ddt.ddt
 class ShareCephxRulesForCephFSTest(base.BaseSharesMixedTest):
@@ -518,31 +377,21 @@
         ('rw', 'ro')))
     @ddt.unpack
     def test_create_delete_cephx_rule(self, version, access_to, access_level):
-        rule = self.shares_v2_client.create_access_rule(
-            self.share["id"], self.access_type, access_to, version=version,
-            access_level=access_level)['access']
+        rule = self.allow_access(
+            self.share["id"], access_type=self.access_type,
+            access_to=access_to, version=version, access_level=access_level)
 
         self.assertEqual(access_level, rule['access_level'])
         for key in ('deleted', 'deleted_at', 'instance_mappings'):
             self.assertNotIn(key, rule.keys())
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.share["id"], "active",
-            resource_name='access_rule', rule_id=rule["id"])
-
-        self.shares_v2_client.delete_access_rule(
-            self.share["id"], rule["id"], version=version)
-        self.shares_v2_client.wait_for_resource_deletion(
-            rule_id=rule["id"], share_id=self.share['id'])
 
     @decorators.idempotent_id('ad907303-a439-4fcb-8845-fe91ecab7dc2')
     @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
     def test_different_users_in_same_tenant_can_use_same_cephx_id(self):
         # Grant access to the share
-        access1 = self.shares_v2_client.create_access_rule(
-            self.share['id'], self.access_type, self.access_to, 'rw')['access']
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.share["id"], "active",
-            resource_name='access_rule', rule_id=access1["id"])
+        self.allow_access(
+            self.share['id'], access_type=self.access_type,
+            access_to=self.access_to, access_level='rw')
 
         # Create a new user in the current project
         project = self.os_admin.projects_client.show_project(
@@ -556,11 +405,10 @@
 
         # Grant access to the second share using the same cephx ID that was
         # used in access1
-        access2 = user_client.shares_v2_client.create_access_rule(
-            share2['id'], self.access_type, self.access_to, 'rw')['access']
-        waiters.wait_for_resource_status(
-            user_client.shares_v2_client, share2['id'], "active",
-            resource_name='access_rule', rule_id=access2['id'])
+        self.allow_access(
+            share2['id'], client=user_client.shares_v2_client,
+            access_type=self.access_type, access_to=self.access_to,
+            access_level='rw')
 
 
 @ddt.ddt
@@ -612,14 +460,14 @@
         metadata = None
         if utils.is_microversion_ge(version, '2.45'):
             metadata = {'key1': 'v1', 'key2': 'v2'}
-        # create rule
-        if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                self.share["id"], self.access_type, self.access_to)['access']
+        if utils.is_microversion_le(version, '2.9'):
+            client = self.shares_client
         else:
-            rule = self.shares_v2_client.create_access_rule(
-                self.share["id"], self.access_type, self.access_to,
-                metadata=metadata, version=version)['access']
+            client = self.shares_v2_client
+        # create rule
+        rule = self.allow_access(
+            self.share["id"], client=client, access_type=self.access_type,
+            access_to=self.access_to, metadata=metadata, version=version)
 
         # verify added rule keys since 2.33 when create rule
         if utils.is_microversion_ge(version, '2.33'):
@@ -635,19 +483,6 @@
         else:
             self.assertEqual("queued_to_apply", rule['state'])
 
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name="access_rule", rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name="access_rule", rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                status_attr='access_rules_status', version=version)
-
         # list rules
         if utils.is_microversion_eq(version, '1.0'):
             rules = self.shares_client.list_access_rules(
@@ -684,16 +519,6 @@
         msg = "expected id lists %s times in rule list" % (len(gen))
         self.assertEqual(1, len(gen), msg)
 
-        if utils.is_microversion_eq(version, '1.0'):
-            self.shares_client.delete_access_rule(self.share["id"], rule["id"])
-            self.shares_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'])
-        else:
-            self.shares_v2_client.delete_access_rule(
-                self.share["id"], rule["id"], version=version)
-            self.shares_v2_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share['id'], version=version)
-
     @decorators.idempotent_id('b77bcbda-9754-48f0-9be6-79341ad1af64')
     @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
     @ddt.data(*utils.deduplicate(['1.0', '2.9', '2.27', '2.28',
@@ -704,18 +529,18 @@
             msg = ("API version %s does not support cephx access type, need "
                    "version >= 2.13." % version)
             raise self.skipException(msg)
+        if utils.is_microversion_le(version, '2.9'):
+            client = self.shares_client
+        else:
+            client = self.shares_v2_client
 
         # create share
         share = self.create_share(share_type_id=self.share_type_id)
 
         # create rule
-        if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                share["id"], self.access_type, self.access_to)['access']
-        else:
-            rule = self.shares_v2_client.create_access_rule(
-                share["id"], self.access_type, self.access_to,
-                version=version)['access']
+        rule = self.allow_access(
+            share["id"], client=client, access_type=self.access_type,
+            access_to=self.access_to, version=version, cleanup=False)
 
         # rules must start out in 'new' until 2.28 & 'queued_to_apply' after
         if utils.is_microversion_le(version, "2.27"):
@@ -723,19 +548,6 @@
         else:
             self.assertEqual("queued_to_apply", rule['state'])
 
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name="access_rule", rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name="access_rule", rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, share["id"], "active",
-                status_attr='access_rules_status', version=version)
-
         # delete share
         if utils.is_microversion_eq(version, '1.0'):
             self.shares_client.delete_share(share['id'])
diff --git a/manila_tempest_tests/tests/api/test_rules_negative.py b/manila_tempest_tests/tests/api/test_rules_negative.py
index 5225651..1eb858d 100644
--- a/manila_tempest_tests/tests/api/test_rules_negative.py
+++ b/manila_tempest_tests/tests/api/test_rules_negative.py
@@ -99,27 +99,15 @@
         access_type = "ip"
         access_to = "1.2.3.4"
 
-        # create rule
         if utils.is_microversion_eq(version, '1.0'):
-            rule = self.shares_client.create_access_rule(
-                self.share["id"], access_type, access_to)['access']
+            client = self.shares_client
         else:
-            rule = self.shares_v2_client.create_access_rule(
-                self.share["id"], access_type, access_to,
-                version=version)['access']
+            client = self.shares_v2_client
 
-        if utils.is_microversion_eq(version, '1.0'):
-            waiters.wait_for_resource_status(
-                self.shares_client, self.share["id"], "active",
-                resource_name='access_rule', rule_id=rule["id"])
-        elif utils.is_microversion_eq(version, '2.9'):
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                resource_name="access_rule", rule_id=rule["id"])
-        else:
-            waiters.wait_for_resource_status(
-                self.shares_v2_client, self.share["id"], "active",
-                status_attr='access_rules_status', version=version)
+        # create rule
+        self.allow_access(
+            self.share["id"], client=client, access_type=access_type,
+            access_to=access_to, version=version)
 
         # try create duplicate of rule
         if utils.is_microversion_eq(version, '1.0'):
@@ -132,18 +120,6 @@
                               self.share["id"], access_type, access_to,
                               version=version)
 
-        # delete rule and wait for deletion
-        if utils.is_microversion_eq(version, '1.0'):
-            self.shares_client.delete_access_rule(self.share["id"],
-                                                  rule["id"])
-            self.shares_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share["id"])
-        else:
-            self.shares_v2_client.delete_access_rule(self.share["id"],
-                                                     rule["id"])
-            self.shares_v2_client.wait_for_resource_deletion(
-                rule_id=rule["id"], share_id=self.share["id"], version=version)
-
     @decorators.idempotent_id('63932d1d-a60a-4af7-ba3b-7cf6c68aaee9')
     @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
     @ddt.data("10.20.30.40", "fd8c:b029:bba6:ac54::1",
@@ -157,13 +133,8 @@
                       "is %s" % CONF.share.max_api_microversion)
             raise self.skipException(reason)
 
-        rule = self.shares_v2_client.create_access_rule(
-            self.share["id"], "ip", access_to)['access']
-        self.addCleanup(self.shares_v2_client.delete_access_rule,
-                        self.share["id"], rule['id'])
-        waiters.wait_for_resource_status(
-            self.shares_v2_client, self.share["id"], "active",
-            status_attr='access_rules_status')
+        self.allow_access(
+            self.share["id"], access_type="ip", access_to=access_to)
 
         self.assertRaises(lib_exc.BadRequest,
                           self.shares_v2_client.create_access_rule,
