Factor up config dependent credential classes

Separate helpers methods to build credentials, credential providers and
client managers that depend on configuration. They are all moved to
the common.credentials module to achieve two objectives:
- prepare credential provider module to move to tempest-lib
- avoid circular dependencies

There are still dependencies to CONF in the credential providers,
removing all of them would make the patch too large; but there is
with this patch a single place where all relevant CONF parameters can
be looked up and passed into the credential providers.

Partially-implements: bp tempest-library
Change-Id: I351f86f0570070105bbf24f2d904e917feea6e57
diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
index 59a5523..089d9be 100644
--- a/tempest/tests/common/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -17,6 +17,7 @@
 from oslotest import mockpatch
 from tempest_lib.services.identity.v2 import token_client as json_token_client
 
+from tempest.common import credentials_factory as credentials
 from tempest.common import dynamic_creds
 from tempest.common import service_client
 from tempest import config
@@ -46,6 +47,8 @@
         cfg.CONF.set_default('operator_role', 'FakeRole',
                              group='object-storage')
         self._mock_list_ec2_credentials('fake_user_id', 'fake_tenant_id')
+        self.fixed_params.update(
+            admin_creds=self._get_fake_admin_creds())
 
     def test_tempest_client(self):
         creds = dynamic_creds.DynamicCredentialProvider(**self.fixed_params)
@@ -54,6 +57,13 @@
         self.assertTrue(isinstance(creds.network_admin_client,
                                    json_network_client.NetworkClient))
 
+    def _get_fake_admin_creds(self):
+        return credentials.get_credentials(
+            fill_in=False,
+            identity_version=self.fixed_params['identity_version'],
+            username='fake_username', password='fake_password',
+            tenant_name='fake_tenant')
+
     def _mock_user_create(self, id, name):
         user_fix = self.useFixture(mockpatch.PatchObject(
             json_iden_client.IdentityClient,