Fixes for consistency after code inspection
Fixed imports. Fixed many typos. Change-Id: I724661040d270fead6b6c3c65ae74bda1d2144e9
This commit is contained in:
parent
c85e995921
commit
01a13d03dc
@ -29,6 +29,7 @@ class MainPage(base_pages.PageObject):
|
||||
self._page_title = "Logs - Dashboard - Kibana"
|
||||
|
||||
def is_main_page(self):
|
||||
# TODO(rpromyshlennikov): fix unresolved attribute ._main_menu_locator
|
||||
return (self.is_the_current_page() and
|
||||
self._is_element_visible(*self._main_menu_locator))
|
||||
|
||||
|
@ -95,18 +95,20 @@ def check_local_mail(remote, node_name, service, state, timeout=10 * 60):
|
||||
:type remote: SSHClient
|
||||
:param node_name: name of the node to check for email on.
|
||||
:type node_name: str
|
||||
:param message: message to look for.
|
||||
:type message: str
|
||||
:param service: service to look for.
|
||||
:type service: str
|
||||
:param state: status of service to check.
|
||||
:type state: str
|
||||
:param timeout: timeout to wait for email to arrive.
|
||||
:rtype timeout: int
|
||||
"""
|
||||
def check_mail():
|
||||
try:
|
||||
responce = remote.check_call("cat $MAIL")
|
||||
if not responce:
|
||||
response = remote.check_call("cat $MAIL")
|
||||
if not response:
|
||||
return False
|
||||
if ("Service: {}\n".format(service) in responce['stdout'] and
|
||||
"State: {}\n".format(state) in responce['stdout']):
|
||||
if ("Service: {}\n".format(service) in response['stdout'] and
|
||||
"State: {}\n".format(state) in response['stdout']):
|
||||
return True
|
||||
except DevopsCalledProcessError:
|
||||
return False
|
||||
|
@ -13,9 +13,9 @@
|
||||
import contextlib
|
||||
|
||||
from proboscis import asserts
|
||||
import selenium.common.exceptions as Exceptions
|
||||
import selenium.common.exceptions as exceptions
|
||||
from selenium.webdriver.remote import webelement
|
||||
import selenium.webdriver.support.ui as Support
|
||||
import selenium.webdriver.support.ui as support
|
||||
|
||||
|
||||
class BaseWebObject(object):
|
||||
@ -42,14 +42,14 @@ class BaseWebObject(object):
|
||||
try:
|
||||
self._get_element(*locator)
|
||||
return True
|
||||
except Exceptions.NoSuchElementException:
|
||||
except exceptions.NoSuchElementException:
|
||||
return False
|
||||
|
||||
def _is_element_visible(self, *locator):
|
||||
try:
|
||||
return self._get_element(*locator).is_displayed()
|
||||
except (Exceptions.NoSuchElementException,
|
||||
Exceptions.ElementNotVisibleException):
|
||||
except (exceptions.NoSuchElementException,
|
||||
exceptions.ElementNotVisibleException):
|
||||
return False
|
||||
|
||||
def _is_element_displayed(self, element):
|
||||
@ -60,8 +60,8 @@ class BaseWebObject(object):
|
||||
return element.is_displayed()
|
||||
else:
|
||||
return element.src_elem.is_displayed()
|
||||
except (Exceptions.ElementNotVisibleException,
|
||||
Exceptions.StaleElementReferenceException):
|
||||
except (exceptions.ElementNotVisibleException,
|
||||
exceptions.StaleElementReferenceException):
|
||||
return False
|
||||
|
||||
def _is_text_visible(self, element, text, strict=True):
|
||||
@ -84,15 +84,15 @@ class BaseWebObject(object):
|
||||
return field_element
|
||||
|
||||
def _select_dropdown(self, value, element):
|
||||
select = Support.Select(element)
|
||||
select = support.Select(element)
|
||||
select.select_by_visible_text(value)
|
||||
|
||||
def _select_dropdown_by_value(self, value, element):
|
||||
select = Support.Select(element)
|
||||
select = support.Select(element)
|
||||
select.select_by_value(value)
|
||||
|
||||
def _get_dropdown_options(self, element):
|
||||
select = Support.Select(element)
|
||||
select = support.Select(element)
|
||||
return select.options
|
||||
|
||||
|
||||
|
@ -84,6 +84,7 @@ class InfluxdbPluginApi(base_test.PluginApi):
|
||||
user=plugin_settings.influxdb_user,
|
||||
password=plugin_settings.influxdb_pass,
|
||||
expected_code=200):
|
||||
logger.debug("Making query to Influx DB: {}".format(query))
|
||||
return self.checkers.check_http_get_response(
|
||||
url=self.get_influxdb_url('query'),
|
||||
expected_code=expected_code,
|
||||
@ -200,7 +201,7 @@ class InfluxdbPluginApi(base_test.PluginApi):
|
||||
"backend='{0}' AND state='{1}' and "
|
||||
"time > now() - {2}".format(service, node_state, interval))
|
||||
|
||||
msg_header = ("Wrong amout of nodes with service '{0}' "
|
||||
msg_header = ("Wrong amount of nodes with service '{0}' "
|
||||
"in '{1}' state!".format(service, node_state))
|
||||
self._check_influx_query_last_value(query, expected_count, msg_header)
|
||||
|
||||
|
@ -149,7 +149,7 @@ class TestLMAInfraAlertingPlugin(api.InfraAlertingPluginApi):
|
||||
"uninstall", "lma_infrastructure_alerting", "smoke"])
|
||||
@log_snapshot_after_test
|
||||
def uninstall_deployed_lma_infrastructure_alerting(self):
|
||||
"""Uninstall the LMA Infrastructure Alering plugin with a deployed
|
||||
"""Uninstall the LMA Infrastructure Alerting plugin with a deployed
|
||||
environment
|
||||
|
||||
Scenario:
|
||||
|
@ -34,7 +34,7 @@ class TestToolchainHTTPs(api.ToolchainApi):
|
||||
1. Upload the LMA Toolchain plugins to the master node
|
||||
2. Install the plugins
|
||||
3. Create the cluster
|
||||
4. Uplaod script for ssl certificate creation
|
||||
4. Upload script for ssl certificate creation
|
||||
5. Create ssl certificate for influxdb_grafana plugin
|
||||
6. Create ssl certificate for elasticsearch_kibana plugin
|
||||
7. Create ssl certificate for lma_infrastructure_alerting plugin
|
||||
|
@ -101,7 +101,7 @@ class TestToolchainReducedFootprint(api.ToolchainApi):
|
||||
"Spawning 1 virtual machine on node {}".format(virt_node["id"]))
|
||||
fuel_web.spawn_vms_wait(self.helpers.cluster_id)
|
||||
|
||||
logger.info("Waiting for the virtual manchine to be up...")
|
||||
logger.info("Waiting for the virtual machine to be up...")
|
||||
wait(lambda: len(nailgun_client.list_nodes()) == 4,
|
||||
timeout=10 * 60,
|
||||
timeout_msg=("Timeout waiting for 4 nodes to be ready, "
|
||||
|
@ -154,7 +154,7 @@ class TestNodesToolchain(api.ToolchainApi):
|
||||
"""Run fuel-createmirror and deploy environment
|
||||
|
||||
Scenario:
|
||||
1. Copy the LMA Toolchais plugins to the Fuel Master node and
|
||||
1. Copy the LMA Toolchain plugins to the Fuel Master node and
|
||||
install the plugins.
|
||||
2. Run the following command on the master node:
|
||||
fuel-createmirror
|
||||
|
@ -25,7 +25,7 @@ export ALWAYS_CREATE_DIAGNOSTIC_SNAPSHOT=${ALWAYS_CREATE_DIAGNOSTIC_SNAPSHOT:-tr
|
||||
# Export specified settings
|
||||
if [ -z $NODE_VOLUME_SIZE ]; then export NODE_VOLUME_SIZE=350; fi
|
||||
if [ -z $OPENSTACK_RELEASE ]; then export OPENSTACK_RELEASE=Ubuntu; fi
|
||||
if [ -z $ENV_NAME ]; then export ENV_NAME="elasticsearch_kibana"; fi
|
||||
if [ -z $ENV_NAME ]; then export ENV_NAME="stacklight"; fi
|
||||
if [ -z $ADMIN_NODE_MEMORY ]; then export ADMIN_NODE_MEMORY=3072; fi
|
||||
if [ -z $ADMIN_NODE_CPU ]; then export ADMIN_NODE_CPU=2; fi
|
||||
if [ -z $SLAVE_NODE_MEMORY ]; then export SLAVE_NODE_MEMORY=4096; fi
|
||||
@ -73,7 +73,7 @@ if you do need to override them.
|
||||
-K - Keep test environment after tests are finished
|
||||
-h - Show this help page
|
||||
|
||||
Most variables uses guesing from Jenkins' job name but can be overriden
|
||||
Most variables uses guessing from Jenkins' job name but can be overridden
|
||||
by exported variable before script is run or by one of command line options.
|
||||
|
||||
You can override following variables using export VARNAME="value" before running this script
|
||||
|
Loading…
x
Reference in New Issue
Block a user