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:
parent
1ce056eb36
commit
6cae33f50a
|
@ -277,7 +277,7 @@ class RallyTask(object):
|
||||||
return self._status
|
return self._status
|
||||||
|
|
||||||
def prepare_scenario(self):
|
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)
|
os.environ.get("WORKSPACE", "./"), self.test_type)
|
||||||
remote_path = '{0}/{1}.json'.format(self.engine.dir_for_home,
|
remote_path = '{0}/{1}.json'.format(self.engine.dir_for_home,
|
||||||
self.test_type)
|
self.test_type)
|
||||||
|
|
|
@ -67,7 +67,6 @@ def replace_ubuntu_repos(repos_attr, upstream_host):
|
||||||
|
|
||||||
def replace_centos_repos(repos_attr, upstream_host):
|
def replace_centos_repos(repos_attr, upstream_host):
|
||||||
# Walk thru repos_attr and replace/add extra Centos mirrors
|
# Walk thru repos_attr and replace/add extra Centos mirrors
|
||||||
repos = []
|
|
||||||
if help_data.MIRROR_CENTOS:
|
if help_data.MIRROR_CENTOS:
|
||||||
logger.debug("Adding new mirrors: '{0}'"
|
logger.debug("Adding new mirrors: '{0}'"
|
||||||
.format(help_data.MIRROR_CENTOS))
|
.format(help_data.MIRROR_CENTOS))
|
||||||
|
|
|
@ -263,7 +263,7 @@ class TimeStat(object):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def spended_time(self):
|
def spent_time(self):
|
||||||
return time.time() - self.begin_time
|
return time.time() - self.begin_time
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,6 @@ class EnvironmentModel(object):
|
||||||
'wait_for_external_config': 'yes',
|
'wait_for_external_config': 'yes',
|
||||||
'build_images': '1' if build_images else '0'
|
'build_images': '1' if build_images else '0'
|
||||||
}
|
}
|
||||||
keys = ''
|
|
||||||
if iso_connect_as == 'usb':
|
if iso_connect_as == 'usb':
|
||||||
keys = (
|
keys = (
|
||||||
"<Wait>\n" # USB boot uses boot_menu=yes for master node
|
"<Wait>\n" # USB boot uses boot_menu=yes for master node
|
||||||
|
|
|
@ -405,8 +405,8 @@ def make_bug_statistics(test_results, test_plan, tests_suite,
|
||||||
for os in operation_systems:
|
for os in operation_systems:
|
||||||
test_run_ids = [run['id'] for entry in test_plan['entries']
|
test_run_ids = [run['id'] for entry in test_plan['entries']
|
||||||
for run in entry['runs']
|
for run in entry['runs']
|
||||||
if tests_suite['id'] == run['suite_id']
|
if tests_suite['id'] == run['suite_id'] and
|
||||||
and os['id'] in run['config_ids']]
|
os['id'] in run['config_ids']]
|
||||||
|
|
||||||
for result in test_results[os['distro']]:
|
for result in test_results[os['distro']]:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -205,7 +205,9 @@ class TestRailProject(object):
|
||||||
return self.client.send_post(add_plan_uri, new_plan)
|
return self.client.send_post(add_plan_uri, new_plan)
|
||||||
|
|
||||||
def update_plan(self, plan_id, name='', description='',
|
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(
|
update_plan_uri = 'update_plan/{plan_id}'.format(
|
||||||
plan_id=plan_id)
|
plan_id=plan_id)
|
||||||
updated_plan = {}
|
updated_plan = {}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class LbaasPlugin(TestBasic):
|
||||||
'There is not LbaaS agent in neutron agent list output')
|
'There is not LbaaS agent in neutron agent list output')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def check_lbass_work(cls, os_conn):
|
def check_lbaas_work(cls, os_conn):
|
||||||
# create pool
|
# create pool
|
||||||
pool = os_conn.create_pool(pool_name='lbaas_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_neutron_agents_statuses(os_conn)
|
||||||
|
|
||||||
self.check_lbass_work(os_conn)
|
self.check_lbaas_work(os_conn)
|
||||||
|
|
||||||
self.fuel_web.run_ostf(
|
self.fuel_web.run_ostf(
|
||||||
cluster_id=cluster_id)
|
cluster_id=cluster_id)
|
||||||
|
@ -245,7 +245,7 @@ class LbaasPlugin(TestBasic):
|
||||||
|
|
||||||
self.check_neutron_agents_statuses(os_conn)
|
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)
|
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_neutron_agents_statuses(os_conn)
|
||||||
|
|
||||||
self.check_lbass_work(os_conn)
|
self.check_lbaas_work(os_conn)
|
||||||
self.fuel_web.run_ostf(
|
self.fuel_web.run_ostf(
|
||||||
cluster_id=cluster_id)
|
cluster_id=cluster_id)
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,7 @@ class TestMultipleClusterNets(TestBasic):
|
||||||
in default_admin_network[0]["ip_ranges"][0]]
|
in default_admin_network[0]["ip_ranges"][0]]
|
||||||
new_admin_range = [default_admin_range[0] + number_excluded_ips,
|
new_admin_range = [default_admin_range[0] + number_excluded_ips,
|
||||||
default_admin_range[1]]
|
default_admin_range[1]]
|
||||||
default_admin_network[0]["ip_ranges"][0] = [str(ip)
|
return [str(ip) for ip in new_admin_range]
|
||||||
for ip in new_admin_range]
|
|
||||||
return default_admin_network[0]["ip_ranges"][0]
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_ip_in_range(ip_addr, ip_range_start, ip_range_end):
|
def is_ip_in_range(ip_addr, ip_range_start, ip_range_end):
|
||||||
|
|
|
@ -1098,7 +1098,7 @@ class VcenterDeploy(TestBasic):
|
||||||
@test(depends_on=[SetupEnvironment.prepare_slaves_9],
|
@test(depends_on=[SetupEnvironment.prepare_slaves_9],
|
||||||
groups=["vcenter_delete_controler"])
|
groups=["vcenter_delete_controler"])
|
||||||
@log_snapshot_after_test
|
@log_snapshot_after_test
|
||||||
def vcenter_delete_controler(self):
|
def vcenter_delete_controller(self):
|
||||||
"""Deploy environment of vcenter+qemu nova vlan, default backend for
|
"""Deploy environment of vcenter+qemu nova vlan, default backend for
|
||||||
glance and deletion one node with controller role
|
glance and deletion one node with controller role
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class TestNeutronFailoverBase(base_test_case.TestBasic):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@logwrap
|
@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)
|
router_l3_agents = os_conn.get_l3_agent_ids(router_id)
|
||||||
if not router_l3_agents:
|
if not router_l3_agents:
|
||||||
raise NotFound("l3 agent hosting router with id:{}"
|
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))
|
logger.debug('instance internal ip is {0}'.format(instance_ip))
|
||||||
|
|
||||||
# Reschedule router for net for created instance to new controller
|
# 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
|
# Get remote to the controller with running DHCP agent
|
||||||
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
|
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))
|
logger.debug('instance internal ip is {0}'.format(instance_ip))
|
||||||
|
|
||||||
# Reschedule router for net for created instance to new controller
|
# 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
|
# Get remote to the controller with running DHCP agent
|
||||||
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
|
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))
|
logger.debug('instance internal ip is {0}'.format(instance_ip))
|
||||||
|
|
||||||
# Reschedule router for net for created instance to new controller
|
# 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
|
# Get remote to the controller with running DHCP agent
|
||||||
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
|
with self.env.d_env.get_ssh_to_remote(_ip) as remote:
|
||||||
|
|
|
@ -52,9 +52,9 @@ def step_start_stop(func):
|
||||||
header = "<<< {:-^142} >>>".format(start_step)
|
header = "<<< {:-^142} >>>".format(start_step)
|
||||||
logger.info("\n{header}\n".format(header=header))
|
logger.info("\n{header}\n".format(header=header))
|
||||||
result = func(*args, **kwargs)
|
result = func(*args, **kwargs)
|
||||||
spend_time = timer.spended_time
|
spent_time = timer.spent_time
|
||||||
minutes = int(round(spend_time)) / 60
|
minutes = int(round(spent_time)) / 60
|
||||||
seconds = int(round(spend_time)) % 60
|
seconds = int(round(spent_time)) % 60
|
||||||
finish_step = "[ FINISH {} STEP TOOK {} min {} sec ]".format(
|
finish_step = "[ FINISH {} STEP TOOK {} min {} sec ]".format(
|
||||||
step_name, minutes, seconds)
|
step_name, minutes, seconds)
|
||||||
footer = "<<< {:-^142} >>>".format(finish_step)
|
footer = "<<< {:-^142} >>>".format(finish_step)
|
||||||
|
|
|
@ -27,7 +27,7 @@ class FillRootPrimaryController(
|
||||||
Scenario:
|
Scenario:
|
||||||
1. Setup master node
|
1. Setup master node
|
||||||
2. Config default repositories for release
|
2. Config default repositories for release
|
||||||
3. Bootstap slaves and make snapshot ready
|
3. Bootstrap slaves and make snapshot ready
|
||||||
4. Revert snapshot ready
|
4. Revert snapshot ready
|
||||||
5. Create Environment
|
5. Create Environment
|
||||||
6. Add nodes to Environment
|
6. Add nodes to Environment
|
||||||
|
@ -83,4 +83,4 @@ class FillRootPrimaryController(
|
||||||
|
|
||||||
@factory
|
@factory
|
||||||
def cases():
|
def cases():
|
||||||
return (case_factory(FillRootPrimaryController))
|
return case_factory(FillRootPrimaryController)
|
||||||
|
|
Loading…
Reference in New Issue