Esempio n. 1
0
 def _obtain_client_config_data(self, non_admin=True, region_name=None):
     cloud_args = {
         'username': '******',
         'password': '******',
         'project_name': 'cloud_project',
         'auth_url': 'http://auth.url.com/'
     }
     if region_name:
         cloud_args.update(region_name=region_name)
     # create an empty conf
     conf = tempest_conf.TempestConf()
     conf.set('identity', 'uri', cloud_args['auth_url'], priority=True)
     # call the function and check if data were obtained properly
     tool.set_cloud_config_values(non_admin, cloud_args, conf)
     if non_admin:
         self.assertEqual(cloud_args['username'],
                          conf.get('identity', 'username'))
         self.assertEqual(cloud_args['password'],
                          conf.get('identity', 'password'))
         self.assertEqual(cloud_args['project_name'],
                          conf.get('identity', 'project_name'))
     else:
         self.assertEqual(cloud_args['username'],
                          conf.get('auth', 'admin_username'))
         self.assertEqual(cloud_args['password'],
                          conf.get('auth', 'admin_password'))
         self.assertEqual(cloud_args['project_name'],
                          conf.get('auth', 'admin_project_name'))
     if region_name:
         self.assertEqual(cloud_args['region_name'],
                          conf.get('identity', 'region'))
 def setUp(self):
     super(TestObjectStorageService, self).setUp()
     self.Service = ObjectStorageService("ServiceName",
                                         "ServiceType",
                                         self.FAKE_URL,
                                         self.FAKE_TOKEN,
                                         disable_ssl_validation=False)
     self.Service.conf = tempest_conf.TempestConf()
 def _get_alt_conf(self, V2, V3):
     """Contains newer params in place of the deprecated params"""
     conf = tempest_conf.TempestConf()
     uri = "http://172.16.52.151:5000/"
     conf.set("identity", "username", "demo")
     conf.set("identity", "password", "secret")
     conf.set("identity", "project_name", "demo")
     conf.set("identity", "disable_ssl_certificate_validation", "true")
     conf.set("identity", "auth_version", "v3")
     conf.set("identity", "uri", uri + V2, priority=True)
     conf.set("identity", "uri_v3", uri + V3)
     conf.set("auth", "admin_username", "admin")
     conf.set("auth", "admin_project_name", "adminProject")
     conf.set("auth", "admin_password", "adminPass")
     conf.set("auth", "use_dynamic_credentials", "True", priority=True)
     return conf
 def _get_conf(self, V2, V3):
     """Creates fake conf for testing purposes"""
     conf = tempest_conf.TempestConf()
     uri = "http://172.16.52.151:5000/"
     conf.set("identity", "username", "demo")
     conf.set("identity", "password", "secret")
     conf.set("identity", "project_name", "demo")
     conf.set("identity", "disable_ssl_certificate_validation", "true")
     conf.set("identity", "auth_version", "v3")
     conf.set("identity", "uri", uri + V2, priority=True)
     conf.set("identity", "uri_v3", uri + V3)
     conf.set("auth", "admin_username", "admin")
     conf.set("auth", "admin_project_name", "adminProject")
     conf.set("auth", "admin_password", "adminPass")
     conf.set("auth", "use_dynamic_credentials", "False", priority=True)
     return conf
 def setUp(self):
     super(TestTempestConf, self).setUp()
     self.conf = tempest_conf.TempestConf()