From 7e28af2fcb66bc55cc48a47736f5912a3a817744 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Cuong Date: Mon, 22 May 2017 10:14:13 +0700 Subject: [PATCH] Remove the deprecated tempest.test.attr [1] moves the attr decorator from test.py to tempest/lib. So, all the references to tempest.test has to be moved to tempest.lib.decorator. [2] https://review.openstack.org/#/c/456236/ Change-Id: I03287250a614c8df328cfaccdbee68aa159964a9 --- .../scenario/aws_compat/test_ec2_unixbench.py | 4 ++-- .../scenario/aws_compat/test_ec2_volume_benchmark.py | 12 ++++++------ .../scenario/aws_compat/test_vpc_benchmark.py | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_unixbench.py b/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_unixbench.py index c30f7f89..b77d92cf 100644 --- a/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_unixbench.py +++ b/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_unixbench.py @@ -17,7 +17,7 @@ from testtools import content as test_content import tempest.cloudscaling.base as base import tempest.cloudscaling.thirdparty.scenario.aws_compat.base as aws_base from tempest.lib.common.utils.linux import remote_client -from tempest import test +from tempest.lib import decorators import logging logging.getLogger('boto').setLevel(logging.CRITICAL) @@ -60,7 +60,7 @@ class UnixBenchTest(base.BaseBenchmarkTest, aws_base.BaseAWSTest): cls.ssh_user, pkey=cls.keypair.material) - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_run_benchmark(self): """Run UnixBench test on prepared instance""" if self.ssh is None: diff --git a/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_volume_benchmark.py b/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_volume_benchmark.py index 82a1334a..4721f01e 100644 --- a/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_volume_benchmark.py +++ b/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_volume_benchmark.py @@ -20,7 +20,7 @@ import tempest.cloudscaling.base as base import tempest.cloudscaling.thirdparty.scenario.aws_compat.base as aws_base import tempest.cloudscaling.utils as utils from tempest.lib.common.utils.linux import remote_client -from tempest import test +from tempest.lib import decorators from tempest.thirdparty.boto.utils import wait as boto_wait import logging @@ -113,7 +113,7 @@ class VolumeBenchmarkTest(base.BaseBenchmarkTest, aws_base.BaseAWSTest): str(self.test_time) + "s (current) > " + reference_time[1] + "s (AWS)") - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_001_attach_volume(self): """Attach volume""" @@ -155,7 +155,7 @@ class VolumeBenchmarkTest(base.BaseBenchmarkTest, aws_base.BaseAWSTest): self._check_test() - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_002_fill_volume(self): """Fill volume with data""" @@ -181,7 +181,7 @@ class VolumeBenchmarkTest(base.BaseBenchmarkTest, aws_base.BaseAWSTest): self._check_test() - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_003_snapshot_volume(self): """Snapshot volume""" @@ -202,7 +202,7 @@ class VolumeBenchmarkTest(base.BaseBenchmarkTest, aws_base.BaseAWSTest): self._check_test() - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_004_clone_volume_snapshot(self): """Clone volume""" @@ -224,7 +224,7 @@ class VolumeBenchmarkTest(base.BaseBenchmarkTest, aws_base.BaseAWSTest): self._check_test() - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_005_detach_volume(self): """Detach volume""" diff --git a/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_benchmark.py b/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_benchmark.py index ed275785..e40c0481 100644 --- a/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_benchmark.py +++ b/ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_benchmark.py @@ -20,7 +20,7 @@ from tempest.cloudscaling import base import tempest.cloudscaling.thirdparty.scenario.aws_compat.base as aws_base from tempest import exceptions from tempest.lib.common.utils.linux import remote_client -from tempest import test +from tempest.lib import decorators import logging logging.getLogger('boto').setLevel(logging.CRITICAL) @@ -154,7 +154,7 @@ class VPC_Benchmark(aws_base.BaseVPCTest, base.BaseBenchmarkTest): "%sMbits/sec (current) < %sMbits/sec (AWS)" % (rate, reference[0])) - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_001_internal_vpc_tcp_150MB_throughput(self): """Measure internal VPC network throughput for 150 MBytes transmit.""" if self.keypair is None: @@ -170,7 +170,7 @@ class VPC_Benchmark(aws_base.BaseVPCTest, base.BaseBenchmarkTest): "150 MBytes throughput: %s Mbits/sec" % rate)) self._check_test(rate) - @test.attr(type='benchmark') + @decorators.attr(type='benchmark') def test_002_internal_vpc_tcp_2mins_throughput(self): """Measure internal VPC network throughput for 2 mins transmit.""" if self.keypair is None: