Fix scheduling with instance properties
Currently, the scheduler will ignore any properties
that are specific to the share instance. This is because
they are not passed into the scheduler filters as part of
the resource properties.
Change-Id: I8c3274e4d2779562dd8ee529473dd7cad521dbee
Closes-Bug: #1515624
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 57aec12..2ccf9b5 100644
--- a/manila_tempest_tests/services/share/v2/json/shares_client.py
+++ b/manila_tempest_tests/services/share/v2/json/shares_client.py
@@ -187,7 +187,8 @@
name=None, snapshot_id=None, description=None,
metadata=None, share_network_id=None,
share_type_id=None, is_public=False,
- consistency_group_id=None, version=LATEST_MICROVERSION):
+ consistency_group_id=None, availability_zone=None,
+ version=LATEST_MICROVERSION):
metadata = metadata or {}
if name is None:
name = data_utils.rand_name("tempest-created-share")
@@ -208,6 +209,8 @@
"is_public": is_public,
}
}
+ if availability_zone:
+ post_body["share"]["availability_zone"] = availability_zone
if share_network_id:
post_body["share"]["share_network_id"] = share_network_id
if share_type_id:
diff --git a/manila_tempest_tests/tests/api/test_shares_negative.py b/manila_tempest_tests/tests/api/test_shares_negative.py
index ae57a5f..ec8ac3b 100644
--- a/manila_tempest_tests/tests/api/test_shares_negative.py
+++ b/manila_tempest_tests/tests/api/test_shares_negative.py
@@ -114,6 +114,12 @@
self.shares_client.create_share, size=0)
@test.attr(type=["negative", "gate", ])
+ def test_create_share_non_existent_az(self):
+ self.assertRaises(lib_exc.NotFound,
+ self.shares_v2_client.create_share,
+ availability_zone='fake_az')
+
+ @test.attr(type=["negative", "gate", ])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_try_delete_share_with_existing_snapshot(self):