Merge "Introduce an API test for specified floating ip address"
diff --git a/neutron/tests/tempest/auth.py b/neutron/tests/tempest/auth.py
index fc43597..a9fdb03 100644
--- a/neutron/tests/tempest/auth.py
+++ b/neutron/tests/tempest/auth.py
@@ -20,14 +20,11 @@
 import re
 import urlparse
 
-from oslo_log import log as logging
 import six
 
 from tempest_lib.services.identity.v2 import token_client as json_v2id
 from tempest_lib.services.identity.v3 import token_client as json_v3id
 
-LOG = logging.getLogger(__name__)
-
 
 @six.add_metaclass(abc.ABCMeta)
 class AuthProvider(object):
diff --git a/neutron/tests/tempest/common/accounts.py b/neutron/tests/tempest/common/accounts.py
index 1a50e3c..6440739 100644
--- a/neutron/tests/tempest/common/accounts.py
+++ b/neutron/tests/tempest/common/accounts.py
@@ -28,8 +28,8 @@
 
 
 def read_accounts_yaml(path):
-    yaml_file = open(path, 'r')
-    accounts = yaml.load(yaml_file)
+    with open(path, 'r') as yaml_file:
+        accounts = yaml.load(yaml_file)
     return accounts
 
 
diff --git a/neutron/tests/tempest/common/cred_provider.py b/neutron/tests/tempest/common/cred_provider.py
index 07fa89f..b90d09d 100644
--- a/neutron/tests/tempest/common/cred_provider.py
+++ b/neutron/tests/tempest/common/cred_provider.py
@@ -14,7 +14,6 @@
 
 import abc
 
-from oslo_log import log as logging
 import six
 
 from neutron.tests.tempest import auth
@@ -22,7 +21,6 @@
 from neutron.tests.tempest import exceptions
 
 CONF = config.CONF
