Tolerate set_admin_password not implemented.

Allow skipping of password test if this action
is not implemented by the virt driver.

New variable was added to devstack gate in https://review.openstack.org/#/c/10215/1

This will allow the following nova patch to be gated:

https://review.openstack.org/10130

Change-Id: I0ebd34c74bd6a4f0a31fb29f38acdbf060c64617
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 25d8b09..31dd902 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -93,6 +93,9 @@
 # Cluster: the 'nova' user must have scp access between cluster nodes
 resize_available = true
 
+# Does the compute API support changing the admin password?
+change_password_available=true
+
 # Level to log Compute API request/response details.
 log_level = ERROR
 
diff --git a/etc/tempest.conf.tpl b/etc/tempest.conf.tpl
index e6a3891..480d74b 100644
--- a/etc/tempest.conf.tpl
+++ b/etc/tempest.conf.tpl
@@ -72,6 +72,9 @@
 # Cluster: the 'nova' user must have scp access between cluster nodes
 resize_available = %COMPUTE_RESIZE_AVAILABLE%
 
+# Does the compute API support changing the admin password?
+change_password_available = %COMPUTE_CHANGE_PASSWORD_AVAILABLE%
+
 # Level to log Compute API request/response details.
 log_level = %COMPUTE_LOG_LEVEL%
 
diff --git a/tempest/config.py b/tempest/config.py
index 4906c4c..7d18974 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -180,6 +180,12 @@
         return self.get("resize_available", 'false').lower() != 'false'
 
     @property
+    def change_password_available(self):
+        """Does the test environment support changing the admin password?"""
+        return self.get("change_password_available", 'false').lower() != \
+            'false'
+
+    @property
     def create_image_enabled(self):
         """Does the test environment support snapshots?"""
         return self.get("create_image_enabled", 'false').lower() != 'false'
diff --git a/tempest/tests/compute/__init__.py b/tempest/tests/compute/__init__.py
index e196bd5..2fe8c21 100644
--- a/tempest/tests/compute/__init__.py
+++ b/tempest/tests/compute/__init__.py
@@ -27,6 +27,7 @@
 CONFIG = config.TempestConfig()
 CREATE_IMAGE_ENABLED = CONFIG.compute.create_image_enabled
 RESIZE_AVAILABLE = CONFIG.compute.resize_available
+CHANGE_PASSWORD_AVAILABLE = CONFIG.compute.change_password_available
 DISK_CONFIG_ENABLED = False
 FLAVOR_EXTRA_DATA_ENABLED = False
 MULTI_USER = False
diff --git a/tempest/tests/compute/test_server_actions.py b/tempest/tests/compute/test_server_actions.py
index 047c791..c51e0fa 100644
--- a/tempest/tests/compute/test_server_actions.py
+++ b/tempest/tests/compute/test_server_actions.py
@@ -25,6 +25,7 @@
 from tempest import exceptions
 from tempest.common.utils.data_utils import rand_name
 from tempest.tests.compute.base import BaseComputeTest
+from tempest.tests import compute
 
 
 class ServerActionsTest(BaseComputeTest):
@@ -49,6 +50,8 @@
         self.client.delete_server(self.server_id)
 
     @attr(type='smoke')
+    @unittest.skipUnless(compute.CHANGE_PASSWORD_AVAILABLE,
+                         'Change password not available.')
     def test_change_server_password(self):
         """The server's password should be set to the provided password"""
         resp, body = self.client.change_password(self.server_id, 'newpass')