Merge "Expanded assertion in test_create_token for keystone v2, v3"
diff --git a/tempest/api/network/test_networks_negative.py b/tempest/api/network/test_networks_negative.py
index 520342e..0dd8cb7 100644
--- a/tempest/api/network/test_networks_negative.py
+++ b/tempest/api/network/test_networks_negative.py
@@ -57,3 +57,17 @@
         non_exist_id = data_utils.rand_name('network')
         self.assertRaises(lib_exc.NotFound, self.client.delete_network,
                           non_exist_id)
+
+    @test.attr(type=['negative'])
+    @test.idempotent_id('1cc47884-ac52-4415-a31c-e7ce5474a868')
+    def test_update_non_existent_subnet(self):
+        non_exist_id = data_utils.rand_uuid()
+        self.assertRaises(lib_exc.NotFound, self.client.update_subnet,
+                          non_exist_id, name='new_name')
+
+    @test.attr(type=['negative'])
+    @test.idempotent_id('a176c859-99fb-42ec-a208-8a85b552a239')
+    def test_delete_non_existent_subnet(self):
+        non_exist_id = data_utils.rand_uuid()
+        self.assertRaises(lib_exc.NotFound,
+                          self.client.delete_subnet, non_exist_id)
diff --git a/tempest/api_schema/response/compute/v2_1/fixed_ips.py b/tempest/api_schema/response/compute/v2_1/fixed_ips.py
index 6d5ba67..3586b70 100644
--- a/tempest/api_schema/response/compute/v2_1/fixed_ips.py
+++ b/tempest/api_schema/response/compute/v2_1/fixed_ips.py
@@ -12,6 +12,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest.api_schema.response.compute.v2_1 import parameter_types
+
 get_fixed_ip = {
     'status_code': [200],
     'response_body': {
@@ -20,10 +22,7 @@
             'fixed_ip': {
                 'type': 'object',
                 'properties': {
-                    'address': {
-                        'type': 'string',
-                        'format': 'ip-address'
-                    },
+                    'address': parameter_types.ip_address,
                     'cidr': {'type': 'string'},
                     'host': {'type': 'string'},
                     'hostname': {'type': 'string'}
diff --git a/tempest/api_schema/response/compute/v2_1/floating_ips.py b/tempest/api_schema/response/compute/v2_1/floating_ips.py
index 28dd40a..3551681 100644
--- a/tempest/api_schema/response/compute/v2_1/floating_ips.py
+++ b/tempest/api_schema/response/compute/v2_1/floating_ips.py
@@ -12,6 +12,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest.api_schema.response.compute.v2_1 import parameter_types
+
 common_floating_ip_info = {
     'type': 'object',
     'properties': {
@@ -21,14 +23,8 @@
         'id': {'type': ['integer', 'string']},
         'pool': {'type': ['string', 'null']},
         'instance_id': {'type': ['string', 'null']},
-        'ip': {
-            'type': 'string',
-            'format': 'ip-address'
-        },
-        'fixed_ip': {
-            'type': ['string', 'null'],
-            'format': 'ip-address'
-        }
+        'ip': parameter_types.ip_address,
+        'fixed_ip': parameter_types.ip_address
     },
     'additionalProperties': False,
     'required': ['id', 'pool', 'instance_id',
@@ -131,18 +127,12 @@
                 'items': {
                     'type': 'object',
                     'properties': {
-                        'address': {
-                            'type': 'string',
-                            'format': 'ip-address'
-                        },
+                        'address': parameter_types.ip_address,
                         'instance_uuid': {'type': ['string', 'null']},
                         'interface': {'type': ['string', 'null']},
                         'pool': {'type': ['string', 'null']},
                         'project_id': {'type': ['string', 'null']},
-                        'fixed_ip': {
-                            'type': ['string', 'null'],
-                            'format': 'ip-address'
-                        }
+                        'fixed_ip': parameter_types.ip_address
                     },
                     'additionalProperties': False,
                     # NOTE: fixed_ip is introduced after JUNO release,
diff --git a/tempest/api_schema/response/compute/v2_1/hypervisors.py b/tempest/api_schema/response/compute/v2_1/hypervisors.py
index e24389d..05901b6 100644
--- a/tempest/api_schema/response/compute/v2_1/hypervisors.py
+++ b/tempest/api_schema/response/compute/v2_1/hypervisors.py
@@ -14,6 +14,8 @@
 
 import copy
 
+from tempest.api_schema.response.compute.v2_1 import parameter_types
+
 get_hypervisor_statistics = {
     'status_code': [200],
     'response_body': {
@@ -57,10 +59,7 @@
         'cpu_info': {'type': 'string'},
         'current_workload': {'type': 'integer'},
         'disk_available_least': {'type': ['integer', 'null']},
-        'host_ip': {
-            'type': 'string',
-            'format': 'ip-address'
-        },
+        'host_ip': parameter_types.ip_address,
         'free_disk_gb': {'type': 'integer'},
         'free_ram_mb': {'type': 'integer'},
         'hypervisor_hostname': {'type': 'string'},
diff --git a/tempest/api_schema/response/compute/v2_1/interfaces.py b/tempest/api_schema/response/compute/v2_1/interfaces.py
index b18fba6..130775b 100644
--- a/tempest/api_schema/response/compute/v2_1/interfaces.py
+++ b/tempest/api_schema/response/compute/v2_1/interfaces.py
@@ -27,10 +27,7 @@
                         'type': 'string',
                         'format': 'uuid'
                     },
-                    'ip_address': {
-                        'type': 'string',
-                        'format': 'ipv4'
-                    }
+                    'ip_address': parameter_types.ip_address
                 },
                 'additionalProperties': False,
                 'required': ['subnet_id', 'ip_address']
diff --git a/tempest/api_schema/response/compute/v2_1/parameter_types.py b/tempest/api_schema/response/compute/v2_1/parameter_types.py
index 7b4264c..07cc890 100644
--- a/tempest/api_schema/response/compute/v2_1/parameter_types.py
+++ b/tempest/api_schema/response/compute/v2_1/parameter_types.py
@@ -33,14 +33,27 @@
     'pattern': '(?:[a-f0-9]{2}:){5}[a-f0-9]{2}'
 }
 
+ip_address = {
+    'oneOf': [
+        {
+            'type': 'string',
+            'oneOf': [
+                {'format': 'ipv4'},
+                {'format': 'ipv6'}
+            ]
+        },
+        {'type': 'null'}
+    ]
+}
+
 access_ip_v4 = {
     'type': 'string',
-    'anyOf': [{'format': 'ipv4'}, {'enum': ['']}]
+    'oneOf': [{'format': 'ipv4'}, {'enum': ['']}]
 }
 
 access_ip_v6 = {
     'type': 'string',
-    'anyOf': [{'format': 'ipv6'}, {'enum': ['']}]
+    'oneOf': [{'format': 'ipv6'}, {'enum': ['']}]
 }
 
 addresses = {
@@ -55,7 +68,7 @@
                     'version': {'type': 'integer'},
                     'addr': {
                         'type': 'string',
-                        'anyOf': [
+                        'oneOf': [
                             {'format': 'ipv4'},
                             {'format': 'ipv6'}
                         ]
diff --git a/tempest/scenario/test_swift_telemetry_middleware.py b/tempest/scenario/test_swift_telemetry_middleware.py
index 302ccbe..29ce1a0 100644
--- a/tempest/scenario/test_swift_telemetry_middleware.py
+++ b/tempest/scenario/test_swift_telemetry_middleware.py
@@ -74,7 +74,7 @@
             called again.
             """
             results = self.telemetry_client.list_samples(
-                'storage.api.request')
+                'storage.objects.incoming.bytes')
             LOG.debug('got samples %s', results)
 
             # Extract container info from samples.
diff --git a/tempest/test.py b/tempest/test.py
index 0d709f6c..80e61c7 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -43,7 +43,7 @@
 CONF = config.CONF
 
 
-def attr(*args, **kwargs):
+def attr(**kwargs):
     """A decorator which applies the  testtools attr decorator
 
     This decorator applies the testtools.testcase.attr if it is in the list of
@@ -98,7 +98,7 @@
     return service_list
 
 
-def services(*args, **kwargs):
+def services(*args):
     """A decorator used to set an attr for each service used in a test case
 
     This decorator applies a testtools attr for each service that gets
@@ -128,7 +128,7 @@
     return decorator
 
 
-def stresstest(*args, **kwargs):
+def stresstest(**kwargs):
     """Add stress test decorator
 
     For all functions with this decorator a attr stress will be
@@ -154,7 +154,7 @@
     return decorator
 
 
-def requires_ext(*args, **kwargs):
+def requires_ext(**kwargs):
     """A decorator to skip tests if an extension is not enabled
 
     @param extension