rework TODO due to new tempest_lib

Change-Id: I73a4b60029031fe425cd39c3424236222962d369
This commit is contained in:
Andrey Pavlov 2015-02-24 13:20:51 +03:00
parent aacc4b843a
commit 594fbaf843
15 changed files with 29 additions and 40 deletions

View File

@ -15,7 +15,7 @@
import time
from tempest_lib.openstack.common import log
from oslo_log import log
from ec2api.tests.functional import base
from ec2api.tests.functional import config

View File

@ -15,7 +15,7 @@
import time
from tempest_lib.openstack.common import log
from oslo_log import log
from ec2api.tests.functional import base
from ec2api.tests.functional import config

View File

@ -15,7 +15,7 @@
import base64
from tempest_lib.openstack.common import log
from oslo_log import log
import testtools
from ec2api.tests.functional import base

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest_lib.openstack.common import log
from oslo_log import log
from ec2api.tests.functional import base
from ec2api.tests.functional import config

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest_lib.openstack.common import log
from oslo_log import log
import testtools
from ec2api.tests.functional import base

View File

@ -15,7 +15,7 @@
import time
from tempest_lib.openstack.common import log
from oslo_log import log
import testtools
from ec2api.tests.functional import base

View File

@ -15,7 +15,8 @@
import time
from tempest_lib.openstack.common import log
from oslo_log import log
from tempest_lib.common.utils import data_utils
from ec2api.tests.functional import base
from ec2api.tests.functional import config
@ -71,7 +72,7 @@ class NetworkInterfaceTest(base.EC2TestCase):
kwargs = {
'SubnetId': subnet_id,
'Description': base.rand_name('ni')
'Description': data_utils.rand_name('ni')
}
resp, data = self.client.CreateNetworkInterface(*[], **kwargs)
self.assertEqual(200, resp.status_code, base.EC2ErrorConverter(data))
@ -98,7 +99,7 @@ class NetworkInterfaceTest(base.EC2TestCase):
def test_create_network_interface(self):
kwargs = {
'SubnetId': self.subnet_id,
'Description': base.rand_name('ni')
'Description': data_utils.rand_name('ni')
}
resp, data = self.client.CreateNetworkInterface(*[], **kwargs)
self.assertEqual(200, resp.status_code, base.EC2ErrorConverter(data))
@ -317,7 +318,7 @@ class NetworkInterfaceTest(base.EC2TestCase):
self.get_network_interface_waiter().wait_delete(ni_id)
def test_network_interface_attribute(self):
desc = base.rand_name('ni')
desc = data_utils.rand_name('ni')
kwargs = {
'SubnetId': self.subnet_id,
'Description': desc
@ -335,7 +336,7 @@ class NetworkInterfaceTest(base.EC2TestCase):
self.assertEqual(200, resp.status_code, base.EC2ErrorConverter(data))
self.assertEqual(desc, data['Description']['Value'])
new_desc = base.rand_name('new-ni')
new_desc = data_utils.rand_name('new-ni')
kwargs = {
'NetworkInterfaceId': ni_id,
'Description': {'Value': new_desc}

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest_lib.openstack.common import log
from oslo_log import log
from ec2api.tests.functional import base
from ec2api.tests.functional import config

View File

@ -15,7 +15,8 @@
import time
from tempest_lib.openstack.common import log
from oslo_log import log
from tempest_lib.common.utils import data_utils
import testtools
from ec2api.tests.functional import base
@ -45,8 +46,8 @@ class SecurityGroupTest(base.EC2TestCase):
cls.get_vpc_waiter().wait_available(cls.vpc_id)
def test_create_delete_security_group(self):
name = base.rand_name('sgName')
desc = base.rand_name('sgDesc')
name = data_utils.rand_name('sgName')
desc = data_utils.rand_name('sgDesc')
resp, data = self.client.CreateSecurityGroup(VpcId=self.vpc_id,
GroupName=name,
Description=desc)
@ -71,7 +72,7 @@ class SecurityGroupTest(base.EC2TestCase):
@testtools.skipUnless(CONF.aws.run_incompatible_tests,
"MismatchError: 'InvalidParameterValue' != 'ValidationError'")
def test_create_invalid_name_desc(self):
valid = base.rand_name('sgName')
valid = data_utils.rand_name('sgName')
invalid = 'name%"'
resp, data = self.client.CreateSecurityGroup(VpcId=self.vpc_id,
GroupName=invalid,
@ -106,8 +107,8 @@ class SecurityGroupTest(base.EC2TestCase):
'IpPermissionsEgress')
def _test_rules(self, add_func, del_func, field):
name = base.rand_name('sgName')
desc = base.rand_name('sgDesc')
name = data_utils.rand_name('sgName')
desc = data_utils.rand_name('sgDesc')
resp, data = self.client.CreateSecurityGroup(VpcId=self.vpc_id,
GroupName=name,
Description=desc)

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest_lib.openstack.common import log
from oslo_log import log
import testtools
from ec2api.tests.functional import base

View File

@ -15,15 +15,14 @@
import functools
import logging
import random
import sys
import time
import traceback
from oslo_log import log
import six
from tempest_lib import base
from tempest_lib import exceptions
from tempest_lib.openstack.common import log
import testtools
from ec2api.tests.functional import botocoreclient
@ -38,15 +37,6 @@ logging.getLogger(
).setLevel(logging.WARNING)
# TODO(andrey-mp): remove it when new tempest_lib with this will be
def rand_name(name=''):
randbits = str(random.randint(1, 0x7fffffff))
if name:
return name + '-' + randbits
else:
return randbits
class EC2ErrorConverter(object):
_data = ''

View File

@ -16,7 +16,7 @@
import types
from botocore import session
from tempest_lib.openstack.common import log as logging
from oslo_log import log as logging
from ec2api.tests.functional import config as cfg

View File

@ -19,7 +19,7 @@ import logging as std_logging
import os
from oslo.config import cfg
from tempest_lib.openstack.common import log as logging
from oslo_log import log as logging
def register_opt_group(conf, opt_group, options):
@ -82,10 +82,6 @@ class ConfigPrivate(object):
DEFAULT_CONFIG_FILE = "functional_tests.conf"
def _set_attrs(self):
self.aws = cfg.CONF.aws
self.debug = cfg.CONF.debug
def __init__(self, parse_conf=True):
"""Initialize a configuration from a conf directory and conf file."""
super(ConfigPrivate, self).__init__()
@ -102,11 +98,10 @@ class ConfigPrivate(object):
config_files.append(path)
cfg.CONF([], project='ec2api', default_config_files=config_files)
logging.setup('ec2api')
LOG = logging.getLogger('ec2api')
LOG.info("Using ec2api config file %s" % path)
register_opts()
self._set_attrs()
self.aws = cfg.CONF.aws
if parse_conf:
cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)

View File

@ -14,7 +14,8 @@
import math
from tempest_lib.openstack.common import log
from oslo_log import log
from tempest_lib.common.utils import data_utils
import testtools
from ec2api.tests.functional import base
@ -402,7 +403,7 @@ class EC2_EBSInstanceSnapshot(base.EC2TestCase):
final_set=('completed'))
kwargs = {
'Name': base.rand_name('ebs-ami'),
'Name': data_utils.rand_name('ebs-ami'),
'RootDeviceName': instance['RootDeviceName'],
'BlockDeviceMappings': [{'DeviceName': instance['RootDeviceName'],
'Ebs': {'SnapshotId': snapshot_id,

View File

@ -12,3 +12,4 @@ sphinx>=1.1.2,!=1.2.0,<1.3
tempest-lib>=0.2.0
testrepository>=0.0.18
testtools>=0.9.34
oslo.log>=0.1.0 # Apache-2.0