Merge "Remove duplicate _ping_ip_address() methods"
diff --git a/tempest/api/data_processing/base.py b/tempest/api/data_processing/base.py
index 65085b9..2ec1017 100644
--- a/tempest/api/data_processing/base.py
+++ b/tempest/api/data_processing/base.py
@@ -24,8 +24,8 @@
     _interface = 'json'
 
     @classmethod
-    def setUpClass(cls):
-        super(BaseDataProcessingTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(BaseDataProcessingTest, cls).resource_setup()
         if not CONF.service_available.sahara:
             raise cls.skipException('Sahara support is required')
 
@@ -43,7 +43,7 @@
         cls._jobs = []
 
     @classmethod
-    def tearDownClass(cls):
+    def resource_cleanup(cls):
         cls.cleanup_resources(getattr(cls, '_cluster_templates', []),
                               cls.client.delete_cluster_template)
         cls.cleanup_resources(getattr(cls, '_node_group_templates', []),
@@ -56,7 +56,7 @@
         cls.cleanup_resources(getattr(cls, '_data_sources', []),
                               cls.client.delete_data_source)
         cls.clear_isolated_creds()
-        super(BaseDataProcessingTest, cls).tearDownClass()
+        super(BaseDataProcessingTest, cls).resource_cleanup()
 
     @staticmethod
     def cleanup_resources(resource_id_list, method):
diff --git a/tempest/api/data_processing/test_cluster_templates.py b/tempest/api/data_processing/test_cluster_templates.py
index ff67c1c..537f90c 100644
--- a/tempest/api/data_processing/test_cluster_templates.py
+++ b/tempest/api/data_processing/test_cluster_templates.py
@@ -22,9 +22,8 @@
     sahara/restapi/rest_api_v1.0.html#cluster-templates
     """
     @classmethod
-    @test.safe_setup
-    def setUpClass(cls):
-        super(ClusterTemplateTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(ClusterTemplateTest, cls).resource_setup()
         # create node group template
         node_group_template = {
             'name': data_utils.rand_name('sahara-ng-template'),
diff --git a/tempest/api/data_processing/test_data_sources.py b/tempest/api/data_processing/test_data_sources.py
index aae56c4..3650751 100644
--- a/tempest/api/data_processing/test_data_sources.py
+++ b/tempest/api/data_processing/test_data_sources.py
@@ -19,8 +19,8 @@
 
 class DataSourceTest(dp_base.BaseDataProcessingTest):
     @classmethod
-    def setUpClass(cls):
-        super(DataSourceTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(DataSourceTest, cls).resource_setup()
         cls.swift_data_source_with_creds = {
             'url': 'swift://sahara-container.sahara/input-source',
             'description': 'Test data source',
diff --git a/tempest/api/data_processing/test_job_binaries.py b/tempest/api/data_processing/test_job_binaries.py
index 15ee145..d006991 100644
--- a/tempest/api/data_processing/test_job_binaries.py
+++ b/tempest/api/data_processing/test_job_binaries.py
@@ -22,9 +22,8 @@
     sahara/restapi/rest_api_v1.1_EDP.html#job-binaries
     """
     @classmethod
-    @test.safe_setup
-    def setUpClass(cls):
-        super(JobBinaryTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(JobBinaryTest, cls).resource_setup()
         cls.swift_job_binary_with_extra = {
             'url': 'swift://sahara-container.sahara/example.jar',
             'description': 'Test job binary',
diff --git a/tempest/api/data_processing/test_job_binary_internals.py b/tempest/api/data_processing/test_job_binary_internals.py
index 45e1140..7e99867 100644
--- a/tempest/api/data_processing/test_job_binary_internals.py
+++ b/tempest/api/data_processing/test_job_binary_internals.py
@@ -22,8 +22,8 @@
     sahara/restapi/rest_api_v1.1_EDP.html#job-binary-internals
     """
     @classmethod
-    def setUpClass(cls):
-        super(JobBinaryInternalTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(JobBinaryInternalTest, cls).resource_setup()
         cls.job_binary_internal_data = 'Some script may be data'
 
     def _create_job_binary_internal(self, binary_name=None):
diff --git a/tempest/api/data_processing/test_jobs.py b/tempest/api/data_processing/test_jobs.py
index 8591dbd..5af2eef 100644
--- a/tempest/api/data_processing/test_jobs.py
+++ b/tempest/api/data_processing/test_jobs.py
@@ -22,9 +22,8 @@
     sahara/restapi/rest_api_v1.1_EDP.html#jobs
     """
     @classmethod
-    @test.safe_setup
-    def setUpClass(cls):
-        super(JobTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(JobTest, cls).resource_setup()
         # create job binary
         job_binary = {
             'name': data_utils.rand_name('sahara-job-binary'),
diff --git a/tempest/api/data_processing/test_node_group_templates.py b/tempest/api/data_processing/test_node_group_templates.py
index c2c0075..f3f59fc 100644
--- a/tempest/api/data_processing/test_node_group_templates.py
+++ b/tempest/api/data_processing/test_node_group_templates.py
@@ -19,8 +19,8 @@
 
 class NodeGroupTemplateTest(dp_base.BaseDataProcessingTest):
     @classmethod
-    def setUpClass(cls):
-        super(NodeGroupTemplateTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(NodeGroupTemplateTest, cls).resource_setup()
         cls.node_group_template = {
             'description': 'Test node group template',
             'plugin_name': 'vanilla',
diff --git a/tempest/api/database/base.py b/tempest/api/database/base.py
index 6e0f431..c9f16ca 100644
--- a/tempest/api/database/base.py
+++ b/tempest/api/database/base.py
@@ -27,8 +27,8 @@
     _interface = 'json'
 
     @classmethod
-    def setUpClass(cls):
-        super(BaseDatabaseTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(BaseDatabaseTest, cls).resource_setup()
         if not CONF.service_available.trove:
             skip_msg = ("%s skipped as trove is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py
index a5c8caa..aed1abe 100644
--- a/tempest/api/database/flavors/test_flavors.py
+++ b/tempest/api/database/flavors/test_flavors.py
@@ -20,8 +20,8 @@
 class DatabaseFlavorsTest(base.BaseDatabaseTest):
 
     @classmethod
-    def setUpClass(cls):
-        super(DatabaseFlavorsTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(DatabaseFlavorsTest, cls).resource_setup()
         cls.client = cls.database_flavors_client
 
     @test.attr(type='smoke')
diff --git a/tempest/api/database/flavors/test_flavors_negative.py b/tempest/api/database/flavors/test_flavors_negative.py
index 202dc48..9f14cce 100644
--- a/tempest/api/database/flavors/test_flavors_negative.py
+++ b/tempest/api/database/flavors/test_flavors_negative.py
@@ -21,8 +21,8 @@
 class DatabaseFlavorsNegativeTest(base.BaseDatabaseTest):
 
     @classmethod
-    def setUpClass(cls):
-        super(DatabaseFlavorsNegativeTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(DatabaseFlavorsNegativeTest, cls).resource_setup()
         cls.client = cls.database_flavors_client
 
     @test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/database/versions/test_versions.py b/tempest/api/database/versions/test_versions.py
index 453abe7..80fcecf 100644
--- a/tempest/api/database/versions/test_versions.py
+++ b/tempest/api/database/versions/test_versions.py
@@ -21,8 +21,8 @@
     _interface = 'json'
 
     @classmethod
-    def setUpClass(cls):
-        super(DatabaseVersionsTest, cls).setUpClass()
+    def resource_setup(cls):
+        super(DatabaseVersionsTest, cls).resource_setup()
         cls.client = cls.database_versions_client
 
     @test.attr(type='smoke')
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index a1ed68b..2d7bc24 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -896,6 +896,41 @@
 
         return rules
 
+    def _create_pool(self, lb_method, protocol, subnet_id):
+        """Wrapper utility that returns a test pool."""
+        client = self.network_client
+        name = data_utils.rand_name('pool')
+        _, resp_pool = client.create_pool(protocol=protocol, name=name,
+                                          subnet_id=subnet_id,
+                                          lb_method=lb_method)
+        pool = net_resources.DeletablePool(client=client, **resp_pool['pool'])
+        self.assertEqual(pool['name'], name)
+        self.addCleanup(self.delete_wrapper, pool.delete)
+        return pool
+
+    def _create_member(self, address, protocol_port, pool_id):
+        """Wrapper utility that returns a test member."""
+        client = self.network_client
+        _, resp_member = client.create_member(protocol_port=protocol_port,
+                                              pool_id=pool_id,
+                                              address=address)
+        member = net_resources.DeletableMember(client=client,
+                                               **resp_member['member'])
+        self.addCleanup(self.delete_wrapper, member.delete)
+        return member
+
+    def _create_vip(self, protocol, protocol_port, subnet_id, pool_id):
+        """Wrapper utility that returns a test vip."""
+        client = self.network_client
+        name = data_utils.rand_name('vip')
+        _, resp_vip = client.create_vip(protocol=protocol, name=name,
+                                        subnet_id=subnet_id, pool_id=pool_id,
+                                        protocol_port=protocol_port)
+        vip = net_resources.DeletableVip(client=client, **resp_vip['vip'])
+        self.assertEqual(vip['name'], name)
+        self.addCleanup(self.delete_wrapper, vip.delete)
+        return vip
+
     def _ssh_to_server(self, server, private_key):
         ssh_login = CONF.compute.image_ssh_user
         return self.get_remote_client(server,
diff --git a/tempest/scenario/orchestration/test_autoscaling.py b/tempest/scenario/orchestration/test_autoscaling.py
deleted file mode 100644
index 8894106..0000000
--- a/tempest/scenario/orchestration/test_autoscaling.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-import time
-
-import heatclient.exc as heat_exceptions
-
-from tempest import config
-from tempest.scenario import manager
-from tempest import test
-
-CONF = config.CONF
-
-
-class AutoScalingTest(manager.OrchestrationScenarioTest):
-
-    def setUp(self):
-        super(AutoScalingTest, self).setUp()
-        if not CONF.orchestration.image_ref:
-            raise self.skipException("No image available to test")
-        self.client = self.orchestration_client
-
-    def assign_keypair(self):
-        self.stack_name = self._stack_rand_name()
-        if CONF.orchestration.keypair_name:
-            self.keypair_name = CONF.orchestration.keypair_name
-        else:
-            self.keypair = self.create_keypair()
-            self.keypair_name = self.keypair.id
-
-    def launch_stack(self):
-        net = self._get_default_network()
-        self.parameters = {
-            'KeyName': self.keypair_name,
-            'InstanceType': CONF.orchestration.instance_type,
-            'ImageId': CONF.orchestration.image_ref,
-            'StackStart': str(time.time()),
-            'Subnet': net['subnets'][0]
-        }
-
-        # create the stack
-        self.template = self._load_template(__file__, 'test_autoscaling.yaml')
-        self.client.stacks.create(
-            stack_name=self.stack_name,
-            template=self.template,
-            parameters=self.parameters)
-
-        self.stack = self.client.stacks.get(self.stack_name)
-        self.stack_identifier = '%s/%s' % (self.stack_name, self.stack.id)
-
-        # if a keypair was set, do not delete the stack on exit to allow
-        # for manual post-mortums
-        if not CONF.orchestration.keypair_name:
-            self.addCleanup(self.client.stacks.delete, self.stack)
-
-    @test.skip_because(bug="1257575")
-    @test.attr(type='slow')
-    @test.services('orchestration', 'compute')
-    def test_scale_up_then_down(self):
-
-        self.assign_keypair()
-        self.launch_stack()
-
-        sid = self.stack_identifier
-        timeout = CONF.orchestration.build_timeout
-        interval = 10
-
-        self.assertEqual('CREATE', self.stack.action)
-        # wait for create to complete.
-        self.status_timeout(self.client.stacks, sid, 'COMPLETE',
-                            error_status='FAILED')
-
-        self.stack.get()
-        self.assertEqual('CREATE_COMPLETE', self.stack.stack_status)
-
-        # the resource SmokeServerGroup is implemented as a nested
-        # stack, so servers can be counted by counting the resources
-        # inside that nested stack
-        resource = self.client.resources.get(sid, 'SmokeServerGroup')
-        nested_stack_id = resource.physical_resource_id
-
-        def server_count():
-            # the number of servers is the number of resources
-            # in the nested stack
-            self.server_count = len(
-                self.client.resources.list(nested_stack_id))
-            return self.server_count
-
-        def assertScale(from_servers, to_servers):
-            test.call_until_true(lambda: server_count() == to_servers,
-                                 timeout, interval)
-            self.assertEqual(to_servers, self.server_count,
-                             'Failed scaling from %d to %d servers. '
-                             'Current server count: %s' % (
-                                 from_servers, to_servers,
-                                 self.server_count))
-
-        # he marched them up to the top of the hill
-        assertScale(1, 2)
-        assertScale(2, 3)
-
-        # and he marched them down again
-        assertScale(3, 2)
-        assertScale(2, 1)
-
-        # delete stack on completion
-        self.stack.delete()
-        self.status_timeout(self.client.stacks, sid, 'COMPLETE',
-                            error_status='FAILED',
-                            not_found_exception=heat_exceptions.NotFound)
-
-        try:
-            self.stack.get()
-            self.assertEqual('DELETE_COMPLETE', self.stack.stack_status)
-        except heat_exceptions.NotFound:
-            pass
diff --git a/tempest/scenario/orchestration/test_autoscaling.yaml b/tempest/scenario/orchestration/test_autoscaling.yaml
deleted file mode 100644
index 4651284..0000000
--- a/tempest/scenario/orchestration/test_autoscaling.yaml
+++ /dev/null
@@ -1,185 +0,0 @@
-HeatTemplateFormatVersion: '2012-12-12'
-Description: |
-  Template which tests autoscaling and load balancing
-Parameters:
-  KeyName:
-    Type: String
-  InstanceType:
-    Type: String
-  ImageId:
-    Type: String
-  Subnet:
-    Type: String
-  StackStart:
-    Description: Epoch seconds when the stack was launched
-    Type: Number
-  ConsumeStartSeconds:
-    Description: Seconds after invocation when memory should be consumed
-    Type: Number
-    Default: '60'
-  ConsumeStopSeconds:
-    Description: Seconds after StackStart when memory should be released
-    Type: Number
-    Default: '420'
-  ScaleUpThreshold:
-    Description: Memory percentage threshold to scale up on
-    Type: String
-    Default: '70'
-  ScaleDownThreshold:
-    Description: Memory percentage threshold to scale down on
-    Type: String
-    Default: '60'
-  ConsumeMemoryLimit:
-    Description: Memory percentage threshold to consume
-    Type: Number
-    Default: '71'
-Resources:
-  SmokeServerGroup:
-    Type: AWS::AutoScaling::AutoScalingGroup
-    Properties:
-      AvailabilityZones: {'Fn::GetAZs': ''}
-      LaunchConfigurationName: {Ref: LaunchConfig}
-      MinSize: '1'
-      MaxSize: '3'
-      VPCZoneIdentifier: [{Ref: Subnet}]
-  SmokeServerScaleUpPolicy:
-    Type: AWS::AutoScaling::ScalingPolicy
-    Properties:
-      AdjustmentType: ChangeInCapacity
-      AutoScalingGroupName: {Ref: SmokeServerGroup}
-      Cooldown: '60'
-      ScalingAdjustment: '1'
-  SmokeServerScaleDownPolicy:
-    Type: AWS::AutoScaling::ScalingPolicy
-    Properties:
-      AdjustmentType: ChangeInCapacity
-      AutoScalingGroupName: {Ref: SmokeServerGroup}
-      Cooldown: '60'
-      ScalingAdjustment: '-1'
-  MEMAlarmHigh:
-    Type: AWS::CloudWatch::Alarm
-    Properties:
-      AlarmDescription: Scale-up if MEM > ScaleUpThreshold% for 10 seconds
-      MetricName: MemoryUtilization
-      Namespace: system/linux
-      Statistic: Average
-      Period: '10'
-      EvaluationPeriods: '1'
-      Threshold: {Ref: ScaleUpThreshold}
-      AlarmActions: [{Ref: SmokeServerScaleUpPolicy}]
-      Dimensions:
-      - Name: AutoScalingGroupName
-        Value: {Ref: SmokeServerGroup}
-      ComparisonOperator: GreaterThanThreshold
-  MEMAlarmLow:
-    Type: AWS::CloudWatch::Alarm
-    Properties:
-      AlarmDescription: Scale-down if MEM < ScaleDownThreshold% for 10 seconds
-      MetricName: MemoryUtilization
-      Namespace: system/linux
-      Statistic: Average
-      Period: '10'
-      EvaluationPeriods: '1'
-      Threshold: {Ref: ScaleDownThreshold}
-      AlarmActions: [{Ref: SmokeServerScaleDownPolicy}]
-      Dimensions:
-      - Name: AutoScalingGroupName
-        Value: {Ref: SmokeServerGroup}
-      ComparisonOperator: LessThanThreshold
-  CfnUser:
-    Type: AWS::IAM::User
-  SmokeKeys:
-    Type: AWS::IAM::AccessKey
-    Properties:
-      UserName: {Ref: CfnUser}
-  SmokeSecurityGroup:
-    Type: AWS::EC2::SecurityGroup
-    Properties:
-      GroupDescription: Standard firewall rules
-      SecurityGroupIngress:
-      - {IpProtocol: tcp, FromPort: '22', ToPort: '22', CidrIp: 0.0.0.0/0}
-      - {IpProtocol: tcp, FromPort: '80', ToPort: '80', CidrIp: 0.0.0.0/0}
-  LaunchConfig:
-    Type: AWS::AutoScaling::LaunchConfiguration
-    Metadata:
-      AWS::CloudFormation::Init:
-        config:
-          files:
-            /etc/cfn/cfn-credentials:
-              content:
-                Fn::Replace:
-                - $AWSAccessKeyId: {Ref: SmokeKeys}
-                  $AWSSecretKey: {'Fn::GetAtt': [SmokeKeys, SecretAccessKey]}
-                - |
-                  AWSAccessKeyId=$AWSAccessKeyId
-                  AWSSecretKey=$AWSSecretKey
-              mode: '000400'
-              owner: root
-              group: root
-            /root/watch_loop:
-              content:
-                Fn::Replace:
-                - _hi_: {Ref: MEMAlarmHigh}
-                  _lo_: {Ref: MEMAlarmLow}
-                - |
-                  #!/bin/bash
-                  while :
-                  do
-                    /opt/aws/bin/cfn-push-stats --watch _hi_ --mem-util
-                    /opt/aws/bin/cfn-push-stats --watch _lo_ --mem-util
-                    sleep 4
-                  done
-              mode: '000700'
-              owner: root
-              group: root
-            /root/consume_memory:
-              content:
-                Fn::Replace:
-                - StackStart: {Ref: StackStart}
-                  ConsumeStopSeconds: {Ref: ConsumeStopSeconds}
-                  ConsumeStartSeconds: {Ref: ConsumeStartSeconds}
-                  ConsumeMemoryLimit: {Ref: ConsumeMemoryLimit}
-                - |
-                  #!/usr/bin/env python
-                  import psutil
-                  import time
-                  import datetime
-                  import sys
-                  a = []
-                  sleep_until_consume = ConsumeStartSeconds
-                  stack_start = StackStart
-                  consume_stop_time = stack_start + ConsumeStopSeconds
-                  memory_limit = ConsumeMemoryLimit
-                  if sleep_until_consume > 0:
-                      sys.stdout.flush()
-                      time.sleep(sleep_until_consume)
-                  while psutil.virtual_memory().percent < memory_limit:
-                      sys.stdout.flush()
-                      a.append(' ' * 10**5)
-                      time.sleep(0.1)
-                  sleep_until_exit = consume_stop_time - time.time()
-                  if sleep_until_exit > 0:
-                      time.sleep(sleep_until_exit)
-              mode: '000700'
-              owner: root
-              group: root
-    Properties:
-      ImageId: {Ref: ImageId}
-      InstanceType: {Ref: InstanceType}
-      KeyName: {Ref: KeyName}
-      SecurityGroups: [{Ref: SmokeSecurityGroup}]
-      UserData:
-        Fn::Base64:
-          Fn::Replace:
-          - ConsumeStopSeconds: {Ref: ConsumeStopSeconds}
-            ConsumeStartSeconds: {Ref: ConsumeStartSeconds}
-            ConsumeMemoryLimit: {Ref: ConsumeMemoryLimit}
-          - |
-            #!/bin/bash -v
-            /opt/aws/bin/cfn-init
-            # report on memory consumption every 4 seconds
-            /root/watch_loop &
-            # wait ConsumeStartSeconds then ramp up memory consumption
-            # until it is over ConsumeMemoryLimit%
-            # then exits ConsumeStopSeconds seconds after stack launch
-            /root/consume_memory > /root/consume_memory.log &
diff --git a/tempest/scenario/test_load_balancer_basic.py b/tempest/scenario/test_load_balancer_basic.py
index 35e50e8..5e83ff9 100644
--- a/tempest/scenario/test_load_balancer_basic.py
+++ b/tempest/scenario/test_load_balancer_basic.py
@@ -28,7 +28,7 @@
 config = config.CONF
 
 
-class TestLoadBalancerBasic(manager.NetworkScenarioTest):
+class TestLoadBalancerBasic(manager.NeutronScenarioTest):
 
     """
     This test checks basic load balancing.
@@ -72,7 +72,7 @@
         super(TestLoadBalancerBasic, self).setUp()
         self.server_ips = {}
         self.server_fixed_ips = {}
-        self._create_security_group()
+        self._create_security_group_for_test()
         self._set_net_and_subnet()
 
     def _set_net_and_subnet(self):
@@ -103,8 +103,8 @@
             subnet = self._list_subnets(network_id=self.network['id'])[0]
             self.subnet = net_common.AttributeDict(subnet)
 
-    def _create_security_group(self):
-        self.security_group = self._create_security_group_neutron(
+    def _create_security_group_for_test(self):
+        self.security_group = self._create_security_group(
             tenant_id=self.tenant_id)
         self._create_security_group_rules_for_port(self.port1)
         self._create_security_group_rules_for_port(self.port2)
@@ -117,35 +117,35 @@
             'port_range_max': port,
         }
         self._create_security_group_rule(
-            client=self.network_client,
             secgroup=self.security_group,
             tenant_id=self.tenant_id,
             **rule)
 
     def _create_server(self, name):
-        keypair = self.create_keypair(name='keypair-%s' % name)
-        security_groups = [self.security_group.name]
+        keypair = self.create_keypair()
+        security_groups = [self.security_group]
         create_kwargs = {
             'nics': [
                 {'net-id': self.network['id']},
             ],
-            'key_name': keypair.name,
+            'key_name': keypair['name'],
             'security_groups': security_groups,
         }
-        server = self.create_server(name=name,
-                                    create_kwargs=create_kwargs)
-        self.servers_keypairs[server.id] = keypair
         net_name = self.network['name']
+        server = self.create_server(name=name, create_kwargs=create_kwargs)
+        self.servers_keypairs[server['id']] = keypair
         if (config.network.public_network_id and not
                 config.network.tenant_networks_reachable):
             public_network_id = config.network.public_network_id
             floating_ip = self._create_floating_ip(
                 server, public_network_id)
             self.floating_ips[floating_ip] = server
-            self.server_ips[server.id] = floating_ip.floating_ip_address
+            self.server_ips[server['id']] = floating_ip.floating_ip_address
         else:
-            self.server_ips[server.id] = server.networks[net_name][0]
-        self.server_fixed_ips[server.id] = server.networks[net_name][0]
+            self.server_ips[server['id']] =\
+                server['addresses'][net_name][0]['addr']
+        self.server_fixed_ips[server['id']] =\
+            server['addresses'][net_name][0]['addr']
         self.assertTrue(self.servers_keypairs)
         return server
 
@@ -162,8 +162,8 @@
         2. Start two http backends listening on ports 80 and 88 respectively
         """
         for server_id, ip in self.server_ips.iteritems():
-            private_key = self.servers_keypairs[server_id].private_key
-            server_name = self.compute_client.servers.get(server_id).name
+            private_key = self.servers_keypairs[server_id]['private_key']
+            server_name = self.servers_client.get_server(server_id)[1]['name']
             username = config.scenario.ssh_user
             ssh_client = self.get_remote_client(
                 server_or_ip=ip,
@@ -269,11 +269,7 @@
                                     protocol_port=80,
                                     subnet_id=self.subnet.id,
                                     pool_id=self.pool.id)
-        self.status_timeout(NeutronRetriever(self.network_client,
-                                             self.network_client.vip_path,
-                                             net_common.DeletableVip),
-                            self.vip.id,
-                            expected_status='ACTIVE')
+        self.vip.wait_for_status('ACTIVE')
         if (config.network.public_network_id and not
                 config.network.tenant_networks_reachable):
             self._assign_floating_ip_to_vip(self.vip)
@@ -286,8 +282,8 @@
         # vip port - see https://bugs.launchpad.net/neutron/+bug/1163569
         # However the linuxbridge-agent does, and it is necessary to add a
         # security group with a rule that allows tcp port 80 to the vip port.
-        body = {'port': {'security_groups': [self.security_group.id]}}
-        self.network_client.update_port(self.vip.port_id, body)
+        self.network_client.update_port(
+            self.vip.port_id, security_groups=[self.security_group.id])
 
     def _check_load_balancing(self):
         """
@@ -318,27 +314,3 @@
         self._start_servers()
         self._create_load_balancer()
         self._check_load_balancing()
-
-
-class NeutronRetriever(object):
-    """
-    Helper class to make possible handling neutron objects returned by GET
-    requests as attribute dicts.
-
-    Whet get() method is called, the returned dictionary is wrapped into
-    a corresponding DeletableResource class which provides attribute access
-    to dictionary values.
-
-    Usage:
-        This retriever is used to allow using status_timeout from
-        tempest.manager with Neutron objects.
-    """
-
-    def __init__(self, network_client, path, resource):
-        self.network_client = network_client
-        self.path = path
-        self.resource = resource
-
-    def get(self, thing_id):
-        obj = self.network_client.get(self.path % thing_id)
-        return self.resource(client=self.network_client, **obj.values()[0])
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 4783273..f2c3dcd 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -15,7 +15,6 @@
 
 import time
 
-from cinderclient import exceptions as cinder_exceptions
 import testtools
 
 from tempest.common.utils import data_utils
@@ -30,7 +29,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class TestStampPattern(manager.OfficialClientTest):
+class TestStampPattern(manager.ScenarioTest):
     """
     This test is for snapshotting an instance/volume and attaching the volume
     created from snapshot to the instance booted from snapshot.
@@ -59,13 +58,13 @@
             raise cls.skipException("Cinder volume snapshots are disabled")
 
     def _wait_for_volume_snapshot_status(self, volume_snapshot, status):
-        self.status_timeout(self.volume_client.volume_snapshots,
-                            volume_snapshot.id, status)
+        self.snapshots_client.wait_for_snapshot_status(volume_snapshot['id'],
+                                                       status)
 
     def _boot_image(self, image_id):
-        security_groups = [self.security_group.name]
+        security_groups = [self.security_group]
         create_kwargs = {
-            'key_name': self.keypair.name,
+            'key_name': self.keypair['name'],
             'security_groups': security_groups
         }
         return self.create_server(image=image_id, create_kwargs=create_kwargs)
@@ -74,53 +73,54 @@
         self.keypair = self.create_keypair()
 
     def _create_floating_ip(self):
-        floating_ip = self.compute_client.floating_ips.create()
-        self.addCleanup(self.delete_wrapper, floating_ip)
+        _, floating_ip = self.floating_ips_client.create_floating_ip()
+        self.addCleanup(self.delete_wrapper,
+                        self.floating_ips_client.delete_floating_ip,
+                        floating_ip['id'])
         return floating_ip
 
     def _add_floating_ip(self, server, floating_ip):
-        server.add_floating_ip(floating_ip)
+        self.floating_ips_client.associate_floating_ip_to_server(
+            floating_ip['ip'], server['id'])
 
     def _ssh_to_server(self, server_or_ip):
         return self.get_remote_client(server_or_ip)
 
     def _create_volume_snapshot(self, volume):
         snapshot_name = data_utils.rand_name('scenario-snapshot-')
-        volume_snapshots = self.volume_client.volume_snapshots
-        snapshot = volume_snapshots.create(
-            volume.id, display_name=snapshot_name)
+        _, snapshot = self.snapshots_client.create_snapshot(
+            volume['id'], display_name=snapshot_name)
 
         def cleaner():
-            volume_snapshots.delete(snapshot)
+            self.snapshots_client.delete_snapshot(snapshot['id'])
             try:
-                while volume_snapshots.get(snapshot.id):
+                while self.snapshots_client.get_snapshot(snapshot['id']):
                     time.sleep(1)
-            except cinder_exceptions.NotFound:
+            except exceptions.NotFound:
                 pass
         self.addCleanup(cleaner)
         self._wait_for_volume_status(volume, 'available')
-        self._wait_for_volume_snapshot_status(snapshot, 'available')
-        self.assertEqual(snapshot_name, snapshot.display_name)
+        self.snapshots_client.wait_for_snapshot_status(snapshot['id'],
+                                                       'available')
+        self.assertEqual(snapshot_name, snapshot['display_name'])
         return snapshot
 
     def _wait_for_volume_status(self, volume, status):
-        self.status_timeout(
-            self.volume_client.volumes, volume.id, status)
+        self.volumes_client.wait_for_volume_status(volume['id'], status)
 
     def _create_volume(self, snapshot_id=None):
         return self.create_volume(snapshot_id=snapshot_id)
 
     def _attach_volume(self, server, volume):
-        attach_volume_client = self.compute_client.volumes.create_server_volume
-        attached_volume = attach_volume_client(server.id,
-                                               volume.id,
-                                               '/dev/vdb')
-        self.assertEqual(volume.id, attached_volume.id)
+        # TODO(andreaf) we should use device from config instead if vdb
+        _, attached_volume = self.servers_client.attach_volume(
+            server['id'], volume['id'], device='/dev/vdb')
+        attached_volume = attached_volume['volumeAttachment']
+        self.assertEqual(volume['id'], attached_volume['id'])
         self._wait_for_volume_status(attached_volume, 'in-use')
 
     def _detach_volume(self, server, volume):
-        detach_volume_client = self.compute_client.volumes.delete_server_volume
-        detach_volume_client(server.id, volume.id)
+        self.servers_client.detach_volume(server['id'], volume['id'])
         self._wait_for_volume_status(volume, 'available')
 
     def _wait_for_volume_available_on_the_system(self, server_or_ip):
@@ -157,7 +157,7 @@
     def test_stamp_pattern(self):
         # prepare for booting a instance
         self._add_keypair()
-        self.security_group = self._create_security_group_nova()
+        self.security_group = self._create_security_group()
 
         # boot an instance and create a timestamp file in it
         volume = self._create_volume()
@@ -167,7 +167,7 @@
         if CONF.compute.use_floatingip_for_ssh:
             floating_ip_for_server = self._create_floating_ip()
             self._add_floating_ip(server, floating_ip_for_server)
-            ip_for_server = floating_ip_for_server.ip
+            ip_for_server = floating_ip_for_server['ip']
         else:
             ip_for_server = server
 
@@ -184,17 +184,17 @@
 
         # create second volume from the snapshot(volume2)
         volume_from_snapshot = self._create_volume(
-            snapshot_id=volume_snapshot.id)
+            snapshot_id=volume_snapshot['id'])
 
         # boot second instance from the snapshot(instance2)
-        server_from_snapshot = self._boot_image(snapshot_image.id)
+        server_from_snapshot = self._boot_image(snapshot_image['id'])
 
         # create and add floating IP to server_from_snapshot
         if CONF.compute.use_floatingip_for_ssh:
             floating_ip_for_snapshot = self._create_floating_ip()
             self._add_floating_ip(server_from_snapshot,
                                   floating_ip_for_snapshot)
-            ip_for_snapshot = floating_ip_for_snapshot.ip
+            ip_for_snapshot = floating_ip_for_snapshot['ip']
         else:
             ip_for_snapshot = server_from_snapshot
 
diff --git a/tempest/services/network/network_client_base.py b/tempest/services/network/network_client_base.py
index 94ba5aa..5ad5f37 100644
--- a/tempest/services/network/network_client_base.py
+++ b/tempest/services/network/network_client_base.py
@@ -13,6 +13,7 @@
 import time
 import urllib
 
+from tempest.common.utils import misc
 from tempest import config
 from tempest import exceptions
 
@@ -227,3 +228,39 @@
         except exceptions.NotFound:
             return True
         return False
+
+    def wait_for_resource_status(self, fetch, status, interval=None,
+                                 timeout=None):
+        """
+        @summary: Waits for a network resource to reach a status
+        @param fetch: the callable to be used to query the resource status
+        @type fecth: callable that takes no parameters and returns the resource
+        @param status: the status that the resource has to reach
+        @type status: String
+        @param interval: the number of seconds to wait between each status
+          query
+        @type interval: Integer
+        @param timeout: the maximum number of seconds to wait for the resource
+          to reach the desired status
+        @type timeout: Integer
+        """
+        if not interval:
+            interval = self.build_interval
+        if not timeout:
+            timeout = self.build_timeout
+        start_time = time.time()
+
+        while time.time() - start_time <= timeout:
+            resource = fetch()
+            if resource['status'] == status:
+                return
+            time.sleep(interval)
+
+        # At this point, the wait has timed out
+        message = 'Resource %s' % (str(resource))
+        message += ' failed to reach status %s' % status
+        message += ' within the required time %s' % timeout
+        caller = misc.find_test_caller()
+        if caller:
+            message = '(%s) %s' % (caller, message)
+        raise exceptions.TimeoutException(message)
diff --git a/tempest/services/network/resources.py b/tempest/services/network/resources.py
index b2feb87..2b182d0 100644
--- a/tempest/services/network/resources.py
+++ b/tempest/services/network/resources.py
@@ -51,9 +51,19 @@
     def delete(self):
         return
 
+    @abc.abstractmethod
+    def show(self):
+        return
+
     def __hash__(self):
         return hash(self.id)
 
+    def wait_for_status(self, status):
+        if not hasattr(self, 'status'):
+            return
+
+        return self.client.wait_for_resource_status(self.show, status)
+
 
 class DeletableNetwork(DeletableResource):
 
@@ -161,3 +171,8 @@
 
     def delete(self):
         self.client.delete_vip(self.id)
+
+    def show(self):
+        _, result = self.client.show_vip(self.id)
+        super(DeletableVip, self).update(**result['vip'])
+        return self