Fis mistypes with affect on API

1. screnarios -> scenarios
2. spended_time -> spent time (used only at 1 place)
3. rename few test methods (not groups)
4. removed unused code (
      assign element of dictionary before return of this element only,
      redundant parenthesis - again,
      comeback of mutable defaults - again,
      variable, which redefined on the next line in if-else)

Change-Id: I68ffdc85c2d1289d7ab6ef6a7f4084c19e7afcf9
Related-Bug: #1513777
This commit is contained in:
Alexey Stepanov 2015-11-27 11:35:52 +03:00
parent 1ce056eb36
commit 6cae33f50a
14 changed files with 22 additions and 24 deletions

View File

@ -277,7 +277,7 @@ class RallyTask(object):
return self._status
def prepare_scenario(self):
scenario_file = '{0}/fuelweb_test/rally/screnarios/{1}.json'.format(
scenario_file = '{0}/fuelweb_test/rally/scenarios/{1}.json'.format(
os.environ.get("WORKSPACE", "./"), self.test_type)
remote_path = '{0}/{1}.json'.format(self.engine.dir_for_home,
self.test_type)

View File

@ -67,7 +67,6 @@ def replace_ubuntu_repos(repos_attr, upstream_host):
def replace_centos_repos(repos_attr, upstream_host):
# Walk thru repos_attr and replace/add extra Centos mirrors
repos = []
if help_data.MIRROR_CENTOS:
logger.debug("Adding new mirrors: '{0}'"
.format(help_data.MIRROR_CENTOS))

View File

@ -263,7 +263,7 @@ class TimeStat(object):
raise
@property
def spended_time(self):
def spent_time(self):
return time.time() - self.begin_time

View File

@ -165,7 +165,6 @@ class EnvironmentModel(object):
'wait_for_external_config': 'yes',
'build_images': '1' if build_images else '0'
}
keys = ''
if iso_connect_as == 'usb':
keys = (
"<Wait>\n" # USB boot uses boot_menu=yes for master node

View File

@ -405,8 +405,8 @@ def make_bug_statistics(test_results, test_plan, tests_suite,
for os in operation_systems:
test_run_ids = [run['id'] for entry in test_plan['entries']
for run in entry['runs']
if tests_suite['id'] == run['suite_id']
and os['id'] in run['config_ids']]
if tests_suite['id'] == run['suite_id'] and
os['id'] in run['config_ids']]
for result in test_results[os['distro']]:
try:

View File

@ -205,7 +205,9 @@ class TestRailProject(object):
return self.client.send_post(add_plan_uri, new_plan)
def update_plan(self, plan_id, name='', description='',
milestone_id=None, entries=[]):
milestone_id=None, entries=None):
if entries is None:
entries = []
update_plan_uri = 'update_plan/{plan_id}'.format(
plan_id=plan_id)
updated_plan = {}

View File

@ -55,7 +55,7 @@ class LbaasPlugin(TestBasic):
'There is not LbaaS agent in neutron agent list output')
@classmethod
def check_lbass_work(cls, os_conn):
def check_lbaas_work(cls, os_conn):
# create pool
pool = os_conn.create_pool(pool_name='lbaas_pool')
@ -162,7 +162,7 @@ class LbaasPlugin(TestBasic):
self.check_neutron_agents_statuses(os_conn)
self.check_lbass_work(os_conn)
self.check_lbaas_work(os_conn)
self.fuel_web.run_ostf(
cluster_id=cluster_id)
@ -245,7 +245,7 @@ class LbaasPlugin(TestBasic):
self.check_neutron_agents_statuses(os_conn)
self.check_lbass_work(os_conn)
self.check_lbaas_work(os_conn)
self.fuel_web.stop_reset_env_wait(cluster_id)
@ -263,7 +263,7 @@ class LbaasPlugin(TestBasic):
self.check_neutron_agents_statuses(os_conn)
self.check_lbass_work(os_conn)
self.check_lbaas_work(os_conn)
self.fuel_web.run_ostf(
cluster_id=cluster_id)

