Add keystone v3 user negative cases
Implement the keystone v3 user negative case:
test_create_user_for_non_existent_domain
Change-Id: I644cfb0bea4abe2932a759ff86f446043170488d
Partial-Bug: 1513748
diff --git a/tempest/api/identity/admin/v3/test_users_negative.py b/tempest/api/identity/admin/v3/test_users_negative.py
new file mode 100644
index 0000000..ca2aaa4
--- /dev/null
+++ b/tempest/api/identity/admin/v3/test_users_negative.py
@@ -0,0 +1,35 @@
+# Copyright 2015 OpenStack Foundation
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from tempest_lib import exceptions as lib_exc
+
+from tempest.api.identity import base
+from tempest.common.utils import data_utils
+from tempest import test
+
+
+class UsersNegativeTest(base.BaseIdentityV3AdminTest):
+
+ @test.attr(type=['negative'])
+ @test.idempotent_id('e75f006c-89cc-477b-874d-588e4eab4b17')
+ def test_create_user_for_non_existent_domain(self):
+ # Attempt to create a user in a non-existent domain should fail
+ u_name = data_utils.rand_name('user')
+ u_email = u_name + '@testmail.tm'
+ u_password = data_utils.rand_name('pass')
+ self.assertRaises(lib_exc.NotFound, self.client.create_user,
+ u_name, u_password,
+ email=u_email,
+ domain_id=data_utils.rand_uuid_hex())