-LOG = logging.getLogger(__name__)
 
 # Type of credentials available from configuration
 CREDENTIAL_TYPES = {
diff --git a/neutron/tests/tempest/common/credentials.py b/neutron/tests/tempest/common/credentials.py
index 9ae6ee8..9dfdff0 100644
--- a/neutron/tests/tempest/common/credentials.py
+++ b/neutron/tests/tempest/common/credentials.py
@@ -45,7 +45,7 @@
 
 # We want a helper function here to check and see if admin credentials
 # are available so we can do a single call from skip_checks if admin
-# creds area vailable.
+# creds are available.
 def is_admin_available():
     is_admin = True
     # If tenant isolation is enabled admin will be available
diff --git a/neutron/tests/tempest/common/generator/base_generator.py b/neutron/tests/tempest/common/generator/base_generator.py
index 6db3f24..41ed48c 100644
--- a/neutron/tests/tempest/common/generator/base_generator.py
+++ b/neutron/tests/tempest/common/generator/base_generator.py
@@ -19,10 +19,6 @@
 import jsonschema
 import six
 
-from oslo_log import log as logging
-
-LOG = logging.getLogger(__name__)
-
 
 def _check_for_expected_result(name, schema):
     expected_result = None
diff --git a/neutron/tests/tempest/common/generator/negative_generator.py b/neutron/tests/tempest/common/generator/negative_generator.py
index ba8884f..44cd305 100644
--- a/neutron/tests/tempest/common/generator/negative_generator.py
+++ b/neutron/tests/tempest/common/generator/negative_generator.py
@@ -15,13 +15,9 @@
 
 import copy
 
-from oslo_log import log as logging
-
 import neutron.tests.tempest.common.generator.base_generator as base
 import neutron.tests.tempest.common.generator.valid_generator as valid
 
-LOG = logging.getLogger(__name__)
-
 
 class NegativeTestGenerator(base.BasicGeneratorSet):
     @base.generator_type("string")
diff --git a/neutron/tests/tempest/common/generator/valid_generator.py b/neutron/tests/tempest/common/generator/valid_generator.py
index 2698200..bc7014c 100644
--- a/neutron/tests/tempest/common/generator/valid_generator.py
+++ b/neutron/tests/tempest/common/generator/valid_generator.py
@@ -13,15 +13,11 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from oslo_log import log as logging
 import six
 
 import neutron.tests.tempest.common.generator.base_generator as base
 
 
-LOG = logging.getLogger(__name__)
-
-
 class ValidTestGenerator(base.BasicGeneratorSet):
     @base.generator_type("string")
     @base.simple_generator
diff --git a/neutron/tests/tempest/common/isolated_creds.py b/neutron/tests/tempest/common/isolated_creds.py
index 5da24a9..163ce8a 100644
--- a/neutron/tests/tempest/common/isolated_creds.py
+++ b/neutron/tests/tempest/common/isolated_creds.py
@@ -297,7 +297,7 @@
             new_index = str(roles) + '-' + str(len(self.isolated_creds))
             self.isolated_creds[new_index] = exist_creds
             del self.isolated_creds[str(roles)]
-            # Handle isolated neutron resouces if they exist too
+            # Handle isolated neutron resources if they exist too
             if CONF.service_available.neutron:
                 exist_net = self.isolated_net_resources.get(str(roles))
                 if exist_net:
diff --git a/neutron/tests/tempest/common/waiters.py b/neutron/tests/tempest/common/waiters.py
index 7d97d5d..caa9b37 100644
--- a/neutron/tests/tempest/common/waiters.py
+++ b/neutron/tests/tempest/common/waiters.py
@@ -50,7 +50,7 @@
                     return
                 # NOTE(afazekas): The instance is in "ready for action state"
                 # when no task in progress
-                # NOTE(afazekas): Converted to string bacuse of the XML
+                # NOTE(afazekas): Converted to string because of the XML
                 # responses
                 if str(task_state) == "None":
                     # without state api extension 3 sec usually enough
diff --git a/neutron/tests/tempest/config.py b/neutron/tests/tempest/config.py
index 4b35d92..06fd541 100644
--- a/neutron/tests/tempest/config.py
+++ b/neutron/tests/tempest/config.py
@@ -59,7 +59,19 @@
                      "number of concurrent test processes."),
     cfg.ListOpt('tempest_roles',
                 help="Roles to assign to all users created by tempest",
-                default=[])
+                default=[]),
+    cfg.StrOpt('admin_username',
+               help="Administrative Username to use for "
+                    "Keystone API requests."),
+    cfg.StrOpt('admin_tenant_name',
+               help="Administrative Tenant name to use for Keystone API "
+                    "requests."),
+    cfg.StrOpt('admin_password',
+               help="API key to use when authenticating as admin.",
+               secret=True),
+    cfg.StrOpt('admin_domain_name',
+               help="Admin domain name for authentication (Keystone V3)."
+                    "The same domain applies to user and project"),
 ]
 
 identity_group = cfg.OptGroup(name='identity',
@@ -73,7 +85,6 @@
                 default=False,
                 help="Set to True if using self-signed SSL certificates."),
     cfg.StrOpt('ca_certificates_file',
-               default=None,
                help='Specify a CA bundle file to use in verifying a '
                     'TLS (https) server certificate.'),
     cfg.StrOpt('uri',
@@ -120,18 +131,6 @@
     cfg.StrOpt('alt_domain_name',
                help="Alternate domain name for authentication (Keystone V3)."
                     "The same domain applies to user and project"),
-    cfg.StrOpt('admin_username',
-               help="Administrative Username to use for "
-                    "Keystone API requests."),
-    cfg.StrOpt('admin_tenant_name',
-               help="Administrative Tenant name to use for Keystone API "
-                    "requests."),
-    cfg.StrOpt('admin_password',
-               help="API key to use when authenticating as admin.",
-               secret=True),
-    cfg.StrOpt('admin_domain_name',
-               help="Admin domain name for authentication (Keystone V3)."
-                    "The same domain applies to user and project"),
 ]
 
 identity_feature_group = cfg.OptGroup(name='identity-feature-enabled',
@@ -1153,6 +1152,18 @@
         self.input_scenario = cfg.CONF['input-scenario']
         self.cli = cfg.CONF.cli
         self.negative = cfg.CONF.negative
+
+        self.identity.admin_username = self.auth.admin_username
+        self.identity.admin_password = self.auth.admin_password
+        self.identity.admin_tenant_name = self.auth.admin_tenant_name
+        self.identity.admin_domain_name = self.auth.admin_domain_name
+        self.identity.password = self.auth.admin_password
+        self.identity.tenant_name = 'demo'
+        self.identity.username = 'demo'
+        self.identity.alt_username = 'alt_demo'
+        self.identity.alt_tenant_name = 'alt_demo'
+        self.identity.alt_password = self.auth.admin_password
+
         cfg.CONF.set_default('domain_name', self.identity.admin_domain_name,
                              group='identity')
         cfg.CONF.set_default('alt_domain_name',