View File

@ -53,9 +53,7 @@ class TestMultipleClusterNets(TestBasic):
in default_admin_network[0]["ip_ranges"][0]]
new_admin_range = [default_admin_range[0] + number_excluded_ips,
default_admin_range[1]]
default_admin_network[0]["ip_ranges"][0] = [str(ip)
for ip in new_admin_range]
return default_admin_network[0]["ip_ranges"][0]
return [str(ip) for ip in new_admin_range]
@staticmethod
def is_ip_in_range(ip_addr, ip_range_start, ip_range_end):

View File

@ -1098,7 +1098,7 @@ class VcenterDeploy(TestBasic):
@test(depends_on=[SetupEnvironment.prepare_slaves_9],
groups=["vcenter_delete_controler"])
@log_snapshot_after_test
def vcenter_delete_controler(self):
def vcenter_delete_controller(self):
"""Deploy environment of vcenter+qemu nova vlan, default backend for
glance and deletion one node with controller role

View File

@ -51,7 +51,7 @@ class TestNeutronFailoverBase(base_test_case.TestBasic):
@staticmethod
@logwrap
def reshedule_router_manually(os_conn, router_id):
def reschedule_router_manually(os_conn, router_id):
router_l3_agents = os_conn.get_l3_agent_ids(router_id)
if not router_l3_agents:
raise NotFound("l3 agent hosting router with id:{}"
@ -207,7 +207,7 @@ class TestNeutronFailoverBase(base_test_case.TestBasic):
logger.debug('instance internal ip is {0}'.format(instance_ip))
# Reschedule router for net for created instance to new controller
self.reshedule_router_manually(os_conn, router_id)
self.reschedule_router_manually(os_conn, router_id)
# Get remote to the controller with running DHCP agent
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
@ -272,7 +272,7 @@ class TestNeutronFailoverBase(base_test_case.TestBasic):
logger.debug('instance internal ip is {0}'.format(instance_ip))
# Reschedule router for net for created instance to new controller
self.reshedule_router_manually(os_conn, router_id)
self.reschedule_router_manually(os_conn, router_id)
# Get remote to the controller with running DHCP agent
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
@ -354,7 +354,7 @@ class TestNeutronFailoverBase(base_test_case.TestBasic):
logger.debug('instance internal ip is {0}'.format(instance_ip))
# Reschedule router for net for created instance to new controller
self.reshedule_router_manually(os_conn, router_id)
self.reschedule_router_manually(os_conn, router_id)
# Get remote to the controller with running DHCP agent
with self.env.d_env.get_ssh_to_remote(_ip) as remote:

View File

@ -52,9 +52,9 @@ def step_start_stop(func):
header = "<<< {:-^142} >>>".format(start_step)
logger.info("\n{header}\n".format(header=header))
result = func(*args, **kwargs)
spend_time = timer.spended_time
minutes = int(round(spend_time)) / 60
seconds = int(round(spend_time)) % 60
spent_time = timer.spent_time
minutes = int(round(spent_time)) / 60
seconds = int(round(spent_time)) % 60
finish_step = "[ FINISH {} STEP TOOK {} min {} sec ]".format(
step_name, minutes, seconds)
footer = "<<< {:-^142} >>>".format(finish_step)

View File

@ -27,7 +27,7 @@ class FillRootPrimaryController(
Scenario:
1. Setup master node
2. Config default repositories for release
3. Bootstap slaves and make snapshot ready
3. Bootstrap slaves and make snapshot ready
4. Revert snapshot ready
5. Create Environment
6. Add nodes to Environment
@ -83,4 +83,4 @@ class FillRootPrimaryController(
@factory
def cases():
return (case_factory(FillRootPrimaryController))
return case_factory(FillRootPrimaryController)