Merge "Remove str() calls from compute clients"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 840983c..1095e77 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -290,18 +290,10 @@
 # (integer value)
 #ping_count = 1
 
-# Timeout in seconds to wait for authentication to succeed. (integer
-# value)
-#ssh_timeout = 300
-
 # Additional wait time for clean state, when there is no OS-EXT-STS
 # extension available (integer value)
 #ready_wait = 0
 
-# Timeout in seconds to wait for output from ssh channel. (integer
-# value)
-#ssh_channel_timeout = 60
-
 # Name of the fixed network that is visible to all test tenants. If
 # multiple networks are available for a tenant this is the network
 # which will be used for creating servers if tempest does not create a
@@ -313,9 +305,6 @@
 # use_floatingip_for_ssh=true or run_validation=false. (string value)
 #network_for_ssh = public
 
-# IP version used for SSH connections. (integer value)
-#ip_version_for_ssh = 4
-
 # Does SSH use Floating IPs? (boolean value)
 #use_floatingip_for_ssh = true
 
@@ -1128,6 +1117,7 @@
 #auth_method = keypair
 
 # Default IP version for ssh connections. (integer value)
+# Deprecated group/name - [compute]/ip_version_for_ssh
 #ip_version_for_ssh = 4
 
 # Timeout in seconds to wait for ping to succeed. (integer value)
@@ -1135,9 +1125,11 @@
 
 # Timeout in seconds to wait for the TCP connection to be successful.
 # (integer value)
+# Deprecated group/name - [compute]/ssh_channel_timeout
 #connect_timeout = 60
 
 # Timeout in seconds to wait for the ssh banner. (integer value)
+# Deprecated group/name - [compute]/ssh_timeout
 #ssh_timeout = 300
 
 
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index 461097f..fa80d65 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -98,7 +98,7 @@
 
 @six.add_metaclass(abc.ABCMeta)
 class CredentialProvider(object):
-    def __init__(self, identity_version=None, name=None, password='pass',
+    def __init__(self, identity_version=None, name=None,
                  network_resources=None):
         """A CredentialProvider supplies credentials to test classes.
         :param identity_version If specified it will return credentials of the
@@ -106,12 +106,8 @@
                                 uses auth_version from configuration
         :param name Name of the calling test. Included in provisioned
                     credentials when credentials are provisioned on the fly
-        :param password Used for provisioned credentials when credentials are
-                        provisioned on the fly
         :param network_resources Network resources required for the credentials
         """
-        # TODO(andreaf) name and password are tenant isolation specific, and
-        # could be removed from this abstract class
         self.name = name or "test_creds"
         self.identity_version = identity_version or CONF.identity.auth_version
         if not auth.is_identity_version_supported(self.identity_version):
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index f3dd2e6..5999d70 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -136,14 +136,13 @@
 
 class IsolatedCreds(cred_provider.CredentialProvider):
 
-    def __init__(self, identity_version=None, name=None, password='pass',
+    def __init__(self, identity_version=None, name=None,
                  network_resources=None):
-        super(IsolatedCreds, self).__init__(identity_version, name, password,
+        super(IsolatedCreds, self).__init__(identity_version, name,
                                             network_resources)
         self.network_resources = network_resources
         self.isolated_creds = {}
         self.ports = []
-        self.password = password
         self.default_admin_creds = cred_provider.get_configured_credentials(
             'identity_admin', fill_in=True,
             identity_version=self.identity_version)
@@ -193,9 +192,10 @@
             name=project_name, description=project_desc)
 
         username = data_utils.rand_name(root) + suffix
+        user_password = data_utils.rand_password()
         email = data_utils.rand_name(root) + suffix + "@example.com"
         user = self.creds_client.create_user(
-            username, self.password, project, email)
+            username, user_password, project, email)
         if admin:
             self.creds_client.assign_user_role(user, project,
                                                CONF.identity.admin_role)
@@ -206,7 +206,7 @@
         if roles:
             for role in roles:
                 self.creds_client.assign_user_role(user, project, role)
-        creds = self.creds_client.get_credentials(user, project, self.password)
+        creds = self.creds_client.get_credentials(user, project, user_password)
         return cred_provider.TestResources(creds)
 
     def _create_network_resources(self, tenant_id):
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index d4e6eb8..6d22b9b 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -30,10 +30,10 @@
 
     # NOTE(afazekas): It should always get an address instead of server
     def __init__(self, server, username, password=None, pkey=None):
-        ssh_timeout = CONF.compute.ssh_timeout
+        ssh_timeout = CONF.validation.ssh_timeout
         network = CONF.compute.network_for_ssh
-        ip_version = CONF.compute.ip_version_for_ssh
-        ssh_channel_timeout = CONF.compute.ssh_channel_timeout
+        ip_version = CONF.validation.ip_version_for_ssh
+        connect_timeout = CONF.validation.connect_timeout
         if isinstance(server, six.string_types):
             ip_address = server
         else:
@@ -46,7 +46,7 @@
                 raise exceptions.ServerUnreachable()
         self.ssh_client = ssh.Client(ip_address, username, password,
                                      ssh_timeout, pkey=pkey,
-                                     channel_timeout=ssh_channel_timeout)
+                                     channel_timeout=connect_timeout)
 
     def exec_command(self, cmd):
         # Shell options below add more clearness on failures,
diff --git a/tempest/config.py b/tempest/config.py
index e3f9f0a..7382088 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -240,18 +240,10 @@
                default=1,
                help="The number of ping packets originating from remote "
                     "linux hosts"),
-    cfg.IntOpt('ssh_timeout',
-               default=300,
-               help="Timeout in seconds to wait for authentication to "
-                    "succeed."),
     cfg.IntOpt('ready_wait',
                default=0,
                help="Additional wait time for clean state, when there is "
                     "no OS-EXT-STS extension available"),
-    cfg.IntOpt('ssh_channel_timeout',
-               default=60,
-               help="Timeout in seconds to wait for output from ssh "
-                    "channel."),
     cfg.StrOpt('fixed_network_name',
                help="Name of the fixed network that is visible to all test "
                     "tenants. If multiple networks are available for a tenant"
@@ -263,9 +255,6 @@
                default='public',
                help="Network used for SSH connections. Ignored if "
                     "use_floatingip_for_ssh=true or run_validation=false."),
-    cfg.IntOpt('ip_version_for_ssh',
-               default=4,
-               help="IP version used for SSH connections."),
     cfg.BoolOpt('use_floatingip_for_ssh',
                 default=True,
                 help="Does SSH use Floating IPs?"),
@@ -602,17 +591,23 @@
                     'Additional methods will be handled in a separate spec.'),
     cfg.IntOpt('ip_version_for_ssh',
                default=4,
-               help='Default IP version for ssh connections.'),
+               help='Default IP version for ssh connections.',
+               deprecated_opts=[cfg.DeprecatedOpt('ip_version_for_ssh',
+                                                  group='compute')]),
     cfg.IntOpt('ping_timeout',
                default=120,
                help='Timeout in seconds to wait for ping to succeed.'),
     cfg.IntOpt('connect_timeout',
                default=60,
                help='Timeout in seconds to wait for the TCP connection to be '
-                    'successful.'),
+                    'successful.',
+               deprecated_opts=[cfg.DeprecatedOpt('ssh_channel_timeout',
+                                                  group='compute')]),
     cfg.IntOpt('ssh_timeout',
                default=300,
-               help='Timeout in seconds to wait for the ssh banner.'),
+               help='Timeout in seconds to wait for the ssh banner.',
+               deprecated_opts=[cfg.DeprecatedOpt('ssh_timeout',
+                                                  group='compute')]),
 ]
 
 volume_group = cfg.OptGroup(name='volume',
diff --git a/tempest/services/identity/v2/json/identity_client.py b/tempest/services/identity/v2/json/identity_client.py
index c5f7338..deb7605 100644
--- a/tempest/services/identity/v2/json/identity_client.py
+++ b/tempest/services/identity/v2/json/identity_client.py
@@ -17,6 +17,7 @@
 
 
 class IdentityClientJSON(service_client.ServiceClient):
+    api_version = "v2.0"
 
     def get_api_description(self):
         """Retrieves info about the v2.0 Identity API"""
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index 3506856..b92f306 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -28,9 +28,9 @@
         super(TestRemoteClient, self).setUp()
         self.useFixture(fake_config.ConfigFixture())
         self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
-        cfg.CONF.set_default('ip_version_for_ssh', 4, group='compute')
+        cfg.CONF.set_default('ip_version_for_ssh', 4, group='validation')
         cfg.CONF.set_default('network_for_ssh', 'public', group='compute')
-        cfg.CONF.set_default('ssh_channel_timeout', 1, group='compute')
+        cfg.CONF.set_default('connect_timeout', 1, group='validation')
 
         self.conn = remote_client.RemoteClient('127.0.0.1', 'user', 'pass')
         self.ssh_mock = self.useFixture(mockpatch.PatchObject(self.conn,
diff --git a/tempest/tests/test_tenant_isolation.py b/tempest/tests/test_tenant_isolation.py
index 95008a2..7fcf8d1 100644
--- a/tempest/tests/test_tenant_isolation.py
+++ b/tempest/tests/test_tenant_isolation.py
@@ -139,8 +139,7 @@
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_primary_creds(self, MockRestClient):
         cfg.CONF.set_default('neutron', False, 'service_available')
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_assign_user_role()
         self._mock_list_role()
         self._mock_tenant_create('1234', 'fake_prim_tenant')
@@ -155,8 +154,7 @@
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_admin_creds(self, MockRestClient):
         cfg.CONF.set_default('neutron', False, 'service_available')
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_list_roles('1234', 'admin')
         self._mock_user_create('1234', 'fake_admin_user')
         self._mock_tenant_create('1234', 'fake_admin_tenant')
@@ -179,8 +177,7 @@
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_role_creds(self, MockRestClient):
         cfg.CONF.set_default('neutron', False, 'service_available')
-        iso_creds = isolated_creds.IsolatedCreds('v2', 'test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds('v2', 'test class')
         self._mock_list_2_roles()
         self._mock_user_create('1234', 'fake_role_user')
         self._mock_tenant_create('1234', 'fake_role_tenant')
@@ -208,8 +205,7 @@
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_all_cred_cleanup(self, MockRestClient):
         cfg.CONF.set_default('neutron', False, 'service_available')
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_assign_user_role()
         self._mock_list_role()
         self._mock_tenant_create('1234', 'fake_prim_tenant')
@@ -249,8 +245,7 @@
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_alt_creds(self, MockRestClient):
         cfg.CONF.set_default('neutron', False, 'service_available')
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_assign_user_role()
         self._mock_list_role()
         self._mock_user_create('1234', 'fake_alt_user')
@@ -265,8 +260,7 @@
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_no_network_creation_with_config_set(self, MockRestClient):
         cfg.CONF.set_default('create_isolated_networks', False, group='auth')
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_assign_user_role()
         self._mock_list_role()
         self._mock_user_create('1234', 'fake_prim_user')
@@ -294,8 +288,7 @@
 
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_network_creation(self, MockRestClient):
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_assign_user_role()
         self._mock_list_role()
         self._mock_user_create('1234', 'fake_prim_user')
@@ -326,8 +319,7 @@
                                          "description": args['name'],
                                          "security_group_rules": [],
                                          "id": "sg-%s" % args['tenant_id']}]}
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         # Create primary tenant and network
         self._mock_assign_user_role()
         self._mock_list_role()
@@ -437,8 +429,7 @@
 
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_network_alt_creation(self, MockRestClient):
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_assign_user_role()
         self._mock_list_role()
         self._mock_user_create('1234', 'fake_alt_user')
@@ -463,8 +454,7 @@
 
     @mock.patch('tempest_lib.common.rest_client.RestClient')
     def test_network_admin_creation(self, MockRestClient):
-        iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password')
+        iso_creds = isolated_creds.IsolatedCreds(name='test class')
         self._mock_assign_user_role()
         self._mock_user_create('1234', 'fake_admin_user')
         self._mock_tenant_create('1234', 'fake_admin_tenant')
@@ -496,7 +486,6 @@
             'dhcp': False,
         }
         iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password',
                                                  network_resources=net_dict)
         self._mock_assign_user_role()
         self._mock_list_role()
@@ -532,7 +521,6 @@
             'dhcp': False,
         }
         iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password',
                                                  network_resources=net_dict)
         self._mock_assign_user_role()
         self._mock_list_role()
@@ -550,7 +538,6 @@
             'dhcp': False,
         }
         iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password',
                                                  network_resources=net_dict)
         self._mock_assign_user_role()
         self._mock_list_role()
@@ -568,7 +555,6 @@
             'dhcp': True,
         }
         iso_creds = isolated_creds.IsolatedCreds(name='test class',
-                                                 password='fake_password',
                                                  network_resources=net_dict)
         self._mock_assign_user_role()
         self._mock_list_role()