Fix test_encryption_vol_type to take admin creds from conf

Heat integration test test_encryption_vol_type will not work in environments
where admin user is named differently or does not have the same password as
that of the demo user.

The admin credentials is now made available via heat_integrationtests.conf.
The tests which require admin privileges should be run only if admin
credentials are available and use the same.

Change-Id: I5f329be6d4c4249763e0aec8696fb87605a0812a
Closes-Bug: #1546993
diff --git a/common/config.py b/common/config.py
index 39c0846..6d35600 100644
--- a/common/config.py
+++ b/common/config.py
@@ -21,10 +21,15 @@
 
     cfg.StrOpt('username',
                default=os.environ.get('OS_USERNAME'),
-               help="Username to use for API requests."),
+               help="Username to use for non admin API requests."),
     cfg.StrOpt('password',
                default=os.environ.get('OS_PASSWORD'),
-               help="API key to use when authenticating.",
+               help="Non admin API key to use when authenticating.",
+               secret=True),
+    cfg.StrOpt('admin_username',
+               help="Username to use for admin API requests."),
+    cfg.StrOpt('admin_password',
+               help="Admin API key to use when authentication.",
                secret=True),
     cfg.StrOpt('tenant_name',
                default=(os.environ.get('OS_PROJECT_NAME') or
diff --git a/functional/test_encryption_vol_type.py b/functional/test_encryption_vol_type.py
index e1a3e76..2679990 100644
--- a/functional/test_encryption_vol_type.py
+++ b/functional/test_encryption_vol_type.py
@@ -42,11 +42,14 @@
 class EncryptionVolTypeTest(functional_base.FunctionalTestsBase):
     def setUp(self):
         super(EncryptionVolTypeTest, self).setUp()
+        if not self.conf.admin_username or not self.conf.admin_password:
+            self.skipTest('No admin creds found, skipping')
         self.conf = config.init_conf()
         # cinder security policy usage of volume type is limited
         # to being used by administrators only.
-        # Temporarily set username as admin for this test case.
-        self.conf.username = 'admin'
+        # Temporarily switch to admin
+        self.conf.username = self.conf.admin_username
+        self.conf.password = self.conf.admin_password
         self.manager = clients.ClientManager(self.conf)
         self.client = self.manager.orchestration_client
         self.volume_client = self.manager.volume_client