Merge "Port admin actions extension to core API"
diff --git a/manila_tempest_tests/services/share/v2/json/shares_client.py b/manila_tempest_tests/services/share/v2/json/shares_client.py
index d3b6066..b61d526 100644
--- a/manila_tempest_tests/services/share/v2/json/shares_client.py
+++ b/manila_tempest_tests/services/share/v2/json/shares_client.py
@@ -100,7 +100,8 @@
"""Resets the state of a share, snapshot, cg, or a cgsnapshot.
status: available, error, creating, deleting, error_deleting
- s_type: shares, snapshots, consistency-groups, cgsnapshots
+ s_type: shares, share_instances, snapshots, consistency-groups,
+ cgsnapshots.
"""
body = {"os-reset_status": {"status": status}}
body = json.dumps(body)
diff --git a/manila_tempest_tests/tests/api/admin/test_admin_actions.py b/manila_tempest_tests/tests/api/admin/test_admin_actions.py
index e70fd6a..96e68e6 100644
--- a/manila_tempest_tests/tests/api/admin/test_admin_actions.py
+++ b/manila_tempest_tests/tests/api/admin/test_admin_actions.py
@@ -40,14 +40,14 @@
@test.attr(type=["gate", ])
def test_reset_share_state(self):
for status in self.states:
- self.shares_client.reset_state(self.sh["id"], status=status)
- self.shares_client.wait_for_share_status(self.sh["id"], status)
+ self.shares_v2_client.reset_state(self.sh["id"], status=status)
+ self.shares_v2_client.wait_for_share_status(self.sh["id"], status)
@test.attr(type=["gate", ])
def test_reset_share_instance_state(self):
id = self.sh_instance["id"]
for status in self.states:
- self.shares_client.reset_state(
+ self.shares_v2_client.reset_state(
id, s_type="share_instances", status=status)
self.shares_v2_client.wait_for_share_instance_status(id, status)
@@ -56,24 +56,25 @@
"Snapshot tests are disabled.")
def test_reset_snapshot_state_to_error(self):
for status in self.states:
- self.shares_client.reset_state(
+ self.shares_v2_client.reset_state(
self.sn["id"], s_type="snapshots", status=status)
- self.shares_client.wait_for_snapshot_status(self.sn["id"], status)
+ self.shares_v2_client.wait_for_snapshot_status(
+ self.sn["id"], status)
@test.attr(type=["gate", ])
def test_force_delete_share(self):
share = self.create_share()
# Change status from 'available' to 'error_deleting'
- self.shares_client.reset_state(share["id"], status=self.bad_status)
+ self.shares_v2_client.reset_state(share["id"], status=self.bad_status)
# Check that status was changed
- check_status = self.shares_client.get_share(share["id"])
+ check_status = self.shares_v2_client.get_share(share["id"])
self.assertEqual(check_status["status"], self.bad_status)
# Share with status 'error_deleting' should be deleted
- self.shares_client.force_delete(share["id"])
- self.shares_client.wait_for_resource_deletion(share_id=share["id"])
+ self.shares_v2_client.force_delete(share["id"])
+ self.shares_v2_client.wait_for_resource_deletion(share_id=share["id"])
@test.attr(type=["gate", ])
def test_force_delete_share_instance(self):
@@ -85,7 +86,7 @@
instance = instances[0]
# Change status from 'available' to 'error_deleting'
- self.shares_client.reset_state(
+ self.shares_v2_client.reset_state(
instance["id"], s_type="share_instances", status=self.bad_status)
# Check that status was changed
@@ -93,7 +94,7 @@
self.assertEqual(self.bad_status, check_status["status"])
# Share with status 'error_deleting' should be deleted
- self.shares_client.force_delete(
+ self.shares_v2_client.force_delete(
instance["id"], s_type="share_instances")
self.shares_v2_client.wait_for_resource_deletion(
share_instance_id=instance["id"])
@@ -105,13 +106,13 @@
sn = self.create_snapshot_wait_for_active(self.sh["id"])
# Change status from 'available' to 'error_deleting'
- self.shares_client.reset_state(
+ self.shares_v2_client.reset_state(
sn["id"], s_type="snapshots", status=self.bad_status)
# Check that status was changed
- check_status = self.shares_client.get_snapshot(sn["id"])
+ check_status = self.shares_v2_client.get_snapshot(sn["id"])
self.assertEqual(check_status["status"], self.bad_status)
# Snapshot with status 'error_deleting' should be deleted
- self.shares_client.force_delete(sn["id"], s_type="snapshots")
- self.shares_client.wait_for_resource_deletion(snapshot_id=sn["id"])
+ self.shares_v2_client.force_delete(sn["id"], s_type="snapshots")
+ self.shares_v2_client.wait_for_resource_deletion(snapshot_id=sn["id"])
diff --git a/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py b/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py
index d25dc75..a1ff4f7 100644
--- a/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py
+++ b/manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py
@@ -45,7 +45,7 @@
@test.attr(type=["gate", "negative", ])
def test_reset_nonexistent_share_instance_state(self):
- self.assertRaises(lib_exc.NotFound, self.shares_client.reset_state,
+ self.assertRaises(lib_exc.NotFound, self.shares_v2_client.reset_state,
"fake", s_type="share_instances")
@test.attr(type=["gate", "negative", ])
@@ -65,7 +65,7 @@
def test_reset_share_instance_state_to_unacceptable_state(self):
self.assertRaises(
lib_exc.BadRequest,
- self.shares_client.reset_state,
+ self.shares_v2_client.reset_state,
self.sh_instance["id"],
s_type="share_instances",
status="fake"
@@ -90,7 +90,7 @@
def test_try_reset_share_instance_state_with_member(self):
# Even if member from another tenant, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
- self.member_shares_client.reset_state,
+ self.member_shares_v2_client.reset_state,
self.sh_instance["id"], s_type="share_instances")
@test.attr(type=["gate", "negative", ])
@@ -110,7 +110,7 @@
@test.attr(type=["gate", "negative", ])
def test_force_delete_nonexistent_share_instance(self):
self.assertRaises(lib_exc.NotFound,
- self.shares_client.force_delete,
+ self.shares_v2_client.force_delete,
"fake",
s_type="share_instances")
@@ -134,7 +134,7 @@
def test_try_force_delete_share_instance_with_member(self):
# If a non-admin tries to do force_delete, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
- self.member_shares_client.force_delete,
+ self.member_shares_v2_client.force_delete,
self.sh_instance["id"], s_type="share_instances")
@test.attr(type=["gate", "negative", ])