Merge "remove swift cli tests"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 1010ba5..2a72635 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -802,6 +802,10 @@
 # attributes ipv6_ra_mode and ipv6_address_mode (boolean value)
 #ipv6_subnet_attributes = false
 
+# Does the test environment support changing port admin state (boolean
+# value)
+#port_admin_state_change = true
+
 
 [object-storage]
 
diff --git a/tempest/api/messaging/base.py b/tempest/api/messaging/base.py
index b3ed941..c4214f2 100644
--- a/tempest/api/messaging/base.py
+++ b/tempest/api/messaging/base.py
@@ -71,7 +71,7 @@
     @classmethod
     def check_queue_exists(cls, queue_name):
         """Wrapper utility that checks the existence of a test queue."""
-        resp, body = cls.client.get_queue(queue_name)
+        resp, body = cls.client.show_queue(queue_name)
         return resp, body
 
     @classmethod
@@ -89,13 +89,13 @@
     @classmethod
     def get_queue_stats(cls, queue_name):
         """Wrapper utility that returns the queue stats."""
-        resp, body = cls.client.get_queue_stats(queue_name)
+        resp, body = cls.client.show_queue_stats(queue_name)
         return resp, body
 
     @classmethod
     def get_queue_metadata(cls, queue_name):
         """Wrapper utility that gets a queue metadata."""
-        resp, body = cls.client.get_queue_metadata(queue_name)
+        resp, body = cls.client.show_queue_metadata(queue_name)
         return resp, body
 
     @classmethod
@@ -121,14 +121,14 @@
     @classmethod
     def get_single_message(cls, message_uri):
         """Wrapper utility that gets a single message."""
-        resp, body = cls.client.get_single_message(message_uri)
+        resp, body = cls.client.show_single_message(message_uri)
 
         return resp, body
 
     @classmethod
     def get_multiple_messages(cls, message_uri):
         """Wrapper utility that gets multiple messages."""
-        resp, body = cls.client.get_multiple_messages(message_uri)
+        resp, body = cls.client.show_multiple_messages(message_uri)
 
         return resp, body
 
diff --git a/tempest/api/messaging/test_messages.py b/tempest/api/messaging/test_messages.py
index f982f59..c8640b3 100644
--- a/tempest/api/messaging/test_messages.py
+++ b/tempest/api/messaging/test_messages.py
@@ -49,7 +49,7 @@
 
         # Get on the posted messages
         message_uri = resp['location']
-        resp, _ = self.client.get_multiple_messages(message_uri)
+        resp, _ = self.client.show_multiple_messages(message_uri)
         # The test has an assertion here, because the response cannot be 204
         # in this case (the client allows 200 or 204 for this API call).
         self.assertEqual('200', resp['status'])
@@ -74,7 +74,7 @@
         message_uri = body['resources'][0]
 
         # Get posted message
-        resp, _ = self.client.get_single_message(message_uri)
+        resp, _ = self.client.show_single_message(message_uri)
         # The test has an assertion here, because the response cannot be 204
         # in this case (the client allows 200 or 204 for this API call).
         self.assertEqual('200', resp['status'])
@@ -87,7 +87,7 @@
         message_uri = resp['location']
 
         # Get posted messages
-        resp, _ = self.client.get_multiple_messages(message_uri)
+        resp, _ = self.client.show_multiple_messages(message_uri)
         # The test has an assertion here, because the response cannot be 204
         # in this case (the client allows 200 or 204 for this API call).
         self.assertEqual('200', resp['status'])
@@ -103,7 +103,7 @@
         self.client.delete_messages(message_uri)
 
         message_uri = message_uri.replace('/messages/', '/messages?ids=')
-        resp, _ = self.client.get_multiple_messages(message_uri)
+        resp, _ = self.client.show_multiple_messages(message_uri)
         # The test has an assertion here, because the response has to be 204
         # in this case (the client allows 200 or 204 for this API call).
         self.assertEqual('204', resp['status'])
@@ -117,7 +117,7 @@
 
         # Delete multiple messages
         self.client.delete_messages(message_uri)
-        resp, _ = self.client.get_multiple_messages(message_uri)
+        resp, _ = self.client.show_multiple_messages(message_uri)
         # The test has an assertion here, because the response has to be 204
         # in this case (the client allows 200 or 204 for this API call).
         self.assertEqual('204', resp['status'])
diff --git a/tempest/api/messaging/test_queues.py b/tempest/api/messaging/test_queues.py
index c444e0b..2dac346 100644
--- a/tempest/api/messaging/test_queues.py
+++ b/tempest/api/messaging/test_queues.py
@@ -44,7 +44,7 @@
 
         self.delete_queue(queue_name)
         self.assertRaises(lib_exc.NotFound,
-                          self.client.get_queue,
+                          self.client.show_queue,
                           queue_name)
 
 
diff --git a/tempest/config.py b/tempest/config.py
index 6b8113e..bcbe41f 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -506,6 +506,10 @@
                      "the extended IPv6 attributes ipv6_ra_mode "
                      "and ipv6_address_mode"
                 ),
+    cfg.BoolOpt('port_admin_state_change',
+                default=True,
+                help="Does the test environment support changing"
+                     " port admin state"),
 ]
 
 messaging_group = cfg.OptGroup(name='messaging',
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
index 0d17048..8f37d74 100644
--- a/tempest/scenario/test_load_balancer_basic.py
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -185,7 +185,7 @@
             # Start netcat
             start_server = ('while true; do '
                             'sudo nc -ll -p %(port)s -e sh /tmp/%(script)s; '
-                            'done &')
+                            'done > /dev/null &')
             cmd = start_server % {'port': self.port1,
                                   'script': 'script1'}
             ssh_client.exec_command(cmd)
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index 2c9e845..b97ad0b 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -590,6 +590,9 @@
     @testtools.skipIf(CONF.baremetal.driver_enabled,
                       'admin_state of instance ports cannot be altered '
                       'for baremetal nodes')
