Comment 2 for bug 1613819

Revision history for this message
Dmitry Kudyukin (gmorfy) wrote : Re: v3 identity client has bad default domain id

I've got the same problem. even using correct default_domain_id in tempest.conf. The cause of bug is tempest don't send domain_id in request to keystone. From keystone.log:

2016-10-06 06:26:08.526 25868 INFO tempest.lib.common.rest_client [req-ce5b8019-4b93-4f54-b6f4-8c6731023b30 ] Request (UsersV3TestJSON:test_user_update): 404 POST http://192.168.1.200:55357/v3/users 0.050s
2016-10-06 06:26:08.526 25868 DEBUG tempest.lib.common.rest_client [req-ce5b8019-4b93-4f54-b6f4-8c6731023b30 ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"user": {"email": "<email address hidden>", "password": "I6~*9wqsP4gPIQI", "enabled": false, "name": "tempest-user-1809623701", "description":"tempest-user-1809623701description"}}
    Response - Headers: {'status': '404', 'content-length': '91', 'content-location': 'http://192.168.1.200:55357/v3/users', 'vary': 'X-Auth-Token', 'server': 'Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5', 'connection': 'close', 'date': 'Thu, 06 Oct 2016 06:26:08 GMT', 'content-type': 'application/json', 'x-openstack-request-id': 'req-ce5b8019-4b93-4f54-b6f4-8c6731023b30'}
        Body: {"error": {"message": "Could not find domain: default", "code": 404, "title": "Not Found"}} _log_request_full tempest/lib/common/rest_client.py:431

I suppose to tempest use of default_domain_id from config file during this request. There is my patch for tempest, that solves the problem.

diff -uNr tempest.orig/common/cred_client.py tempest/common/cred_client.py
--- tempest.orig/common/cred_client.py 2016-10-05 05:20:12.692336942 +0000
+++ tempest/common/cred_client.py 2016-10-06 06:12:03.615336942 +0000
@@ -39,11 +39,12 @@
         self.projects_client = projects_client
         self.roles_client = roles_client

- def create_user(self, username, password, project, email):
+ def create_user(self, username, password, project, email, domain_id):
         params = {'name': username,
                   'password': password,
                   self.project_id_param: project['id'],
- 'email': email}
+ 'email': email,
+ 'domain_id': domain_id}
         user = self.users_client.create_user(**params)
         if 'user' in user:
             user = user['user']
diff -uNr tempest.orig/common/dynamic_creds.py tempest/common/dynamic_creds.py
--- tempest.orig/common/dynamic_creds.py 2016-10-06 04:51:15.965337000 +0000
+++ tempest/common/dynamic_creds.py 2016-10-06 06:07:15.444336942 +0000
@@ -134,8 +134,9 @@
         username = project_name
         user_password = data_utils.rand_password()
         email = data_utils.rand_name(root) + "@example.com"
+ domain_id = CONF.identity.default_domain_id
         user = self.creds_client.create_user(
- username, user_password, project, email)
+ username, user_password, project, email, domain_id)
         role_assigned = False
         if admin:
             self.creds_client.assign_user_role(user, project, self.admin_role)