+    @testtools.skipUnless(CONF.network_feature_enabled.port_admin_state_change,
+                          "Changing a port's admin state is not supported "
+                          "by the test environment")
     @test.attr(type='smoke')
     @test.services('compute', 'network')
     def test_update_instance_port_admin_state(self):
@@ -653,22 +656,3 @@
         self.assertEqual(self.network['id'], port['network_id'])
         self.assertEqual('', port['device_id'])
         self.assertEqual('', port['device_owner'])
-
-    @test.idempotent_id('51641c7d-119a-44cd-aac6-b5b9f86dd808')
-    @test.services('compute', 'network')
-    def test_creation_of_server_attached_to_user_created_port(self):
-        self.security_group = (
-            self._create_security_group(tenant_id=self.tenant_id))
-        network, subnet, router = self.create_networks()
-        kwargs = {
-            'security_groups': [self.security_group['id']],
-        }
-
-        port = self._create_port(network.id, **kwargs)
-        name = data_utils.rand_name('server-smoke')
-        server = self._create_server(name, network, port.id)
-        self._check_tenant_network_connectivity()
-        floating_ip = self.create_floating_ip(server)
-        self.floating_ip_tuple = Floating_IP_tuple(floating_ip, server)
-        self.check_public_network_connectivity(
-            should_connect=True)
diff --git a/tempest/services/messaging/json/messaging_client.py b/tempest/services/messaging/json/messaging_client.py
index 36444a9..483ba93 100644
--- a/tempest/services/messaging/json/messaging_client.py
+++ b/tempest/services/messaging/json/messaging_client.py
@@ -58,7 +58,7 @@
         self.expected_success(201, resp.status)
         return resp, body
 
-    def get_queue(self, queue_name):
+    def show_queue(self, queue_name):
         uri = '{0}/queues/{1}'.format(self.uri_prefix, queue_name)
         resp, body = self.get(uri)
         self.expected_success(204, resp.status)
@@ -76,14 +76,14 @@
         self.expected_success(204, resp.status)
         return resp, body
 
-    def get_queue_stats(self, queue_name):
+    def show_queue_stats(self, queue_name):
         uri = '{0}/queues/{1}/stats'.format(self.uri_prefix, queue_name)
         resp, body = self.get(uri)
         body = json.loads(body)
         self.validate_response(queues_schema.queue_stats, resp, body)
         return resp, body
 
-    def get_queue_metadata(self, queue_name):
+    def show_queue_metadata(self, queue_name):
         uri = '{0}/queues/{1}/metadata'.format(self.uri_prefix, queue_name)
         resp, body = self.get(uri)
         self.expected_success(200, resp.status)
@@ -117,7 +117,7 @@
 
         return resp, body
 
-    def get_single_message(self, message_uri):
+    def show_single_message(self, message_uri):
         resp, body = self.get(message_uri, extra_headers=True,
                               headers=self.headers)
         if resp['status'] != '204':
@@ -126,7 +126,7 @@
                                    body)
         return resp, body
 
-    def get_multiple_messages(self, message_uri):
+    def show_multiple_messages(self, message_uri):
         resp, body = self.get(message_uri, extra_headers=True,
                               headers=self.headers)
 
diff --git a/tempest/tests/common/test_accounts.py b/tempest/tests/common/test_accounts.py
index b176675..b4048ba 100644
--- a/tempest/tests/common/test_accounts.py
+++ b/tempest/tests/common/test_accounts.py
@@ -68,13 +68,8 @@
              'password': 'p', 'roles': [cfg.CONF.identity.admin_role]},
             {'username': 'test_user12', 'tenant_name': 'test_tenant12',
              'password': 'p', 'roles': [cfg.CONF.identity.admin_role]},
-            {'username': 'test_user13', 'tenant_name': 'test_tenant13',
-             'password': 'p', 'resources': {'network': 'network-1'}},
-            {'username': 'test_user14', 'tenant_name': 'test_tenant14',
-             'password': 'p', 'roles': ['role-7', 'role-11'],
-             'resources': {'network': 'network-2'}},
         ]
-        self.useFixture(mockpatch.Patch(
+        self.accounts_mock = self.useFixture(mockpatch.Patch(
             'tempest.common.accounts.read_accounts_yaml',
             return_value=self.test_accounts))
         cfg.CONF.set_default('test_accounts_file', 'fake_path', group='auth')
@@ -281,14 +276,22 @@
         calls = get_free_hash_mock.mock.mock_calls
         self.assertEqual(len(calls), 1)
         args = calls[0][1][0]
-        self.assertEqual(len(args), 12)
+        self.assertEqual(len(args), 10)
         for i in admin_hashes:
             self.assertNotIn(i, args)
 
     def test_networks_returned_with_creds(self):
+        test_accounts = [
+            {'username': 'test_user13', 'tenant_name': 'test_tenant13',
+             'password': 'p', 'resources': {'network': 'network-1'}},
+            {'username': 'test_user14', 'tenant_name': 'test_tenant14',
+             'password': 'p', 'roles': ['role-7', 'role-11'],
+             'resources': {'network': 'network-2'}}]
+        # Clear previous mock using self.test_accounts
+        self.accounts_mock.cleanUp()
         self.useFixture(mockpatch.Patch(
             'tempest.common.accounts.read_accounts_yaml',
-            return_value=self.test_accounts))
+            return_value=test_accounts))
         test_accounts_class = accounts.Accounts('v2', 'test_name')
         with mock.patch('tempest.services.compute.json.networks_client.'
                         'NetworksClientJSON.list_networks',