Merge "Removed fuelweb_test and fuelweb_ui_test"
This commit is contained in:
commit
22a534ba9c
|
@ -1,14 +0,0 @@
|
|||
Tests documentation
|
||||
-------------------
|
||||
|
||||
Since stable/6.1 branch tests have been moved to a separate [Fuel-qa] (https://github.com/stackforge/fuel-qa) repository.
|
||||
|
||||
[Devops documentation](https://docs.fuel-infra.org/fuel-dev/devops.html)
|
||||
[Fuel-qa documentation](https://ci.fuel-infra.org/job/verify-fuel-qa-docs/114/Fuel_QA_Docs_build_results/)
|
||||
|
||||
|
||||
For 'make iso'
|
||||
--------------
|
||||
|
||||
[Building ISO documentation](https://docs.fuel-infra.org/fuel-dev/develop/env.html#building-the-fuel-iso)
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
*.py[cod]
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Packages
|
||||
*.egg
|
||||
*.egg-info
|
||||
dist
|
||||
build
|
||||
eggs
|
||||
parts
|
||||
bin
|
||||
var
|
||||
sdist
|
||||
develop-eggs
|
||||
.installed.cfg
|
||||
lib
|
||||
lib64
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
.coverage
|
||||
.tox
|
||||
nosetests.xml
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
||||
# Mr Developer
|
||||
.mr.developer.cfg
|
||||
.project
|
||||
.pydevproject
|
||||
|
||||
# IDEA
|
||||
.idea
|
|
@ -1,27 +0,0 @@
|
|||
fuelweb-test
|
||||
============
|
||||
|
||||
# Setting up virtual test machine
|
||||
|
||||
Steps to set up a virtual machine for running fuelweb selenium tests:
|
||||
|
||||
* Create virtual machine with Ubuntu desktop OS. VM should have internet connection.
|
||||
* install java OpenJDK runtime environment.
|
||||
* Turn the VM into jenkins node
|
||||
* Install “git”
|
||||
* “git clone https://github.com/stackforge/fuel-web.git” repository. It will be required in next step (command “cd nailgun” is about folder in this repository)
|
||||
* Install “postgresql” and “pip”, setup python virtual environement and install python packages. Follow instructions at https://github.com/stackforge/fuel-web/blob/master/docs/develop/env.rst#setup-for-nailgun-unit-tests Steps #2 - #5.
|
||||
* Install NodeJS. Follow instructions in step #1 at https://github.com/stackforge/fuel-web/blob/master/docs/develop/env.rst#setup-for-web-ui-tests.
|
||||
* Try to run fuel-web in fake-ui mode. Follow steps #1 - #3 at https://github.com/stackforge/fuel-web/blob/master/docs/develop/env.rst#running-nailgun-in-fake-mode . Try to navigate to http://localhost:8000
|
||||
* Install next browsers.
|
||||
* Chrome
|
||||
* Firefox
|
||||
* PhantomJS
|
||||
* Download latest version of Chrome driver from http://chromedriver.storage.googleapis.com/index.html and extract it to home folder at the VM
|
||||
* “git clone https://github.com/stackforge/fuel-main”
|
||||
* activate fuel virtual environment “workon fuel”
|
||||
* install pip packages “pip install -r fuelweb-test/requirements.txt“
|
||||
* Try to run selenium tests (fake-ui should be launched).
|
||||
* workon fuel
|
||||
* export PYTHONPATH=$PYTHONPATH:[path to /fuel-web/nailgun]
|
||||
* nosetests fuelweb-test.tests
|
|
@ -1,13 +0,0 @@
|
|||
# Copyright 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
|
@ -1,54 +0,0 @@
|
|||
from selenium import webdriver
|
||||
from selenium.webdriver import DesiredCapabilities
|
||||
from fuelweb_ui_test.settings import BROWSER
|
||||
from fuelweb_ui_test.settings import CHROME_EXECUTABLE_PATH
|
||||
from fuelweb_ui_test.settings import SELENIUM_IMPLICIT_WAIT
|
||||
from pyvirtualdisplay import Display
|
||||
|
||||
driver = None
|
||||
|
||||
|
||||
def start_driver(browser=None):
|
||||
browser = browser or BROWSER
|
||||
|
||||
def start_chrome():
|
||||
return webdriver.Chrome(
|
||||
executable_path=CHROME_EXECUTABLE_PATH,
|
||||
desired_capabilities=DesiredCapabilities.CHROME)
|
||||
|
||||
def start_firefox():
|
||||
return webdriver.Firefox()
|
||||
|
||||
def start_iexplore():
|
||||
return webdriver.Ie()
|
||||
|
||||
def start_headless():
|
||||
display = Display(visible=0, size=(1024, 768))
|
||||
display.start()
|
||||
return webdriver.Chrome(
|
||||
executable_path=CHROME_EXECUTABLE_PATH,
|
||||
desired_capabilities=DesiredCapabilities.CHROME)
|
||||
|
||||
def start_phantom():
|
||||
return webdriver.PhantomJS()
|
||||
|
||||
global driver
|
||||
if browser == "iexplore":
|
||||
driver = start_iexplore()
|
||||
elif browser == "chrome":
|
||||
driver = start_chrome()
|
||||
elif browser == "firefox":
|
||||
driver = start_firefox()
|
||||
elif browser == "headless":
|
||||
driver = start_headless()
|
||||
elif browser == "phantom":
|
||||
driver = start_phantom()
|
||||
|
||||
# driver.set_window_size(1024, 768)
|
||||
driver.maximize_window()
|
||||
driver.implicitly_wait(SELENIUM_IMPLICIT_WAIT)
|
||||
return driver
|
||||
|
||||
|
||||
def quit_driver():
|
||||
driver.quit()
|
|
@ -1,13 +0,0 @@
|
|||
import browser
|
||||
from fuelweb_ui_test.settings import SELENIUM_IMPLICIT_WAIT
|
||||
|
||||
|
||||
def implicit_wait(wait_time):
|
||||
def wrapper(func):
|
||||
def wrapped(*args, **kwargs):
|
||||
browser.driver.implicitly_wait(wait_time)
|
||||
result = func(*args, **kwargs)
|
||||
browser.driver.implicitly_wait(SELENIUM_IMPLICIT_WAIT)
|
||||
return result
|
||||
return wrapped
|
||||
return wrapper
|
|
@ -1,100 +0,0 @@
|
|||
import time
|
||||
|
||||
from pageobjects.base import PageObject
|
||||
from pageobjects.base import Popup
|
||||
from pageobjects.tabs import Tabs
|
||||
|
||||
|
||||
class Actions(PageObject):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.environment-action-form input')
|
||||
|
||||
@property
|
||||
def rename(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.rename-environment-btn')
|
||||
|
||||
@property
|
||||
def delete(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.delete-environment-btn')
|
||||
|
||||
@property
|
||||
def reset(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.reset-environment-btn')
|
||||
|
||||
@property
|
||||
def reset_popup(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath("//div[@class='modal-footer']/button"
|
||||
"[contains(@class,'reset-environment-btn')]")
|
||||
|
||||
@property
|
||||
def stop(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.stop-deployment-btn')
|
||||
|
||||
@property
|
||||
def progress(self):
|
||||
return self.parent.find_element_by_css_selector('.progress')
|
||||
|
||||
@property
|
||||
def pending_nodes(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath("//span[text()='Pending Addition']")
|
||||
|
||||
@property
|
||||
def cancel_popup(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath("//button[text()='Cancel']")
|
||||
|
||||
@property
|
||||
def verify_disabled_deploy(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
"//div[@class='deployment-control-item-box']/button[@disabled]")
|
||||
|
||||
@property
|
||||
def stop_deploy(self):
|
||||
return self.parent.find_element_by_css_selector('button.'
|
||||
'stop-deployment-btn')
|
||||
|
||||
@property
|
||||
def stop_deploy_popup(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath("//div[@class='modal-footer']/button"
|
||||
"[contains(@class,'stop-deployment-btn')]")
|
||||
|
||||
@classmethod
|
||||
def reset_env(cls):
|
||||
PageObject.click_element(Actions(), 'reset')
|
||||
PageObject.wait_element(Actions(), 'reset_popup')
|
||||
time.sleep(2)
|
||||
PageObject.click_element(Actions(), 'reset_popup')
|
||||
PageObject.click_element(Tabs(), 'nodes')
|
||||
PageObject.long_wait_element(Actions(), 'pending_nodes')
|
||||
|
||||
@classmethod
|
||||
def cancel_reset(cls):
|
||||
Actions().reset.click()
|
||||
PageObject.click_element(Actions(), 'cancel_popup')
|
||||
PageObject.click_element(Tabs(), 'nodes')
|
||||
|
||||
@classmethod
|
||||
def stop_deploy_process(cls):
|
||||
PageObject.click_element(Actions(), 'stop_deploy')
|
||||
PageObject.wait_element(Actions, "stop_deploy_popup")
|
||||
PageObject.click_element(Actions(), 'stop_deploy_popup')
|
||||
PageObject.click_element(Tabs(), 'nodes')
|
||||
PageObject.long_wait_element(Actions(), 'pending_nodes')
|
||||
|
||||
|
||||
class DeleteEnvironmentPopup(Popup):
|
||||
@property
|
||||
def delete(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'button.remove-cluster-btn')
|
|
@ -1,28 +0,0 @@
|
|||
from base import PageObject
|
||||
'''
|
||||
This class contains properties and methods
|
||||
for authorization in fuel ui interface
|
||||
author: Tatyana Dubyk /6th of Aug 2014
|
||||
'''
|
||||
|
||||
|
||||
class Authorization(PageObject):
|
||||
@property
|
||||
def authorization_window(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(".login-box")
|
||||
|
||||
@property
|
||||
def login_inputfield(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector("input[name='username']")
|
||||
|
||||
@property
|
||||
def password_inputfield(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector("input[name='password']")
|
||||
|
||||
@property
|
||||
def login_button(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(".btn.btn-success.login-btn")
|
|
@ -1,228 +0,0 @@
|
|||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.common.exceptions import StaleElementReferenceException
|
||||
from selenium.common.exceptions import WebDriverException
|
||||
from selenium.webdriver.support.wait import WebDriverWait
|
||||
import browser
|
||||
import time
|
||||
|
||||
|
||||
class PageObject:
|
||||
|
||||
XPATH_RADIO = '//div[@class="custom-tumbler" ' \
|
||||
'and input[@type="radio" and @name="{}" and @value="{}"]]'
|
||||
|
||||
XPATH_CHECKBOX = \
|
||||
'//div[@class="custom-tumbler" ' \
|
||||
'and input[@type="checkbox" and @name="{}"]]'
|
||||
|
||||
def __init__(self, parent=None):
|
||||
self.parent = parent or browser.driver
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def wait_until_moving(element, timeout=10):
|
||||
class Move:
|
||||
def __init__(self, elem):
|
||||
self.element = elem
|
||||
self.location = elem.location
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
loc = element.location
|
||||
res = self.location['x'] == loc['x'] \
|
||||
and self.location['y'] == loc['y']
|
||||
self.location = loc
|
||||
return res
|
||||
|
||||
wait = WebDriverWait(browser.driver, timeout)
|
||||
wait.until(Move(element))
|
||||
|
||||
@staticmethod
|
||||
def wait_until_exists(element, timeout=10):
|
||||
wait = WebDriverWait(browser.driver, timeout)
|
||||
try:
|
||||
wait.until(lambda driver: not element.is_displayed())
|
||||
except StaleElementReferenceException:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def wait_element(page_object, attribute, timeout=10):
|
||||
class El:
|
||||
def __init__(self, page_object, attribute):
|
||||
self.page_object = page_object
|
||||
self.attribute = attribute
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
try:
|
||||
getattr(self.page_object, attribute)
|
||||
return True
|
||||
except NoSuchElementException:
|
||||
return False
|
||||
|
||||
wait = WebDriverWait(browser.driver, timeout)
|
||||
wait.until(El(page_object, attribute))
|
||||
|
||||
@staticmethod
|
||||
def long_wait_element(page_object, attribute, timeout=40):
|
||||
class El:
|
||||
def __init__(self, page_object, attribute):
|
||||
self.page_object = page_object
|
||||
self.attribute = attribute
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
try:
|
||||
getattr(self.page_object, attribute)
|
||||
return True
|
||||
except (NoSuchElementException,
|
||||
StaleElementReferenceException):
|
||||
return False
|
||||
|
||||
wait = WebDriverWait(browser.driver, timeout)
|
||||
wait.until(El(page_object, attribute))
|
||||
|
||||
@staticmethod
|
||||
def click_element(page_object, *args):
|
||||
# get the list of attributes passed to the method
|
||||
attributes = [attribute for attribute in args]
|
||||
attempts = 0
|
||||
while attempts < 5:
|
||||
try:
|
||||
"""1, 3, 4 are the number of passed to the method attributes
|
||||
|
||||
1 means that only class name and one property
|
||||
were passed to the method
|
||||
3 means that class name, two properties and index
|
||||
of the element were passed to the method
|
||||
4 means that class name, three properties and index
|
||||
of the element were passed to the method
|
||||
"""
|
||||
if len(attributes) == 1:
|
||||
getattr(page_object, attributes[0]).click()
|
||||
elif len(attributes) == 3:
|
||||
getattr(getattr(page_object, attributes[0])
|
||||
[attributes[2]], attributes[1]).click()
|
||||
elif len(attributes) == 4:
|
||||
getattr(getattr(getattr(page_object,
|
||||
attributes[0])[attributes[3]],
|
||||
attributes[1]), attributes[2]).click()
|
||||
break
|
||||
except (StaleElementReferenceException, NoSuchElementException,
|
||||
WebDriverException):
|
||||
time.sleep(0.5)
|
||||
attempts += 1
|
||||
|
||||
@staticmethod
|
||||
def find_element(page_object, *args):
|
||||
attributes = [attribute for attribute in args]
|
||||
attempts = 0
|
||||
while attempts < 5:
|
||||
try:
|
||||
if len(attributes) == 1:
|
||||
return getattr(page_object, attributes[0])
|
||||
elif len(attributes) == 3:
|
||||
return getattr(getattr(page_object,
|
||||
attributes[0])[attributes[2]],
|
||||
attributes[1])
|
||||
elif len(attributes) == 4:
|
||||
return getattr(getattr(getattr(page_object,
|
||||
attributes[0])[attributes[3]],
|
||||
attributes[1]), attributes[2])
|
||||
break
|
||||
except (StaleElementReferenceException, NoSuchElementException,
|
||||
WebDriverException):
|
||||
time.sleep(0.5)
|
||||
attempts += 1
|
||||
|
||||
@staticmethod
|
||||
def get_text(page_object, *args):
|
||||
attributes = [attribute for attribute in args]
|
||||
attempts = 0
|
||||
while attempts < 5:
|
||||
try:
|
||||
if len(attributes) == 1:
|
||||
return getattr(page_object, attributes[0]).text
|
||||
elif len(attributes) == 3:
|
||||
return getattr(getattr(page_object,
|
||||
attributes[0])[attributes[2]],
|
||||
attributes[1]).text
|
||||
elif len(attributes) == 4:
|
||||
return getattr(getattr(getattr(page_object,
|
||||
attributes[0])[attributes[3]],
|
||||
attributes[1]), attributes[2]).text
|
||||
break
|
||||
except (StaleElementReferenceException, NoSuchElementException):
|
||||
time.sleep(0.5)
|
||||
attempts += 1
|
||||
|
||||
@staticmethod
|
||||
def get_lower_text(page_object, *args):
|
||||
attributes = [attribute for attribute in args]
|
||||
attempts = 0
|
||||
while attempts < 5:
|
||||
try:
|
||||
if len(attributes) == 1:
|
||||
return getattr(page_object, attributes[0]).text.lower()
|
||||
elif len(attributes) == 3:
|
||||
return getattr(getattr(page_object,
|
||||
attributes[0])[attributes[2]],
|
||||
attributes[1]).text.lower()
|
||||
elif len(attributes) == 4:
|
||||
return getattr(getattr(getattr(page_object,
|
||||
attributes[0])[attributes[3]],
|
||||
attributes[1]), attributes[2]).text.lower()
|
||||
break
|
||||
except (StaleElementReferenceException, NoSuchElementException):
|
||||
time.sleep(0.5)
|
||||
attempts += 1
|
||||
|
||||
|
||||
class Popup(PageObject):
|
||||
|
||||
def __init__(self):
|
||||
element = browser.driver.find_element_by_css_selector('div.modal')
|
||||
PageObject.__init__(self, element)
|
||||
time.sleep(0.5)
|
||||
# PageObject.wait_until_moving(self.parent)
|
||||
|
||||
def wait_until_exists(self):
|
||||
try:
|
||||
PageObject.wait_until_exists(
|
||||
browser.driver.
|
||||
find_element_by_css_selector('div.modal-backdrop'))
|
||||
except NoSuchElementException:
|
||||
pass
|
||||
|
||||
# Check that element is displayed
|
||||
@staticmethod
|
||||
def wait_until_element_will_be_displayed(self, element):
|
||||
try:
|
||||
wait = WebDriverWait(browser.driver, 3)
|
||||
wait.until(element.is_displayed())
|
||||
except NoSuchElementException:
|
||||
pass
|
||||
|
||||
@property
|
||||
def close_cross(self):
|
||||
return self.parent.find_element_by_css_selector('.close')
|
||||
|
||||
@property
|
||||
def header(self):
|
||||
return self.parent.find_element_by_css_selector('.modal-header > h3')
|
||||
|
||||
|
||||
class ConfirmPopup(Popup):
|
||||
|
||||
TEXT = 'Settings were modified but not saved'
|
||||
|
||||
@property
|
||||
def stay_on_page(self):
|
||||
return self.parent.find_element_by_css_selector('.btn-return')
|
||||
|
||||
@property
|
||||
def leave_page(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.proceed-btn')
|
|
@ -1,228 +0,0 @@
|
|||
from selenium.webdriver.support.select import Select
|
||||
from pageobjects.base import PageObject
|
||||
from pageobjects.base import Popup
|
||||
|
||||
|
||||
class Environments(PageObject):
|
||||
|
||||
@property
|
||||
def create_cluster_box(self):
|
||||
return self.parent.find_element_by_css_selector('div.create-cluster')
|
||||
|
||||
@property
|
||||
def create_cluster_boxes(self):
|
||||
return self.parent.find_elements_by_css_selector('a.clusterbox')
|
||||
|
||||
@property
|
||||
def deployed_environments_list(self):
|
||||
return self.find_element('#content>div .cluster-list')
|
||||
|
||||
@staticmethod
|
||||
def find_required_env(self, name):
|
||||
elements = []
|
||||
elements.append(
|
||||
self.parent.
|
||||
find_elements_by_css_selector('#content>div .cluster-list>div>a'))
|
||||
for env in elements:
|
||||
if env.text.contains(name):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class RedhatAccountPopup(Popup):
|
||||
|
||||
@property
|
||||
def license_rhsm(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('license-type', 'rhsm'))
|
||||
|
||||
@property
|
||||
def license_rhn(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('license-type', 'rhn'))
|
||||
|
||||
@property
|
||||
def redhat_username(self):
|
||||
return self.parent.find_element_by_name('username')
|
||||
|
||||
@property
|
||||
def redhat_password(self):
|
||||
return self.parent.find_element_by_name('password')
|
||||
|
||||
@property
|
||||
def redhat_satellite(self):
|
||||
return self.parent.find_element_by_name('satellite')
|
||||
|
||||
@property
|
||||
def redhat_activation_key(self):
|
||||
return self.parent.find_element_by_name('activation_key')
|
||||
|
||||
@property
|
||||
def apply(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.btn-os-download')
|
||||
|
||||
|
||||
class Wizard(Popup, RedhatAccountPopup):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.parent.find_element_by_name('name')
|
||||
|
||||
@property
|
||||
def release(self):
|
||||
return Select(self.parent.find_element_by_name('release'))
|
||||
|
||||
@property
|
||||
def next(self):
|
||||
return self.parent.find_element_by_css_selector('button.next-pane-btn')
|
||||
|
||||
@property
|
||||
def create(self):
|
||||
return self.parent. \
|
||||
find_element_by_css_selector('button.finish-btn')
|
||||
|
||||
@property
|
||||
def cancel(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.btn[data-dismiss=modal]')
|
||||
|
||||
@property
|
||||
def prev(self):
|
||||
return self.parent.find_element_by_css_selector('button.prev-pane-btn')
|
||||
|
||||
@property
|
||||
def mode_multinode(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_RADIO.format('mode', 'multinode'))
|
||||
|
||||
@property
|
||||
def mode_ha_compact(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('mode', 'ha_compact'))
|
||||
|
||||
@property
|
||||
def hypervisor_kvm(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_RADIO.format('hypervisor', 'kvm'))
|
||||
|
||||
@property
|
||||
def hypervisor_qemu(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('hypervisor', 'qemu'))
|
||||
|
||||
@property
|
||||
def network_nova(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('manager', 'nova-network'))
|
||||
|
||||
@property
|
||||
def network_neutron_gre(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('manager', 'neutron-gre'))
|
||||
|
||||
@property
|
||||
def network_neutron_vlan(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('manager', 'neutron-vlan'))
|
||||
|
||||
@property
|
||||
def storage_cinder_default(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('cinder', 'default'))
|
||||
|
||||
@property
|
||||
def storage_cinder_ceph(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('cinder', 'ceph'))
|
||||
|
||||
@property
|
||||
def storage_glance_default(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('glance', 'default'))
|
||||
|
||||
@property
|
||||
def storage_glance_ceph(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('glance', 'ceph'))
|
||||
|
||||
@property
|
||||
def install_sahara(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_CHECKBOX.format('sahara'))
|
||||
|
||||
@property
|
||||
def install_murano(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_CHECKBOX.format('murano'))
|
||||
|
||||
@property
|
||||
def install_ceilometer(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_CHECKBOX.format('ceilometer'))
|
||||
|
||||
@property
|
||||
def compute_vcenter(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.custom-tumbler>input[value="vcenter"]')
|
||||
|
||||
# properties for creation of vCenter hypervisor
|
||||
@property
|
||||
def vcenter_ip_inputfield(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'div[data-attribute="host_ip"]>div>input')
|
||||
|
||||
@property
|
||||
def vcenter_username_inputfield(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'div[data-attribute="vc_user"]>div>input')
|
||||
|
||||
@property
|
||||
def vcenter_password_inputfield(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'div[data-attribute="vc_password"]>div>input')
|
||||
|
||||
@property
|
||||
def vcenter_cluster_inputfield(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'div[data-attribute="cluster"]>div>input')
|
||||
|
||||
@property
|
||||
def vcenter_cluster_created_name(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.cluster-name').text.lower().replace(" ", "")
|
||||
|
||||
|
||||
class DeployChangesPopup(Popup):
|
||||
|
||||
@property
|
||||
def deploy(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.start-deployment-btn')
|
||||
|
||||
|
||||
class DiscardChangesPopup(Popup):
|
||||
|
||||
@property
|
||||
def discard(self):
|
||||
return self.parent.find_element_by_css_selector('.discard-btn')
|
|
@ -1,58 +0,0 @@
|
|||
import browser
|
||||
from decorators import implicit_wait
|
||||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class Header(PageObject):
|
||||
|
||||
@property
|
||||
def logo(self):
|
||||
return self.parent.find_element_by_css_selector('div.logo')
|
||||
|
||||
@property
|
||||
def environments(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.navigation-bar-ul '
|
||||
'a[href$=clusters]')
|
||||
|
||||
@property
|
||||
def releases(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.navigation-bar-ul '
|
||||
'a[href$=releases]')
|
||||
|
||||
@property
|
||||
def support(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.navigation-bar-ul a[href$=support]')
|
||||
|
||||
@property
|
||||
def breadcrumb(self):
|
||||
return self.parent.find_element_by_css_selector('.breadcrumb')
|
||||
|
||||
@property
|
||||
def total_nodes(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('div.total-nodes-count')
|
||||
|
||||
@property
|
||||
def unallocated_nodes(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath("//div[@class='statistic']/div[3]")
|
||||
|
||||
|
||||
class TaskResultAlert(PageObject):
|
||||
|
||||
@implicit_wait(60)
|
||||
def __init__(self):
|
||||
element = browser.driver.\
|
||||
find_element_by_css_selector('div.alert-success')
|
||||
PageObject.__init__(self, element)
|
||||
|
||||
@property
|
||||
def close(self):
|
||||
return self.parent.find_element_by_css_selector('button.close')
|
||||
|
||||
@property
|
||||
def header(self):
|
||||
return self.parent.find_element_by_css_selector('h4')
|
|
@ -1,213 +0,0 @@
|
|||
import browser
|
||||
from decorators import implicit_wait
|
||||
from pageobjects.base import PageObject
|
||||
from selenium.webdriver.support.select import Select
|
||||
|
||||
|
||||
class Networks(PageObject):
|
||||
@property
|
||||
def flatdhcp_manager(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('net-manager', 'FlatDHCPManager'))
|
||||
|
||||
@property
|
||||
def vlan_manager(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('net-manager', 'VlanManager'))
|
||||
|
||||
@property
|
||||
def segmentation_type(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('span.network-segment-type')
|
||||
|
||||
@property
|
||||
def public(self):
|
||||
return Network('Public')
|
||||
|
||||
@property
|
||||
def floating(self):
|
||||
return Network('Floating')
|
||||
|
||||
@property
|
||||
def management(self):
|
||||
return Network('Management')
|
||||
|
||||
@property
|
||||
def storage(self):
|
||||
return Network('Storage')
|
||||
|
||||
@property
|
||||
def fixed(self):
|
||||
return Network('Nova-network Configuration')
|
||||
|
||||
@property
|
||||
def neutron(self):
|
||||
return NeutronParameters()
|
||||
|
||||
@property
|
||||
def dns1(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.dns_nameservers-row input[name=range0]')
|
||||
|
||||
@property
|
||||
def dns2(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.dns_nameservers-row input[name=range1]')
|
||||
|
||||
@property
|
||||
@implicit_wait(20)
|
||||
def verification_alert(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.verification-control .alert')
|
||||
|
||||
@property
|
||||
def verify_networks(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//button[text()="Verify Networks"]')
|
||||
|
||||
@property
|
||||
def cancel_changes(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//button[text()="Cancel Changes"]')
|
||||
|
||||
@property
|
||||
def save_settings(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//button[text()="Save Settings"]')
|
||||
|
||||
|
||||
class Network(PageObject):
|
||||
XPATH_PARAMETER = './/div[contains(@class,"network-attribute") and ' \
|
||||
'div[contains(@class,"parameter-name")]="{}"]'
|
||||
|
||||
XPATH_PARAMETER_RANGES = \
|
||||
XPATH_PARAMETER + \
|
||||
'/div[@class="ip-ranges-rows"]/div[contains(@class,"range-row")]'
|
||||
|
||||
def __init__(self, name):
|
||||
el = browser.driver.\
|
||||
find_element_by_xpath('//div[legend="{}"]'.format(name))
|
||||
PageObject.__init__(self, el)
|
||||
|
||||
@property
|
||||
def ip_ranges(self):
|
||||
elements = self.parent.find_elements_by_xpath(
|
||||
self.XPATH_PARAMETER_RANGES.format('IP Range'))
|
||||
return [IpRange(el) for el in elements]
|
||||
|
||||
@property
|
||||
def vlan_tagging(self):
|
||||
return self.parent.find_element_by_css_selector('div.custom-tumbler')
|
||||
|
||||
@property
|
||||
def vlan_id(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('input[name$=vlan_start]')
|
||||
|
||||
@property
|
||||
def vlan_end(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('input[name$=vlan_end]')
|
||||
|
||||
@property
|
||||
def netmask(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('input[name$=netmask]')
|
||||
|
||||
@property
|
||||
def gateway(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('input[name$=gateway]')
|
||||
|
||||
@property
|
||||
def cidr(self):
|
||||
return self.parent.find_element_by_css_selector('input[name$=cidr]')
|
||||
|
||||
@property
|
||||
def number_of_networks(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('input[name$=amount]')
|
||||
|
||||
@property
|
||||
def network_size(self):
|
||||
return Select(
|
||||
self.parent.
|
||||
find_element_by_css_selector('select[name$=network_size]'))
|
||||
|
||||
|
||||
class NeutronParameters(PageObject):
|
||||
def __init__(self):
|
||||
el = browser.driver.\
|
||||
find_element_by_css_selector('div.networking-parameters')
|
||||
PageObject.__init__(self, el)
|
||||
|
||||
@property
|
||||
def id_start(self):
|
||||
return self.parent.find_element_by_css_selector('input[name=range0]')
|
||||
|
||||
@property
|
||||
def id_end(self):
|
||||
return self.parent.find_element_by_css_selector('input[name=range1]')
|
||||
|
||||
@property
|
||||
def base_mac(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('input[name=base_mac]')
|
||||
|
||||
@property
|
||||
def floating_start(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.floating-ranges-rows input[name=range0]')
|
||||
|
||||
@property
|
||||
def floating_end(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.floating-ranges-rows input[name=range1]')
|
||||
|
||||
@property
|
||||
def cidr(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('input[name=internal_cidr]')
|
||||
|
||||
@property
|
||||
def gateway(self):
|
||||
return self.parent.find_element_by_css_selector(
|
||||
'input[name=internal_gateway]')
|
||||
|
||||
@property
|
||||
def nameserver0(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.dns_nameservers-row input[name=range0]')
|
||||
|
||||
@property
|
||||
def nameserver1(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector(
|
||||
'.dns_nameservers-row input[name=range1]')
|
||||
|
||||
|
||||
class IpRange(PageObject):
|
||||
|
||||
@property
|
||||
def start(self):
|
||||
return self.parent.find_element_by_css_selector('input[name=range0]')
|
||||
|
||||
@property
|
||||
def end(self):
|
||||
return self.parent.find_element_by_css_selector('input[name=range1]')
|
||||
|
||||
@property
|
||||
def icon_plus(self):
|
||||
return self.parent.find_element_by_css_selector('button.ip-ranges-add')
|
||||
|
||||
@property
|
||||
def icon_minus(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.ip-ranges-delete')
|
|
@ -1,121 +0,0 @@
|
|||
from pageobjects.base import PageObject
|
||||
from pageobjects.settings import SettingsFooter
|
||||
|
||||
|
||||
class DisksSettings(PageObject, SettingsFooter):
|
||||
|
||||
@property
|
||||
def disks(self):
|
||||
elements = self.parent.\
|
||||
find_elements_by_css_selector('div.node-disks > div')
|
||||
return [Disk(el) for el in elements]
|
||||
|
||||
|
||||
class Disk(PageObject):
|
||||
|
||||
XPATH_INFORMATION_ITEM = './/div[@class="disk-map-details-item" and ' \
|
||||
'div[@class="disk-map-details-name"]="{}"]' \
|
||||
'/div[@class="disk-map-details-parameter"]'
|
||||
|
||||
def __init__(self, element):
|
||||
PageObject.__init__(self, element)
|
||||
|
||||
@property
|
||||
def volume_os(self):
|
||||
return Volume(self.parent.find_element_by_css_selector(
|
||||
'div.volume-group.os > .toggle-volume'))
|
||||
|
||||
@property
|
||||
def volume_image(self):
|
||||
return Volume(self.parent.find_element_by_css_selector(
|
||||
'div.volume-group.image > .toggle-volume'))
|
||||
|
||||
@property
|
||||
def volume_storage(self):
|
||||
return Volume(self.parent.find_element_by_css_selector(
|
||||
'div.volume-group.vm > .toggle-volume'))
|
||||
|
||||
@property
|
||||
def volume_unallocated(self):
|
||||
return Volume(self.parent.find_element_by_css_selector(
|
||||
'div.volume-group.unallocated > .toggle-volume'))
|
||||
|
||||
@property
|
||||
def volume_group_os(self):
|
||||
return VolumeGroup(self.parent.find_element_by_css_selector(
|
||||
'div.volume-group-box[data-volume=os]'
|
||||
))
|
||||
|
||||
@property
|
||||
def volume_group_image(self):
|
||||
return VolumeGroup(self.parent.find_element_by_css_selector(
|
||||
'div.volume-group-box[data-volume=image]'
|
||||
))
|
||||
|
||||
@property
|
||||
def volume_group_storage(self):
|
||||
return VolumeGroup(self.parent.find_element_by_css_selector(
|
||||
'div.volume-group-box[data-volume=vm]'
|
||||
))
|
||||
|
||||
@property
|
||||
def details_panel(self):
|
||||
return self.parent.find_element_by_css_selector('.disk-map-details')
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_INFORMATION_ITEM.format('name'))
|
||||
|
||||
@property
|
||||
def model(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_INFORMATION_ITEM.format('model'))
|
||||
|
||||
@property
|
||||
def disk(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_INFORMATION_ITEM.format('disk'))
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_INFORMATION_ITEM.format('size'))
|
||||
|
||||
|
||||
class Volume(PageObject):
|
||||
|
||||
def __init__(self, element):
|
||||
PageObject.__init__(self, element)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.parent.find_element_by_css_selector('.volume-group-name')
|
||||
|
||||
@property
|
||||
def size(self):
|
||||
return self.parent.find_element_by_css_selector('.volume-group-size')
|
||||
|
||||
@property
|
||||
def close_cross(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('./../div[contains(@class, "close-btn")]')
|
||||
|
||||
|
||||
class VolumeGroup(PageObject):
|
||||
|
||||
def __init__(self, element):
|
||||
PageObject.__init__(self, element)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.volume-group-box-name')
|
||||
|
||||
@property
|
||||
def use_all(self):
|
||||
return self.parent.find_element_by_css_selector('.use-all-allowed')
|
||||
|
||||
@property
|
||||
def input(self):
|
||||
return self.parent.find_element_by_tag_name('input')
|
|
@ -1,46 +0,0 @@
|
|||
from pageobjects.base import PageObject
|
||||
from pageobjects.settings import SettingsFooter
|
||||
from selenium.webdriver.support.select import Select
|
||||
|
||||
|
||||
class InterfacesSettings(PageObject, SettingsFooter):
|
||||
|
||||
@property
|
||||
def interfaces(self):
|
||||
elements = self.parent.\
|
||||
find_elements_by_css_selector('.physical-network-box')
|
||||
return [Interface(e) for e in elements]
|
||||
|
||||
|
||||
class Interface(PageObject):
|
||||
|
||||
def __init__(self, element):
|
||||
PageObject.__init__(self, element)
|
||||
|
||||
@property
|
||||
def info(self):
|
||||
return self.parent.find_element_by_css_selector('.network-info-box')
|
||||
|
||||
@property
|
||||
def networks_box(self):
|
||||
return self.parent.find_element_by_css_selector('.logical-network-box')
|
||||
|
||||
@property
|
||||
def networks(self):
|
||||
elements = self.parent.\
|
||||
find_elements_by_css_selector('.logical-network-item')
|
||||
return {el.find_element_by_css_selector('.name').text.lower(): el
|
||||
for el in elements}
|
||||
|
||||
@property
|
||||
def interface_checkbox(self):
|
||||
return self.parent.find_element_by_css_selector('.custom-tumbler')
|
||||
|
||||
@property
|
||||
def bond_mode(self):
|
||||
return self.parent.find_element_by_css_selector('.network-bond-mode')
|
||||
|
||||
@property
|
||||
def select_mode(self):
|
||||
return Select(
|
||||
self.parent.find_element_by_css_selector('select[name=mode]'))
|
|
@ -1,186 +0,0 @@
|
|||
from selenium.webdriver.support.select import Select
|
||||
from pageobjects.base import PageObject
|
||||
from pageobjects.base import Popup
|
||||
|
||||
|
||||
class Nodes(PageObject):
|
||||
|
||||
@property
|
||||
def env_summary(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.cluster-summary-placeholder')
|
||||
|
||||
@property
|
||||
def env_name(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('.cluster-name-placeholder')
|
||||
|
||||
@property
|
||||
def deploy_changes(self):
|
||||
return self.parent.find_element_by_css_selector('button.deploy-btn')
|
||||
|
||||
@property
|
||||
def discard_changes(self):
|
||||
return self.parent.find_element_by_css_selector('button.rollback')
|
||||
|
||||
@property
|
||||
def progress_deployment(self):
|
||||
return self.parent.find_element_by_css_selector('.progress-deploy')
|
||||
|
||||
@property
|
||||
def group_by(self):
|
||||
return Select(
|
||||
self.parent.find_element_by_css_selector('select[name=grouping]'))
|
||||
|
||||
@property
|
||||
def add_nodes(self):
|
||||
return self.parent.find_element_by_css_selector('button.btn-add-nodes')
|
||||
|
||||
@property
|
||||
def delete_nodes(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.btn-delete-nodes')
|
||||
|
||||
@property
|
||||
def edit_roles(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.btn-edit-nodes')
|
||||
|
||||
@property
|
||||
def configure_interfaces(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.btn-configure-interfaces')
|
||||
|
||||
@property
|
||||
def apply_changes(self):
|
||||
return self.parent.find_element_by_css_selector('button.btn-apply')
|
||||
|
||||
@property
|
||||
def configure_disks(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('button.btn-configure-disks')
|
||||
|
||||
@property
|
||||
def nodes(self):
|
||||
elements = self.parent.find_elements_by_css_selector('.node-box')
|
||||
return [NodeContainer(el) for el in elements]
|
||||
|
||||
@property
|
||||
def nodes_discovered(self):
|
||||
elements = self.parent.\
|
||||
find_elements_by_css_selector('.node-box.discover')
|
||||
return [NodeContainer(el) for el in elements]
|
||||
|
||||
@property
|
||||
def nodes_offline(self):
|
||||
elements = self.parent.\
|
||||
find_elements_by_css_selector('.node-box.node-offline')
|
||||
return [NodeContainer(el) for el in elements]
|
||||
|
||||
@property
|
||||
def nodes_error(self):
|
||||
elements = self.parent.\
|
||||
find_elements_by_css_selector('.node-box.error')
|
||||
return [NodeContainer(el) for el in elements]
|
||||
|
||||
@property
|
||||
def select_all(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('[name=select-nodes-common]')
|
||||
|
||||
@property
|
||||
def select_all_in_group(self):
|
||||
return self.parent.\
|
||||
find_elements_by_css_selector('[name=select-node-group]')
|
||||
|
||||
@property
|
||||
def node_groups(self):
|
||||
elements = self.parent.find_elements_by_css_selector('.node-groups')
|
||||
return [Nodes(el) for el in elements]
|
||||
|
||||
@classmethod
|
||||
def add_controller_compute_nodes(cls):
|
||||
PageObject.click_element(Nodes(), 'add_nodes')
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
PageObject.wait_until_exists(Nodes().apply_changes)
|
||||
PageObject.click_element(Nodes(), 'add_nodes')
|
||||
PageObject.click_element(Nodes(), 'nodes_discovered', 'checkbox', 0)
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
PageObject.wait_until_exists(Nodes().apply_changes)
|
||||
|
||||
|
||||
class NodeContainer(PageObject):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.parent.find_element_by_css_selector('div.name > p')
|
||||
|
||||
@property
|
||||
def name_input(self):
|
||||
return self.parent.find_element_by_css_selector('div.name > input')
|
||||
|
||||
@property
|
||||
def checkbox(self):
|
||||
return self.parent.find_element_by_css_selector('div.node-checkbox')
|
||||
|
||||
@property
|
||||
def roles(self):
|
||||
return self.parent.find_element_by_css_selector('div.role-list')
|
||||
|
||||
@property
|
||||
def details(self):
|
||||
return self.parent.find_element_by_css_selector('.node-details')
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
return self.parent.find_element_by_css_selector('.node-status-label')
|
||||
|
||||
|
||||
class RolesPanel(PageObject):
|
||||
|
||||
XPATH_ROLE = '//label[contains(., "{}")]/input'
|
||||
|
||||
@property
|
||||
def controller(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_ROLE.format('Controller'))
|
||||
|
||||
@property
|
||||
def compute(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_ROLE.format('Compute'))
|
||||
|
||||
@property
|
||||
def cinder(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_ROLE.format('Cinder'))
|
||||
|
||||
@property
|
||||
def ceph_osd(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_ROLE.format('Ceph OSD'))
|
||||
|
||||
|
||||
class NodeInfo(Popup):
|
||||
|
||||
@property
|
||||
def edit_networks(self):
|
||||
return self.parent.find_element_by_css_selector('.btn-edit-networks')
|
||||
|
||||
@property
|
||||
def edit_disks(self):
|
||||
return self.parent.find_element_by_css_selector('.btn-edit-disks')
|
||||
|
||||
@property
|
||||
def close(self):
|
||||
return self.parent.find_element_by_css_selector('.node-modal-close')
|
||||
|
||||
|
||||
class DeleteNodePopup(Popup):
|
||||
|
||||
@property
|
||||
def delete(self):
|
||||
return self.parent.find_element_by_css_selector('.btn-delete')
|
|
@ -1,39 +0,0 @@
|
|||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class Releases(PageObject):
|
||||
|
||||
@property
|
||||
def dict(self):
|
||||
elements = self.parent.\
|
||||
find_elements_by_css_selector('div.table-releases-box tbody > tr')
|
||||
return {Release(el).name.text: Release(el) for el in elements}
|
||||
|
||||
@property
|
||||
def rhel_setup(self):
|
||||
return self.parent.find_element_by_css_selector('.btn-rhel-setup')
|
||||
|
||||
|
||||
class Release(PageObject):
|
||||
|
||||
def __init__(self, element):
|
||||
PageObject.__init__(self, parent=element)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.parent.find_element_by_css_selector(
|
||||
'.enable-selection:nth-child(1)')
|
||||
|
||||
@property
|
||||
def version(self):
|
||||
return self.parent.find_element_by_css_selector(
|
||||
'.enable-selection:nth-child(2)')
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
return self.parent.find_element_by_css_selector(
|
||||
'.enable-selection:nth-child(3)')
|
||||
|
||||
@property
|
||||
def download_progress(self):
|
||||
return self.parent.find_element_by_css_selector('.download_progress')
|
|
@ -1,210 +0,0 @@
|
|||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class SettingsFooter(PageObject):
|
||||
|
||||
@property
|
||||
def back_to_node_list(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//button[text()="Back To Node List"]')
|
||||
|
||||
@property
|
||||
def load_defaults(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//button[text()="Load Defaults"]')
|
||||
|
||||
@property
|
||||
def cancel_changes(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//button[text()="Cancel Changes"]')
|
||||
|
||||
@property
|
||||
def save_settings(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//button[text()="Save Settings"]')
|
||||
|
||||
@property
|
||||
def apply(self):
|
||||
return self.parent.find_element_by_xpath('//button[text()="Apply"]')
|
||||
|
||||
@property
|
||||
def bond_interfaces(self):
|
||||
return self.parent.find_element_by_css_selector('button.btn-bond')
|
||||
|
||||
@property
|
||||
def unbond_interfaces(self):
|
||||
return self.parent.find_element_by_css_selector('button.btn-unbond')
|
||||
|
||||
|
||||
class Settings(PageObject, SettingsFooter):
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self.parent.find_element_by_name('access.user')
|
||||
|
||||
@property
|
||||
def password(self):
|
||||
return self.parent.find_element_by_name('access.password')
|
||||
|
||||
@property
|
||||
def show_password(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath('//div[input[@name="access.password"]]/span')
|
||||
|
||||
@property
|
||||
def tenant(self):
|
||||
return self.parent.find_element_by_name('access.tenant')
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
return self.parent.find_element_by_name('access.email')
|
||||
|
||||
@property
|
||||
def install_sahara(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('additional_components.sahara'))
|
||||
|
||||
@property
|
||||
def install_murano(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('additional_components.murano'))
|
||||
|
||||
@property
|
||||
def install_ceilometer(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('additional_components.ceilometer'))
|
||||
|
||||
@property
|
||||
def debug(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format('common.debug'))
|
||||
|
||||
@property
|
||||
def hypervisor_kvm(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_RADIO.format
|
||||
('common.libvirt_type', 'kvm'))
|
||||
|
||||
@property
|
||||
def hypervisor_qemu(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_RADIO.format
|
||||
('common.libvirt_type', 'qemu'))
|
||||
|
||||
@property
|
||||
def assign_ip(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_CHECKBOX.format('common.auto_assign_floating_ip'))
|
||||
|
||||
@property
|
||||
def filter_scheduler(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_RADIO.format(
|
||||
'common.compute_scheduler_driver',
|
||||
'nova.scheduler.filter_scheduler.FilterScheduler'))
|
||||
|
||||
@property
|
||||
def simple_scheduler(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_RADIO.format(
|
||||
'common.compute_scheduler_driver',
|
||||
'nova.scheduler.simple.SimpleScheduler'))
|
||||
|
||||
@property
|
||||
def vlan_splinters(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format(
|
||||
'vlan_splinters.enabled'))
|
||||
|
||||
@property
|
||||
def vlan_splinters_disabled(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('vlan_splinters', 'disabled'))
|
||||
|
||||
@property
|
||||
def vlan_splinters_soft(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('vlan_splinters.vswitch', 'soft'))
|
||||
|
||||
@property
|
||||
def vlan_splinters_hard(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_RADIO.format('vlan_splinters.vswitch', 'hard'))
|
||||
|
||||
@property
|
||||
def use_cow_images(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_CHECKBOX.format('common.use_cow_images'))
|
||||
|
||||
@property
|
||||
def start_guests(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(
|
||||
self.XPATH_CHECKBOX.format(
|
||||
'common.resume_guests_state_on_host_boot'))
|
||||
|
||||
@property
|
||||
def auth_key(self):
|
||||
return self.parent.find_element_by_name('common.auth_key')
|
||||
|
||||
@property
|
||||
def syslog_server(self):
|
||||
return self.parent.find_element_by_name('syslog.syslog_server')
|
||||
|
||||
@property
|
||||
def syslog_port(self):
|
||||
return self.parent.find_element_by_name('syslog.syslog_port')
|
||||
|
||||
@property
|
||||
def syslog_udp(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_RADIO.format(
|
||||
'syslog.syslog_transport', 'udp'))
|
||||
|
||||
@property
|
||||
def syslog_tcp(self):
|
||||
return self.parent.find_element_by_xpath(
|
||||
self.XPATH_RADIO.format(
|
||||
'syslog.syslog_transport', 'tcp'))
|
||||
|
||||
@property
|
||||
def cinder_for_volumes(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('storage.volumes_lvm'))
|
||||
|
||||
@property
|
||||
def ceph_for_volumes(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('storage.volumes_ceph'))
|
||||
|
||||
@property
|
||||
def ceph_for_images(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('storage.images_ceph'))
|
||||
|
||||
@property
|
||||
def ceph_ephemeral(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('storage.ephemeral_ceph'))
|
||||
|
||||
@property
|
||||
def ceph_rados_gw(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_CHECKBOX.format
|
||||
('storage.objects_ceph'))
|
||||
|
||||
@property
|
||||
def ceph_factor(self):
|
||||
return self.parent.find_element_by_name('storage.osd_pool_size')
|
|
@ -1,29 +0,0 @@
|
|||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class Support(PageObject):
|
||||
|
||||
@property
|
||||
def register_fuel(self):
|
||||
return self.parent.find_element_by_link_text('Register Fuel')
|
||||
|
||||
@property
|
||||
def contact_support(self):
|
||||
return self.parent.find_element_by_link_text('Contact Support')
|
||||
|
||||
@property
|
||||
def generate_snapshot(self):
|
||||
return self.parent.find_element_by_css_selector('.snapshot > button')
|
||||
|
||||
@property
|
||||
def download_snapshot(self):
|
||||
return self.parent.\
|
||||
find_element_by_css_selector('span.ready > a')
|
||||
|
||||
@property
|
||||
def view_capacity_audit(self):
|
||||
return self.parent.find_element_by_link_text('View Capacity Audit')
|
||||
|
||||
@property
|
||||
def capacity_report(self):
|
||||
return self.parent.find_element_by_css_selector('.btn.btn-info')
|
|
@ -1,36 +0,0 @@
|
|||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class Tabs(PageObject):
|
||||
|
||||
XPATH_TAB = '//ul/li/a[div/text()="{}"]'
|
||||
|
||||
@property
|
||||
def nodes(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_TAB.format('Nodes'))
|
||||
|
||||
@property
|
||||
def networks(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_TAB.format('Networks'))
|
||||
|
||||
@property
|
||||
def settings(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_TAB.format('Settings'))
|
||||
|
||||
@property
|
||||
def logs(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_TAB.format('Logs'))
|
||||
|
||||
@property
|
||||
def health_check(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_TAB.format('Health Check'))
|
||||
|
||||
@property
|
||||
def actions(self):
|
||||
return self.parent.\
|
||||
find_element_by_xpath(self.XPATH_TAB.format('Actions'))
|
|
@ -1,2 +0,0 @@
|
|||
selenium
|
||||
pyvirtualdisplay
|
|
@ -1,40 +0,0 @@
|
|||
import os
|
||||
import re
|
||||
|
||||
BROWSER = os.environ.get('BROWSER', 'firefox')
|
||||
|
||||
# download it here http://chromedriver.storage.googleapis.com/index.html
|
||||
CHROME_EXECUTABLE_PATH = \
|
||||
os.environ.get('CHROME_EXECUTABLE_PATH', '/usr/bin/google-chrome')
|
||||
|
||||
NAILGUN_FOLDER = os.environ.get('NAILGUN_FOLDER')
|
||||
|
||||
FOLDER_SCREEN_EXPECTED = os.environ.get(
|
||||
'FOLDER_SCREEN_EXPECTED', '/home/nfedotov/testscreens/expected')
|
||||
FOLDER_SCREEN_CURRENT = os.environ.get(
|
||||
'FOLDER_SCREEN_CURRENT', '/home/nfedotov/testscreens/current')
|
||||
|
||||
OPENSTACK_RELEASE_CENTOS = os.environ.get(
|
||||
'OPENSTACK_RELEASE_CENTOS', 'Icehouse on CentOS 6.5 (2014.2-6.0)')
|
||||
OPENSTACK_RELEASE_REDHAT = os.environ.get(
|
||||
'OPENSTACK_RELEASE_REDHAT', 'RHOS 3.0 for RHEL 6.4 (2013.2.2)')
|
||||
OPENSTACK_RELEASE_UBUNTU = os.environ.get(
|
||||
'OPENSTACK_RELEASE_UBUNTU', 'Icehouse on Ubuntu 12.04.4 (2014.2-6.0)')
|
||||
|
||||
REDHAT_USERNAME = os.environ.get('REDHAT_USERNAME', 'rheltest')
|
||||
REDHAT_PASSWORD = os.environ.get('REDHAT_PASSWORD', 'password')
|
||||
REDHAT_SATELLITE = os.environ.get('REDHAT_SATELLITE', 'satellite.example.com')
|
||||
REDHAT_ACTIVATION_KEY = os.environ.get(
|
||||
'REDHAT_ACTIVATION_KEY', '1234567890')
|
||||
|
||||
openstack_name = lambda release: re.sub('\s\\(.*?\\)$', '', release)
|
||||
OPENSTACK_CENTOS = openstack_name(OPENSTACK_RELEASE_CENTOS)
|
||||
OPENSTACK_REDHAT = openstack_name(OPENSTACK_RELEASE_REDHAT)
|
||||
OPENSTACK_UBUNTU = openstack_name(OPENSTACK_RELEASE_UBUNTU)
|
||||
|
||||
NAILGUN_FIXTURES = os.environ.get('NAILGUN_FIXTURES', '')
|
||||
|
||||
URL_HOME = os.environ.get('URL_HOME', 'http://localhost:8000')
|
||||
SELENIUM_IMPLICIT_WAIT = os.environ.get('SELENIUM_IMPLICIT_WAIT', 10)
|
||||
Fuel_UI_Login = 'admin'
|
||||
Fuel_UI_Password = 'admin'
|
|
@ -1,17 +0,0 @@
|
|||
(dp1
|
||||
S'failed'
|
||||
p2
|
||||
(lp3
|
||||
S'1'
|
||||
asS'source_names'
|
||||
p4
|
||||
(lp5
|
||||
S'tests'
|
||||
p6
|
||||
asS'ids'
|
||||
p7
|
||||
(dp8
|
||||
I1
|
||||
(Ng6
|
||||
Ntp9
|
||||
ss.
|
|
@ -1,104 +0,0 @@
|
|||
import base64
|
||||
from io import BytesIO
|
||||
from unittest import TestCase
|
||||
from PIL import Image
|
||||
import operator
|
||||
import math
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
import time
|
||||
import browser
|
||||
from pageobjects.header import Header
|
||||
from settings import FOLDER_SCREEN_CURRENT
|
||||
from settings import FOLDER_SCREEN_EXPECTED
|
||||
from settings import NAILGUN_FIXTURES
|
||||
from settings import URL_HOME
|
||||
from settings import Fuel_UI_Login
|
||||
from settings import Fuel_UI_Password
|
||||
from pageobjects.authorization import Authorization
|
||||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class BaseTestCase(TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
browser.start_driver()
|
||||
cls.clear_nailgun_database()
|
||||
cls.get_home()
|
||||
cls.aut()
|
||||
|
||||
@classmethod
|
||||
def aut(cls):
|
||||
Authorization().login_inputfield.click()
|
||||
Authorization().login_inputfield.send_keys(Fuel_UI_Login)
|
||||
Authorization().password_inputfield.click()
|
||||
Authorization().password_inputfield.send_keys(Fuel_UI_Password)
|
||||
Authorization().login_button.click()
|
||||
PageObject.wait_until_exists(Header().logo)
|
||||
Header().logo.is_displayed()
|
||||
browser.driver.execute_script('jQuery.fx.off = true')
|
||||
browser.driver.execute_script('''
|
||||
$('head').append(
|
||||
'<style type="text/css">
|
||||
* {
|
||||
-webkit-transition-duration: 0.00000001s !important;
|
||||
-moz-transition: 0.00000001s !important;
|
||||
transition-duration: 0.00000001s !important;
|
||||
}
|
||||
</style>')
|
||||
'''.replace('\n', ''))
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
browser.quit_driver()
|
||||
|
||||
def setUp(self):
|
||||
self.get_home()
|
||||
|
||||
@staticmethod
|
||||
def get_home():
|
||||
for i in range(5):
|
||||
try:
|
||||
browser.driver.get(URL_HOME)
|
||||
break
|
||||
except NoSuchElementException:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def refresh():
|
||||
for i in range(5):
|
||||
try:
|
||||
browser.driver.refresh()
|
||||
time.sleep(0.5)
|
||||
Header().logo.is_displayed()
|
||||
break
|
||||
except NoSuchElementException:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def clear_nailgun_database():
|
||||
from nailgun.db import dropdb
|
||||
from nailgun.db import syncdb
|
||||
from nailgun.db.sqlalchemy import fixman
|
||||
dropdb()
|
||||
syncdb()
|
||||
fixman.upload_fixtures()
|
||||
for fixture in NAILGUN_FIXTURES.split(':'):
|
||||
if fixture == '':
|
||||
continue
|
||||
with open(fixture, "r") as fileobj:
|
||||
fixman.upload_fixture(fileobj)
|
||||
|
||||
def assert_screen(self, name):
|
||||
img_exp = Image.open('{}/{}.png'.format(FOLDER_SCREEN_EXPECTED, name))
|
||||
|
||||
img_cur_base64 = browser.driver.get_screenshot_as_base64()
|
||||
img_cur = Image.open(BytesIO(base64.decodestring(img_cur_base64)))
|
||||
img_cur.save('{}/{}.png'.format(FOLDER_SCREEN_CURRENT, name))
|
||||
|
||||
h1 = img_exp.histogram()
|
||||
h2 = img_cur.histogram()
|
||||
rms = math.sqrt(reduce(operator.add, map(lambda a, b: (a - b) ** 2,
|
||||
h1, h2)) / len(h1))
|
||||
|
||||
self.assertNotEqual(rms == 0, 'Screen valid')
|
|
@ -1,81 +0,0 @@
|
|||
import time
|
||||
from pageobjects.environments import Environments, Wizard, DeployChangesPopup
|
||||
from pageobjects.header import TaskResultAlert
|
||||
from pageobjects.nodes import Nodes, RolesPanel
|
||||
from settings import OPENSTACK_CENTOS, OPENSTACK_RELEASE_CENTOS
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
|
||||
class Environment:
|
||||
|
||||
@staticmethod
|
||||
def simple_flat(name=OPENSTACK_CENTOS,
|
||||
release=OPENSTACK_RELEASE_CENTOS):
|
||||
BaseTestCase.get_home()
|
||||
Environments().create_cluster_box.click()
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(name)
|
||||
w.release.select_by_visible_text(release)
|
||||
w.next.click()
|
||||
w.mode_multinode.click()
|
||||
for i in range(5):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
@staticmethod
|
||||
def ha_flat(name=OPENSTACK_CENTOS,
|
||||
release=OPENSTACK_RELEASE_CENTOS):
|
||||
BaseTestCase.get_home()
|
||||
Environments().create_cluster_box.click()
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(name)
|
||||
w.release.select_by_visible_text(release)
|
||||
w.next.click()
|
||||
w.mode_ha_compact.click()
|
||||
for i in range(5):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
@staticmethod
|
||||
def simple_neutron_gre(name=OPENSTACK_CENTOS,
|
||||
release=OPENSTACK_RELEASE_CENTOS):
|
||||
BaseTestCase.get_home()
|
||||
Environments().create_cluster_box.click()
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(name)
|
||||
w.release.select_by_visible_text(release)
|
||||
w.next.click()
|
||||
w.mode_multinode.click()
|
||||
for i in range(2):
|
||||
w.next.click()
|
||||
w.network_neutron_gre.click()
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
@staticmethod
|
||||
def deploy_nodes(controllers=0, computes=0, cinders=0, cephs=0):
|
||||
def add(role, amount):
|
||||
if amount < 1:
|
||||
return
|
||||
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
for i in range(amount):
|
||||
Nodes().nodes_discovered[i].checkbox.click()
|
||||
getattr(RolesPanel(), role).click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
|
||||
add('controller', controllers)
|
||||
add('compute', computes)
|
||||
add('cinder', cinders)
|
||||
add('ceph_osd', cephs)
|
||||
|
||||
time.sleep(1)
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
TaskResultAlert().close.click()
|
|
@ -1,488 +0,0 @@
|
|||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
from pageobjects.environments import Environments
|
||||
from pageobjects.header import Header
|
||||
from pageobjects.nodes import Nodes, NodeInfo, RolesPanel
|
||||
from pageobjects.tabs import Tabs
|
||||
from tests import preconditions
|
||||
from tests.base import BaseTestCase
|
||||
from tests.test_roles import ROLE_CONTROLLER, ROLE_CEPH, ROLE_CINDER
|
||||
|
||||
|
||||
class TestNodesAddPage(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
Steps:
|
||||
1. Simple environment with default values is created
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.simple_flat()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on created simple environment
|
||||
2. Click 'Add nodes'
|
||||
"""
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
|
||||
def test_discovered_nodes_enabled(self):
|
||||
"""Check that discovered nodes checkboxes are enabled
|
||||
|
||||
Scenario:
|
||||
1. Verify discovered nodes checkboxes are active
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_discovered:
|
||||
self.assertTrue(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_enabled(),
|
||||
'Node enabled')
|
||||
|
||||
def test_offline_nodes_disabled(self):
|
||||
"""Check that offline nodes checkboxes are disabled
|
||||
|
||||
Scenario:
|
||||
1. Verify offline nodes checkboxes are inactive
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_offline:
|
||||
self.assertTrue(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_enabled(),
|
||||
'Node disabled')
|
||||
|
||||
def test_error_nodes_disabled(self):
|
||||
"""Check that error nodes checkboxes are disabled
|
||||
|
||||
Scenario:
|
||||
1. Verify error nodes checkboxes are inactive
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_error:
|
||||
self.assertFalse(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_enabled(),
|
||||
'Node disabled')
|
||||
|
||||
def test_select_all(self):
|
||||
"""Check Select All checkbox
|
||||
|
||||
Scenario:
|
||||
1. Click Select All checkbox
|
||||
2. Verify that group Select All checkboxes are selected
|
||||
3. Verify that discovered nodes checkboxes are selected
|
||||
4. Verify that offline and error nodes checkboxes aren't selected
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.select_all.click()
|
||||
for selects in n.select_all_in_group:
|
||||
self.assertTrue(selects.is_selected(),
|
||||
'Select all in group is selected')
|
||||
for node in n.nodes_discovered:
|
||||
self.assertTrue(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_selected(),
|
||||
'Discovered node is selected')
|
||||
for node in n.nodes_offline:
|
||||
self.assertTrue(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_selected(),
|
||||
'Offline node is not selected')
|
||||
for node in n.nodes_error:
|
||||
self.assertFalse(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_selected(),
|
||||
'Error node is not selected')
|
||||
|
||||
def test_select_all_in_group(self):
|
||||
"""Check Select All in group
|
||||
|
||||
Scenario:
|
||||
1. Click Select All in each group of nodes
|
||||
2. Verify that nodes checkboxes are selected
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for i, group in enumerate(n.node_groups):
|
||||
group.select_all_in_group[0].click()
|
||||
for node in group.nodes_discovered:
|
||||
self.assertTrue(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_selected(),
|
||||
'Discovered node is selected')
|
||||
self.assertTrue(
|
||||
n.select_all.is_selected(), '"Select all" is checked')
|
||||
|
||||
def test_select_all_selecting_nodes_one_by_one(self):
|
||||
"""Check selecting elements one by one
|
||||
|
||||
Scenario:
|
||||
1. Select nodes one by one
|
||||
2. Verify that Select all checkbox for group is selected
|
||||
when all discovered nodes in group are selected
|
||||
3. Verify that Select all checkbox is selected when
|
||||
all nodes are selected
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for i, group in enumerate(n.node_groups):
|
||||
for node in group.nodes_discovered:
|
||||
node.checkbox.click()
|
||||
for node in group.nodes_offline:
|
||||
node.checkbox.click()
|
||||
self.assertTrue(
|
||||
group.select_all_in_group[0].is_selected(),
|
||||
'"Select all in group" is checked')
|
||||
self.assertTrue(
|
||||
n.select_all.is_selected(), '"Select all" is checked')
|
||||
|
||||
def test_selecting_nodes_clicking_them_discovered(self):
|
||||
"""Check selecting discovered elements by clicking on node area
|
||||
|
||||
Scenario:
|
||||
1. Select all discovered nodes by clicking on node area
|
||||
2. Verify that all discovered nodes are selected
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_discovered:
|
||||
node.parent.click()
|
||||
self.assertTrue(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_selected(),
|
||||
'Discovered node is selected')
|
||||
|
||||
def test_selecting_nodes_clicking_them_offline(self):
|
||||
"""Check offline nodes can't be selected by clicking on node area
|
||||
|
||||
Scenario:
|
||||
1. Select all offline nodes by clicking on node area
|
||||
2. Verify that all offline nodes aren't selected
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_offline:
|
||||
node.parent.click()
|
||||
self.assertTrue(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_selected(),
|
||||
'Offline node is not selected')
|
||||
|
||||
def test_selecting_nodes_clicking_them_error(self):
|
||||
"""Check error nodes can't be selected by clicking on node area
|
||||
|
||||
Scenario:
|
||||
1. Select all error nodes by clicking on node area
|
||||
2. Verify that all error nodes aren't selected
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_error:
|
||||
node.parent.click()
|
||||
self.assertFalse(
|
||||
node.checkbox.find_element_by_tag_name('input').
|
||||
is_selected(),
|
||||
'Error node is not selected')
|
||||
|
||||
def test_node_info_popup(self):
|
||||
"""Check node info in pop-up
|
||||
|
||||
Scenario:
|
||||
1. Click edit node
|
||||
2. Verify that name in header is the same as on nodes list page
|
||||
3. Do this check for discovered, offline, error node
|
||||
"""
|
||||
def test_popup(node):
|
||||
node.details.click()
|
||||
with NodeInfo() as details:
|
||||
self.assertEqual(
|
||||
node.name.text, details.header.text,
|
||||
'Node name')
|
||||
details.close.click()
|
||||
details.wait_until_exists()
|
||||
|
||||
with Nodes()as n:
|
||||
test_popup(n.nodes_discovered[0])
|
||||
test_popup(n.nodes_offline[0])
|
||||
test_popup(n.nodes_error[0])
|
||||
|
||||
def test_renaming_node(self):
|
||||
"""Rename node name
|
||||
|
||||
Scenario:
|
||||
1. Click on node name
|
||||
2. Change name and click on node area - name isn't changed
|
||||
3. Click on node name again
|
||||
4. Change name and hit enter
|
||||
5. Verify that name is correctly changed
|
||||
"""
|
||||
name = 'new node name'
|
||||
with Nodes()as n:
|
||||
old_name = n.nodes_discovered[0].name.text
|
||||
n.nodes_discovered[0].name.click()
|
||||
self.assertTrue(
|
||||
n.nodes_discovered[0].name_input.is_displayed(),
|
||||
'input visible')
|
||||
n.nodes_discovered[0].name_input.send_keys(name)
|
||||
n.nodes_discovered[0].parent.click()
|
||||
self.assertRaises(
|
||||
NoSuchElementException, getattr, n.nodes_discovered[0],
|
||||
'name_input')
|
||||
self.assertEqual(
|
||||
old_name, n.nodes_discovered[0].name.text,
|
||||
'Node has old name')
|
||||
n.nodes_discovered[0].name.click()
|
||||
n.nodes_discovered[0].name_input.clear()
|
||||
n.nodes_discovered[0].name_input.send_keys(name)
|
||||
n.nodes_discovered[0].name_input.send_keys(Keys.ENTER)
|
||||
time.sleep(2)
|
||||
self.assertEqual(
|
||||
name, Nodes().nodes_discovered[0].name.text,
|
||||
'New node name')
|
||||
|
||||
|
||||
class TestAddingNodes(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Click on created simple environment
|
||||
2. Click 'Add nodes'
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
preconditions.Environment.simple_flat()
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
|
||||
def test_adding_node_single_role(self):
|
||||
"""Add one controller node
|
||||
|
||||
Scenario:
|
||||
1. Select Controller role and select node
|
||||
2. Click Apply Changes
|
||||
3. Verify that Nodes page is open
|
||||
4. Amount of nodes is 1
|
||||
5. Node is the same that was selected
|
||||
6. Role of node is Controller
|
||||
"""
|
||||
name = Nodes().nodes_discovered[0].name.text
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
with Nodes() as n:
|
||||
self.assertTrue(n.env_summary.is_displayed())
|
||||
self.assertEqual(len(n.nodes), 1, 'Nodes amount')
|
||||
self.assertEqual(n.nodes[0].name.text, name, 'Node name')
|
||||
self.assertIn(ROLE_CONTROLLER, n.nodes[0].roles.text, 'Node role')
|
||||
|
||||
def test_adding_node_multiple_roles(self):
|
||||
"""Add node with controller, cinder, ceph roles
|
||||
|
||||
Scenario:
|
||||
1. Select Controller, Cinder, Ceph roles and select node
|
||||
2. Click Apply Changes
|
||||
3. Verify that Nodes page is open
|
||||
4. Role of node is Controller, Cinder, Ceph
|
||||
"""
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.controller.click()
|
||||
r.cinder.click()
|
||||
r.ceph_osd.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
with Nodes() as n:
|
||||
self.assertTrue(n.env_summary.is_displayed())
|
||||
self.assertIn(ROLE_CONTROLLER, n.nodes[0].roles.text,
|
||||
'Node first role')
|
||||
self.assertIn(ROLE_CINDER, n.nodes[0].roles.text,
|
||||
'Node second role')
|
||||
self.assertIn(ROLE_CEPH, n.nodes[0].roles.text,
|
||||
'Node third role')
|
||||
|
||||
def test_edit_role_add_new_role(self):
|
||||
"""Edit node by adding new role to it
|
||||
|
||||
Scenario:
|
||||
1. Select Controller role and select node
|
||||
2. Click Apply Changes
|
||||
3. Select added node and click Edit Roles
|
||||
4. Select Cinder Role and click Apply Changes
|
||||
5. Verify that roles of node are Controller, Cinder
|
||||
"""
|
||||
# Add node with controller role
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
# Add cinder role
|
||||
with Nodes() as n:
|
||||
n.nodes[0].checkbox.click()
|
||||
n.edit_roles.click()
|
||||
RolesPanel().cinder.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
with Nodes() as n:
|
||||
self.assertIn(ROLE_CONTROLLER, n.nodes[0].roles.text,
|
||||
'Controller role')
|
||||
self.assertIn(ROLE_CINDER, n.nodes[0].roles.text,
|
||||
'Cinder role')
|
||||
|
||||
def test_edit_role_change_role(self):
|
||||
"""Edit node by removing old role and adding two new roles to it
|
||||
|
||||
Scenario:
|
||||
1. Select Controller role and select node
|
||||
2. Click Apply Changes
|
||||
3. Select added node and click Edit Roles
|
||||
4. Unselect Controller and select Cinder and Ceph Role
|
||||
5. Click Apply Changes
|
||||
6. Verify that roles of node are Cinder and Ceph
|
||||
"""
|
||||
# Add node with controller role
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
# Remove controller, Add cinder and ceph-osd roles
|
||||
with Nodes() as n:
|
||||
n.nodes[0].checkbox.click()
|
||||
n.edit_roles.click()
|
||||
with RolesPanel() as r:
|
||||
r.controller.click()
|
||||
r.cinder.click()
|
||||
r.ceph_osd.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
with Nodes() as n:
|
||||
self.assertNotIn(ROLE_CONTROLLER, n.nodes[0].roles.text,
|
||||
'Controller role has been removed')
|
||||
self.assertIn(ROLE_CINDER, n.nodes[0].roles.text,
|
||||
'Cinder role')
|
||||
self.assertIn(ROLE_CEPH, n.nodes[0].roles.text,
|
||||
'Ceph-osd role')
|
||||
|
||||
def test_unallocated_nodes_counter(self):
|
||||
"""Unallocated nodes counter
|
||||
|
||||
Scenario:
|
||||
1. Add new node with compute role
|
||||
2. Verify that number of unallocated nodes was reduced on 1
|
||||
"""
|
||||
initial = int(Header().unallocated_nodes.text)
|
||||
discovered = len(Nodes().nodes_discovered)
|
||||
|
||||
Tabs().nodes.click()
|
||||
for i in range(discovered):
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
|
||||
self.assertEqual(
|
||||
str(initial - i - 1), Header().unallocated_nodes.text,
|
||||
'Unallocated nodes amount')
|
||||
|
||||
|
||||
class TestGroupBy(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Add one controller node
|
||||
3. Add other nodes as compute
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
BaseTestCase.get_home()
|
||||
preconditions.Environment().simple_flat()
|
||||
BaseTestCase.get_home()
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
time.sleep(1)
|
||||
|
||||
# Add controller
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
|
||||
# Add other discovered nodes as compute
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
for n in Nodes().nodes_discovered:
|
||||
n.checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on created environment
|
||||
"""
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
|
||||
def _test_group_by(self, group_by, nodes_in_groups):
|
||||
with Nodes() as n:
|
||||
time.sleep(1)
|
||||
n.group_by.select_by_visible_text(group_by)
|
||||
time.sleep(1)
|
||||
self.assertEqual(len(nodes_in_groups),
|
||||
len(n.node_groups), 'Groups amount')
|
||||
for i, group in enumerate(n.node_groups):
|
||||
self.assertEqual(
|
||||
nodes_in_groups[i], len(group.nodes),
|
||||
'Group #{0} has {1} nodes'.format(i, nodes_in_groups[i]))
|
||||
|
||||
def test_group_by_roles(self):
|
||||
"""Group nodes by role
|
||||
|
||||
Scenario:
|
||||
1. Select Roles value in Group By list
|
||||
2. Verify that there are 2 groups with
|
||||
correct number of nodes in each group
|
||||
"""
|
||||
self._test_group_by('Roles', [1, 5])
|
||||
|
||||
def test_group_by_hardware_info(self):
|
||||
"""Group nodes by hardware
|
||||
|
||||
Scenario:
|
||||
1. Select Hardware Info value in Group By list
|
||||
2. Verify that there are 5 groups with
|
||||
correct number of nodes in each group
|
||||
"""
|
||||
self._test_group_by('Hardware Info', [1, 1, 2, 1, 1])
|
||||
|
||||
def test_group_by_roles_and_hardware_info(self):
|
||||
"""Group nodes by role and hardware info
|
||||
|
||||
Scenario:
|
||||
1. Select Roles and hardware info value in Group By list
|
||||
2. Verify that there are 6 groups with
|
||||
correct number of nodes in each group
|
||||
"""
|
||||
self._test_group_by('Roles and hardware info', [1, 2, 1, 1, 1])
|
|
@ -1,300 +0,0 @@
|
|||
import random
|
||||
import time
|
||||
from pageobjects.base import ConfirmPopup
|
||||
from pageobjects.environments import Environments
|
||||
from pageobjects.node_disks_settings import DisksSettings
|
||||
from pageobjects.nodes import Nodes, RolesPanel, NodeInfo
|
||||
from pageobjects.tabs import Tabs
|
||||
from tests import preconditions
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
|
||||
class TestConfigureDisks(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Add one controller node
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.simple_flat()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on created environment
|
||||
2. Select controller node
|
||||
3. Click Configure Disks
|
||||
"""
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_disks.click()
|
||||
time.sleep(1)
|
||||
|
||||
def test_volume_animation(self):
|
||||
"""Expand and collapse blocks with disk information
|
||||
|
||||
Scenario:
|
||||
1. Click on disk area
|
||||
2. Verify that area is expanded and disk information is available
|
||||
3. Click disk area again
|
||||
4. Verify that area is collapsed and
|
||||
disk information is unavailable
|
||||
"""
|
||||
with DisksSettings() as s:
|
||||
s.disks[0].volume_os.parent.click()
|
||||
time.sleep(1)
|
||||
self.assertTrue(
|
||||
s.disks[0].details_panel.is_displayed(),
|
||||
'details panel is expanded')
|
||||
|
||||
s.disks[0].volume_os.parent.click()
|
||||
time.sleep(1)
|
||||
self.assertFalse(
|
||||
s.disks[0].details_panel.is_displayed(),
|
||||
'details panel is expanded')
|
||||
|
||||
def test_remove_volume_cross(self):
|
||||
"""Remove disk volume by clicking on X button
|
||||
|
||||
Scenario:
|
||||
1. Click on disk area
|
||||
2. Click on X button for some volume group
|
||||
3. Verify that image size is 0 and there is Unallocated space
|
||||
"""
|
||||
with DisksSettings() as s:
|
||||
s.disks[0].volume_image.parent.click()
|
||||
time.sleep(1)
|
||||
s.disks[0].volume_image.close_cross.click()
|
||||
self.assertFalse(
|
||||
s.disks[0].volume_image.close_cross.is_displayed(),
|
||||
'Image volume has been removed')
|
||||
self.assertEqual(
|
||||
'0',
|
||||
s.disks[0].volume_group_image.input.get_attribute('value'),
|
||||
'image volume size is 0')
|
||||
|
||||
def test_use_all_allowed(self):
|
||||
"""Use all allowed space
|
||||
|
||||
Scenario:
|
||||
1. Click on disk area
|
||||
2. Click on X button for all volumes group
|
||||
3. Click Use all allowed space for Base system
|
||||
4. Verify that all space is allocated for Base system
|
||||
5. Remove all volumes group and click
|
||||
Use all allowed space for Image Storage
|
||||
6. Verify that all space is allocated for Image Storage
|
||||
"""
|
||||
with DisksSettings() as s:
|
||||
s.disks[1].volume_image.parent.click()
|
||||
time.sleep(1)
|
||||
s.disks[1].volume_image.close_cross.click()
|
||||
unallocated = s.disks[1].volume_unallocated.size.text
|
||||
|
||||
s.disks[1].volume_group_os.use_all.click()
|
||||
self.assertEqual(
|
||||
unallocated, s.disks[1].volume_os.size.text,
|
||||
'Base system uses all allowed space'
|
||||
)
|
||||
s.disks[1].volume_os.close_cross.click()
|
||||
|
||||
s.disks[1].volume_group_image.use_all.click()
|
||||
self.assertEqual(
|
||||
unallocated, s.disks[1].volume_image.size.text,
|
||||
'Image storage uses all allowed space'
|
||||
)
|
||||
|
||||
def test_type_volume_size(self):
|
||||
"""Allocate space for volume groups
|
||||
|
||||
Scenario:
|
||||
1. Click on disk area
|
||||
2. Allocate space for Image Storage
|
||||
3. Verify that allocated size is correct in the header of disk area
|
||||
"""
|
||||
values = [random.randint(100000, 200000) for i in range(3)]
|
||||
with DisksSettings() as s:
|
||||
s.disks[0].volume_image.parent.click()
|
||||
time.sleep(1)
|
||||
for v in values:
|
||||
s.disks[0].volume_group_image.input.clear()
|
||||
s.disks[0].volume_group_image.input.send_keys(v)
|
||||
time.sleep(0.5)
|
||||
exp = '{0:.1f} GB'.format((float(v) / 1024))
|
||||
cur = s.disks[0].volume_image.size.text
|
||||
self.assertEqual(
|
||||
exp, cur,
|
||||
'Volume size. exp: {0} ({1}), cur {2}'.format(exp, v, cur))
|
||||
|
||||
def test_save_load_defaults(self):
|
||||
"""Load default values
|
||||
|
||||
Scenario:
|
||||
1. Click on disk area
|
||||
2. Allocate space for Image Storage
|
||||
3. Apply changes
|
||||
4. Click Load Defaults
|
||||
5. Verify that Image size is default value
|
||||
"""
|
||||
default = None
|
||||
value = random.randint(60000, 80000)
|
||||
with DisksSettings() as s:
|
||||
s.disks[0].volume_image.parent.click()
|
||||
time.sleep(1)
|
||||
default = s.disks[0].volume_group_image.input.\
|
||||
get_attribute('value')
|
||||
s.disks[0].volume_group_image.input.\
|
||||
clear()
|
||||
s.disks[0].volume_group_image.input.\
|
||||
send_keys(value)
|
||||
s.apply.click()
|
||||
time.sleep(1)
|
||||
self.refresh()
|
||||
with DisksSettings() as s:
|
||||
time.sleep(2)
|
||||
self.assertEqual(
|
||||
"{:,}".format(value),
|
||||
s.disks[0].volume_group_image.input.get_attribute('value'),
|
||||
'New value has been saved'
|
||||
)
|
||||
s.load_defaults.click()
|
||||
time.sleep(1)
|
||||
self.assertEqual(
|
||||
default,
|
||||
s.disks[0].volume_group_image.input.get_attribute('value'),
|
||||
'default value has been restored'
|
||||
)
|
||||
|
||||
def test_cancel_changes(self):
|
||||
"""Cancel changes to disk configuring
|
||||
|
||||
Scenario:
|
||||
1. Click on disk area
|
||||
2. Allocate space for Image Storage
|
||||
3. Click Cancel Changes
|
||||
4. Verify that default value is restored
|
||||
"""
|
||||
with DisksSettings() as s:
|
||||
s.disks[0].volume_image.parent.click()
|
||||
time.sleep(1)
|
||||
default = s.disks[0].volume_group_image.input.\
|
||||
get_attribute('value')
|
||||
s.disks[0].volume_group_image.input.\
|
||||
clear()
|
||||
s.disks[0].volume_group_image.input.\
|
||||
send_keys(random.randint(60000, 80000))
|
||||
s.cancel_changes.click()
|
||||
time.sleep(1)
|
||||
self.assertEqual(
|
||||
default,
|
||||
s.disks[0].volume_group_image.input.get_attribute('value'),
|
||||
'default value has been restored'
|
||||
)
|
||||
|
||||
def test_confirm_if_back_to_list(self):
|
||||
"""Back to node list form disk configuring
|
||||
|
||||
Scenario:
|
||||
1. Click on disk area
|
||||
2. Allocate space for Image Storage
|
||||
3. Click Back to node list
|
||||
4. Click Stay on page
|
||||
5. Verify that changes aren't discarded
|
||||
6. Click Back to node list
|
||||
7. Click Leave page
|
||||
8. Verify that Nodes page is present and changes are discarded
|
||||
"""
|
||||
with DisksSettings() as s:
|
||||
s.disks[0].volume_image.parent.click()
|
||||
time.sleep(1)
|
||||
s.disks[0].volume_group_image.input.\
|
||||
clear()
|
||||
s.disks[0].volume_group_image.input.\
|
||||
send_keys('0')
|
||||
|
||||
s.back_to_node_list.click()
|
||||
with ConfirmPopup() as p:
|
||||
p.stay_on_page.click()
|
||||
p.wait_until_exists()
|
||||
self.assertEqual(
|
||||
'0', s.disks[0].volume_group_image.
|
||||
input.get_attribute('value'),
|
||||
'Value is not changed')
|
||||
|
||||
s.back_to_node_list.click()
|
||||
with ConfirmPopup() as p:
|
||||
p.leave_page.click()
|
||||
p.wait_until_exists()
|
||||
time.sleep(1)
|
||||
|
||||
self.assertTrue(
|
||||
Nodes().add_nodes.is_displayed(),
|
||||
'Backed to nodes page. Add Nodes button is displayed')
|
||||
|
||||
def test_configure_disks_of_several_nodes(self):
|
||||
"""Configure disks for several nodes
|
||||
|
||||
Scenario:
|
||||
1. Add two compute nodes
|
||||
2. Select this two nodes and click configure disks
|
||||
3. Allocate size for Base system volume
|
||||
4. Click apply changes
|
||||
5. Verify that changes are correctly applied
|
||||
"""
|
||||
values = [random.randint(100000, 500000) for i in range(4)]
|
||||
|
||||
# Go back to nodes page
|
||||
Tabs().nodes.click()
|
||||
time.sleep(1)
|
||||
# Add second node
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().select_all_in_group[1].click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
# change volumes size
|
||||
with Nodes() as n:
|
||||
n.select_all_in_group[1].click()
|
||||
n.configure_disks.click()
|
||||
time.sleep(1)
|
||||
|
||||
with DisksSettings() as s:
|
||||
for i, v in enumerate(values):
|
||||
s.disks[i].volume_storage.parent.click()
|
||||
time.sleep(1)
|
||||
s.disks[i].volume_group_storage.input.\
|
||||
clear()
|
||||
s.disks[i].volume_group_storage.input.\
|
||||
send_keys(v)
|
||||
s.apply.click()
|
||||
time.sleep(1)
|
||||
|
||||
for i in range(1, 3):
|
||||
# Go to nodes page
|
||||
Tabs().nodes.click()
|
||||
time.sleep(1)
|
||||
# Verify disks settings of each node
|
||||
Nodes().nodes[i].details.click()
|
||||
NodeInfo().edit_disks.click()
|
||||
time.sleep(1)
|
||||
|
||||
for j, v in enumerate(values):
|
||||
self.assertEqual(
|
||||
"{:,}".format(v),
|
||||
s.disks[j].volume_group_storage.input.
|
||||
get_attribute('value'),
|
||||
'Image volume size of disk {0} of node {0} is correct'.
|
||||
format(j, i))
|
|
@ -1,520 +0,0 @@
|
|||
import random
|
||||
import time
|
||||
from selenium.webdriver import ActionChains
|
||||
import browser
|
||||
from pageobjects.environments import Environments
|
||||
from pageobjects.networks import Networks
|
||||
from pageobjects.node_interfaces_settings import InterfacesSettings
|
||||
from pageobjects.nodes import Nodes, RolesPanel, NodeInfo
|
||||
from pageobjects.tabs import Tabs
|
||||
from tests import preconditions
|
||||
from tests.base import BaseTestCase
|
||||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class TestConfigureNetworksPage(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Add one controller node
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.simple_flat()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on created environment
|
||||
2. Select controller node
|
||||
3. Click Configure Interfaces
|
||||
"""
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_networks.click()
|
||||
|
||||
def test_drag_and_drop(self):
|
||||
"""Drag and drop networks between interfaces
|
||||
|
||||
Scenario:
|
||||
1. Drag and drop Storage network from eth0 to eth1
|
||||
2. Drag and drop Management network from eth0 to eth2
|
||||
3. Drag and drop VM network from eth0 to eth2
|
||||
4. Verify that networks are on correct interfaces
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['storage'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['management'],
|
||||
s.interfaces[2].networks_box).perform()
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['vm (fixed)'],
|
||||
s.interfaces[2].networks_box).perform()
|
||||
|
||||
self.assertIn(
|
||||
'storage', s.interfaces[1].networks,
|
||||
'storage at eht1')
|
||||
self.assertIn(
|
||||
'management', s.interfaces[2].networks,
|
||||
'management at eht2')
|
||||
self.assertIn(
|
||||
'vm (fixed)', s.interfaces[2].networks,
|
||||
'vm (fixed) at eht2')
|
||||
|
||||
def test_public_network(self):
|
||||
"""Drag and drop public and floating networks
|
||||
|
||||
Scenario:
|
||||
1. Drag and drop Public network from eth0 to eth1
|
||||
2. Verify that Public network is moved to eth1
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['public'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
self.assertIn(
|
||||
'public', s.interfaces[1].networks,
|
||||
'Public has been moved')
|
||||
|
||||
def test_admin_pxe_is_not_dragable(self):
|
||||
"""Drag and drop Admin(PXE) network
|
||||
|
||||
Scenario:
|
||||
1. Drag and drop Admin(PXE) network from eth2 to eth0
|
||||
2. Verify that network isn't draggable
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[2].networks['admin (pxe)'],
|
||||
s.interfaces[0].networks_box).perform()
|
||||
self.assertNotIn(
|
||||
'admin (pxe)', s.interfaces[0].networks,
|
||||
'admin (pxe) has not been moved')
|
||||
|
||||
def test_two_untagged_on_interface(self):
|
||||
"""Assign two untagged networks to one interface
|
||||
|
||||
Scenario:
|
||||
1. Drag and drop Public network from eth0 to eth2
|
||||
2. Verify that eth2 is highlighted with red colour,
|
||||
there is error message and Apply button is inactive
|
||||
3. Drag and drop Public network from eth2 to eth1
|
||||
4. Verify that eth2 isn't highlighted, error message
|
||||
has disappeared and Apply button is active
|
||||
"""
|
||||
error = 'Untagged networks can not be assigned to the same interface'
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['public'],
|
||||
s.interfaces[2].networks_box).perform()
|
||||
self.assertIn(
|
||||
'nodrag', s.interfaces[2].parent.get_attribute('class'),
|
||||
'Red border')
|
||||
self.assertIn(
|
||||
error,
|
||||
s.interfaces[2].parent.find_element_by_xpath('./..').text,
|
||||
'Error message is displayed'
|
||||
)
|
||||
self.assertFalse(s.apply.is_enabled(), 'Apply disabled')
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[2].networks['public'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
self.assertNotIn(
|
||||
'nodrag', s.interfaces[2].parent.get_attribute('class'),
|
||||
'Red border')
|
||||
self.assertNotIn(
|
||||
error,
|
||||
s.interfaces[2].parent.find_element_by_xpath('./..').text,
|
||||
'Error message is displayed'
|
||||
)
|
||||
self.assertTrue(s.apply.is_enabled(), 'Apply enabled')
|
||||
|
||||
def test_cancel_changes(self):
|
||||
"""Assign two untagged networks to one interface
|
||||
|
||||
Scenario:
|
||||
1. Drag and drop Public network from eth0 to eth1
|
||||
2. Drag and drop Storage network from eth0 to eth2
|
||||
3. Click Cancel Changes
|
||||
4. Verify that Public, Storage, Floating network
|
||||
are on eth0 interface
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['public'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['storage'],
|
||||
s.interfaces[2].networks_box).perform()
|
||||
|
||||
s.cancel_changes.click()
|
||||
time.sleep(1)
|
||||
self.assertIn(
|
||||
'storage', s.interfaces[0].networks,
|
||||
'storage at eht0')
|
||||
self.assertIn(
|
||||
'public', s.interfaces[0].networks,
|
||||
'public at eht0')
|
||||
|
||||
|
||||
class TestConfigureNetworks(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Click on created environment
|
||||
3. Create controller node
|
||||
4. Select controller node
|
||||
5. Click Configure Interfaces
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
preconditions.Environment.simple_flat()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_networks.click()
|
||||
time.sleep(1)
|
||||
|
||||
def test_save_load_defaults(self):
|
||||
"""Load default network settings
|
||||
|
||||
Scenario:
|
||||
1. Drag and drop Public network from eth0 to eth1
|
||||
2. Drag and drop Storage network from eth0 to eth2
|
||||
3. Click Apply
|
||||
4. Click Load Defaults
|
||||
5. Verify that Public, Storage are on eth0 interface
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['public'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['storage'],
|
||||
s.interfaces[2].networks_box).perform()
|
||||
s.apply.click()
|
||||
time.sleep(1)
|
||||
self.refresh()
|
||||
with InterfacesSettings() as s:
|
||||
self.assertIn(
|
||||
'storage', s.interfaces[2].networks,
|
||||
'storage at eht2')
|
||||
self.assertIn(
|
||||
'public', s.interfaces[1].networks,
|
||||
'public at eht1')
|
||||
s.load_defaults.click()
|
||||
time.sleep(1)
|
||||
self.assertIn(
|
||||
'storage', s.interfaces[0].networks,
|
||||
'storage at eht0')
|
||||
self.assertIn(
|
||||
'public', s.interfaces[0].networks,
|
||||
'public at eht0')
|
||||
|
||||
def test_configure_interfaces_of_several_nodes(self):
|
||||
"""Configure interfaces on several nodes
|
||||
|
||||
Scenario:
|
||||
1. Add compute node
|
||||
2. Select compute and controller node
|
||||
and click Configure interfaces
|
||||
3. Drag and drop Public network from eth0 to eth1
|
||||
4. Drag and drop Storage network from eth0 to eth2
|
||||
5. Drag and drop Management network from eth0 to eth1
|
||||
6. Click Apply
|
||||
7. Verify that Public and Management networks
|
||||
are on eth1 interface, Storage is on eth2
|
||||
"""
|
||||
# Go back to nodes page
|
||||
Tabs().nodes.click()
|
||||
# Add second node
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
Nodes().nodes_discovered[2].checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
Tabs().nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
Nodes().nodes_discovered[1].checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
# rearrange interfaces
|
||||
with Nodes() as n:
|
||||
n.nodes[1].checkbox.click()
|
||||
n.nodes[2].checkbox.click()
|
||||
n.configure_interfaces.click()
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['management'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['storage'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
s.apply.click()
|
||||
time.sleep(1)
|
||||
|
||||
for i in range(1, 3):
|
||||
# Go to nodes page
|
||||
Tabs().nodes.click()
|
||||
# Verify interfaces settings of each node
|
||||
Nodes().nodes[i].details.click()
|
||||
NodeInfo().edit_networks.click()
|
||||
self.assertIn(
|
||||
'management', s.interfaces[1].networks,
|
||||
'management at eht1. Node #{0}'.format(i))
|
||||
self.assertIn(
|
||||
'storage', s.interfaces[1].networks,
|
||||
'storage at eht1. Node #{0}'.format(i))
|
||||
|
||||
def test_vlan_id_labels_visibility(self):
|
||||
"""Checking vlan id label when vlan tagging is disabled
|
||||
|
||||
Scenario:
|
||||
1. Open Networks tab
|
||||
2. Disable vlan tagging for Management, Storage, VM(Fixed)
|
||||
3. Open Nodes tab
|
||||
4. Select controller node
|
||||
5. Click configure interfaces
|
||||
6. Verify that 'Vlan Id' isn't visible on Storage,
|
||||
Management, VM(Fixed) network boxes
|
||||
"""
|
||||
label = 'VLAN ID'
|
||||
Tabs().networks.click()
|
||||
with Networks() as n:
|
||||
n.management.vlan_tagging.click()
|
||||
n.storage.vlan_tagging.click()
|
||||
n.fixed.vlan_tagging.click()
|
||||
n.save_settings.click()
|
||||
time.sleep(1)
|
||||
Tabs().nodes.click()
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_networks.click()
|
||||
with InterfacesSettings() as s:
|
||||
self.assertNotIn(
|
||||
label, s.interfaces[0].networks['storage'].text,
|
||||
'vlan id is visible. Storage network')
|
||||
self.assertNotIn(
|
||||
label, s.interfaces[0].networks['management'].text,
|
||||
'vlan id is visible. Management network')
|
||||
self.assertNotIn(
|
||||
label, s.interfaces[0].networks['vm (fixed)'].text,
|
||||
'vlan id is visible. VM (Fixed) network')
|
||||
|
||||
def test_vlan_id_values(self):
|
||||
"""Checking correctness of vlan id on Networks tab
|
||||
|
||||
Scenario:
|
||||
1. Open Networks tab
|
||||
2. Enable vlan tagging for Management, Storage, VM(Fixed)
|
||||
and enter values in range from 110 to 200
|
||||
3. Open Nodes tab
|
||||
4. Select controller node
|
||||
5. Click configure interfaces
|
||||
6. Verify that 'Vlan Id' values are correct on Storage,
|
||||
Management, VM(Fixed) network boxes
|
||||
"""
|
||||
label = 'VLAN ID: {0}'
|
||||
vlans = [random.randint(110, 200) for i in range(3)]
|
||||
Tabs().networks.click()
|
||||
with Networks() as n:
|
||||
n.management.vlan_id.clear()
|
||||
n.management.vlan_id.send_keys(vlans[0])
|
||||
|
||||
n.storage.vlan_id.clear()
|
||||
n.storage.vlan_id.send_keys(vlans[1])
|
||||
|
||||
n.fixed.vlan_id.clear()
|
||||
n.fixed.vlan_id.send_keys(vlans[2])
|
||||
|
||||
n.save_settings.click()
|
||||
time.sleep(1)
|
||||
|
||||
Tabs().nodes.click()
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_networks.click()
|
||||
with InterfacesSettings() as s:
|
||||
self.assertIn(
|
||||
label.format(vlans[0]), s.interfaces[0].
|
||||
networks['management'].text,
|
||||
'vlan id is correct. Management network')
|
||||
self.assertIn(
|
||||
label.format(vlans[1]), s.interfaces[0].
|
||||
networks['storage'].text,
|
||||
'vlan id is correct. Storage network')
|
||||
self.assertIn(
|
||||
label.format(vlans[2]), s.interfaces[0].
|
||||
networks['vm (fixed)'].text,
|
||||
'vlan id is correct. VM (Fixed) network')
|
||||
|
||||
|
||||
class TestBondingInterfaces(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Create environment with Neutron gre
|
||||
2. Open created environment
|
||||
3. Add controller node
|
||||
4. Open interface configuration of the node
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
preconditions.Environment.simple_neutron_gre()
|
||||
PageObject.click_element(Nodes(), 'add_nodes')
|
||||
PageObject.click_element(Nodes(), 'nodes_discovered', 'checkbox', 0)
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
PageObject.wait_until_exists(Nodes().apply_changes)
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_networks.click()
|
||||
|
||||
def test_bond_buttons_inactive(self):
|
||||
"""Check bond buttons are inactive by default
|
||||
|
||||
Scenario:
|
||||
1. Verify bond and unbond buttons are disabled
|
||||
"""
|
||||
self.assertFalse(PageObject.find_element
|
||||
(InterfacesSettings(), 'bond_interfaces').
|
||||
is_enabled())
|
||||
self.assertFalse(PageObject.find_element
|
||||
(InterfacesSettings(), 'unbond_interfaces').
|
||||
is_enabled())
|
||||
|
||||
def test_inactive_one_selected(self):
|
||||
"""Check bond buttons are inactive if one interface is selected
|
||||
|
||||
Scenario:
|
||||
1. Select one interface
|
||||
2. Verify bond and unbond buttons are disabled
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
|
||||
self.assertFalse(s.bond_interfaces.is_enabled())
|
||||
self.assertFalse(s.unbond_interfaces.is_enabled())
|
||||
|
||||
def test_bond_interfaces(self):
|
||||
"""Bond two interfaces
|
||||
|
||||
Scenario:
|
||||
1. Select two interfaces
|
||||
2. Click bond interfaces
|
||||
3. Verify that interfaces were bonded
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
|
||||
s.interfaces[1].interface_checkbox.click()
|
||||
self.assertTrue(s.bond_interfaces.is_enabled())
|
||||
s.bond_interfaces.click()
|
||||
s.interfaces[0].bond_mode
|
||||
self.assertFalse(s.bond_interfaces.is_enabled())
|
||||
self.assertFalse(s.unbond_interfaces.is_enabled())
|
||||
|
||||
def test_cancel_bonding(self):
|
||||
"""Cancel bonding
|
||||
|
||||
Scenario:
|
||||
1. Select two interfaces
|
||||
2. Click bond interfaces
|
||||
3. Click cancel changes
|
||||
4. Verify that interfaces aren't bonded
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
|
||||
s.interfaces[1].interface_checkbox.click()
|
||||
s.bond_interfaces.click()
|
||||
s.cancel_changes.click()
|
||||
self.assertEqual(len(s.interfaces), 3, 'Interfaces amount')
|
||||
|
||||
def test_load_default_bonding(self):
|
||||
"""Load default bonding
|
||||
|
||||
Scenario:
|
||||
1. Select two interfaces
|
||||
2. Click bond interfaces
|
||||
3. Click load defaults
|
||||
4. Verify that interfaces aren't bonded
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
|
||||
s.interfaces[1].interface_checkbox.click()
|
||||
s.bond_interfaces.click()
|
||||
s.apply.click()
|
||||
time.sleep(2)
|
||||
self.assertEqual(len(s.interfaces), 2, 'Interfaces amount not 2')
|
||||
PageObject.click_element(s, 'load_defaults')
|
||||
PageObject.wait_until_exists(s.interfaces[0].bond_mode)
|
||||
self.assertEqual(len(s.interfaces), 3, 'Interfaces amount not 3')
|
||||
|
||||
def test_unbond_interfaces(self):
|
||||
"""Unbond interfaces
|
||||
|
||||
Scenario:
|
||||
1. Select two interfaces
|
||||
2. Click bond interfaces
|
||||
3. Click unbond defaults
|
||||
4. Verify that interfaces aren't bonded
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
|
||||
s.interfaces[1].interface_checkbox.click()
|
||||
s.bond_interfaces.click()
|
||||
s.interfaces[0].interface_checkbox.click()
|
||||
s.unbond_interfaces.click()
|
||||
self.assertEqual(len(s.interfaces), 3, 'Interfaces amount not 3')
|
||||
|
||||
def test_bond_mode(self):
|
||||
"""Change bond modes
|
||||
|
||||
Scenario:
|
||||
1. Select two interfaces
|
||||
2. Click bond interfaces
|
||||
3. Change bond modes
|
||||
4. Verify that modes are saved correctly
|
||||
"""
|
||||
with InterfacesSettings() as s:
|
||||
PageObject.click_element(s, 'interfaces', 'interface_checkbox', 0)
|
||||
s.interfaces[1].interface_checkbox.click()
|
||||
s.bond_interfaces.click()
|
||||
s.interfaces[0].select_mode.select_by_visible_text('Balance SLB')
|
||||
self.assertEqual(s.interfaces[0].select_mode.
|
||||
first_selected_option.text,
|
||||
'Balance SLB', 'Text is Balance SLB')
|
||||
s.interfaces[0].select_mode.\
|
||||
select_by_visible_text('LACP Balance TCP')
|
||||
self.assertEqual(s.interfaces[0].select_mode.
|
||||
first_selected_option.text,
|
||||
'LACP Balance TCP', 'Text is LACP Balance TCP')
|
|
@ -1,174 +0,0 @@
|
|||
import time
|
||||
from selenium.webdriver import ActionChains
|
||||
import browser
|
||||
from pageobjects.environments import DeployChangesPopup
|
||||
from pageobjects.header import TaskResultAlert
|
||||
from pageobjects.node_disks_settings import DisksSettings
|
||||
from pageobjects.node_interfaces_settings import InterfacesSettings
|
||||
from pageobjects.nodes import Nodes, RolesPanel, DeleteNodePopup, NodeInfo
|
||||
from pageobjects.base import PageObject
|
||||
from tests import preconditions
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
|
||||
class TestDeploy(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Click on created environment
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
preconditions.Environment.simple_flat()
|
||||
time.sleep(1)
|
||||
|
||||
def test_add_nodes(self):
|
||||
"""Deploy environment with controller and compute nodes
|
||||
|
||||
Scenario:
|
||||
1. Add controller and compute node
|
||||
2. Deploy changes
|
||||
3. Verify that nodes statuses are ready
|
||||
"""
|
||||
Nodes().add_nodes.click()
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(2)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
|
||||
for node in Nodes().nodes:
|
||||
self.assertEqual(
|
||||
'pending addition', node.status.text.lower(),
|
||||
'Node status is Pending Addition')
|
||||
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
TaskResultAlert().close.click()
|
||||
|
||||
with Nodes() as n:
|
||||
self.assertEqual(2, len(n.nodes), 'Nodes amount')
|
||||
for node in n.nodes:
|
||||
self.assertEqual('ready', node.status.text.lower(),
|
||||
'Node status is READY')
|
||||
|
||||
def test_delete_node(self):
|
||||
"""Delete one node and deploy changes
|
||||
|
||||
Scenario:
|
||||
1. Add controller and compute node
|
||||
2. Deploy changes
|
||||
3. Delete one node
|
||||
4. Deploy changes
|
||||
5. Verify that only one node is present
|
||||
"""
|
||||
self.test_add_nodes()
|
||||
|
||||
with Nodes() as n:
|
||||
n.nodes[1].checkbox.click()
|
||||
n.delete_nodes.click()
|
||||
with DeleteNodePopup() as p:
|
||||
p.delete.click()
|
||||
p.wait_until_exists()
|
||||
time.sleep(1)
|
||||
|
||||
self.assertEqual(
|
||||
'pending deletion', Nodes().nodes[1].status.text.lower(),
|
||||
'Node status is Pending Deletion')
|
||||
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
PageObject.click_element(TaskResultAlert(), 'close')
|
||||
|
||||
with Nodes() as n:
|
||||
self.assertEqual(1, len(n.nodes), 'Nodes amount')
|
||||
for node in n.nodes:
|
||||
self.assertEqual('ready', node.status.text.lower(),
|
||||
'Node status is READY')
|
||||
|
||||
def test_node_configure_networks_is_readonly(self):
|
||||
"""Configure network interfaces after deploy
|
||||
|
||||
Scenario:
|
||||
1. Add controller node
|
||||
2. Deploy changes
|
||||
3. Select controller node and click configure interfaces
|
||||
4. Drag and drop Storage network to eth1
|
||||
5. Verify that Storage network can't be dragged and dropped
|
||||
6. Apply, Load defaults, Cancel Changes buttons are not active
|
||||
"""
|
||||
Nodes().add_nodes.click()
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(2)
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
time.sleep(1)
|
||||
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_networks.click()
|
||||
|
||||
with InterfacesSettings() as s:
|
||||
ActionChains(browser.driver).drag_and_drop(
|
||||
s.interfaces[0].networks['storage'],
|
||||
s.interfaces[1].networks_box).perform()
|
||||
|
||||
time.sleep(1)
|
||||
self.assertNotIn(
|
||||
'storage', s.interfaces[1].networks,
|
||||
'storage at eht1')
|
||||
self.assertFalse(s.apply.is_enabled(), 'Apply is disabled')
|
||||
self.assertFalse(s.load_defaults.is_enabled(),
|
||||
'Load defaults is disabled')
|
||||
self.assertFalse(s.cancel_changes.is_enabled(),
|
||||
'Cancel changes is disabled')
|
||||
|
||||
def test_node_configure_disks_is_readonly(self):
|
||||
"""Configure disks after deploy
|
||||
|
||||
Scenario:
|
||||
1. Add controller node
|
||||
2. Deploy changes
|
||||
3. Select controller node and click configure disks
|
||||
4. Verify that volume inputs are disabled
|
||||
6. Apply, Load defaults, Cancel Changes buttons are not active
|
||||
"""
|
||||
Nodes().add_nodes.click()
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(2)
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
time.sleep(1)
|
||||
|
||||
Nodes().nodes[0].details.click()
|
||||
NodeInfo().edit_disks.click()
|
||||
time.sleep(1)
|
||||
|
||||
with DisksSettings() as s:
|
||||
for i in range(2):
|
||||
self.assertFalse(
|
||||
s.disks[i].volume_group_os.input.is_enabled(),
|
||||
'Base system input is disabled at disk #{0}'.format(i))
|
||||
self.assertFalse(
|
||||
s.disks[i].volume_group_image.input.is_enabled(),
|
||||
'Image storage input is disabled at disk #{0}'.format(i))
|
||||
self.assertFalse(s.apply.is_enabled(), 'Apply is disabled')
|
||||
self.assertFalse(s.load_defaults.is_enabled(),
|
||||
'Load defaults is disabled')
|
||||
self.assertFalse(s.cancel_changes.is_enabled(),
|
||||
'Cancel changes is disabled')
|
|
@ -1,70 +0,0 @@
|
|||
import time
|
||||
from pageobjects.environments import DiscardChangesPopup
|
||||
from pageobjects.nodes import Nodes, RolesPanel, DeleteNodePopup
|
||||
from tests import preconditions
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
|
||||
class TestDiscardEnvironmentChanges(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Click on created environment
|
||||
3. Deploy environment with 1 controller and 2 compute nodes
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
preconditions.Environment.simple_flat()
|
||||
time.sleep(1)
|
||||
preconditions.Environment().deploy_nodes(1, 2)
|
||||
|
||||
def _discard_changes(self):
|
||||
Nodes().discard_changes.click()
|
||||
with DiscardChangesPopup() as p:
|
||||
p.discard.click()
|
||||
p.wait_until_exists()
|
||||
|
||||
time.sleep(2)
|
||||
self.assertEqual(3, len(Nodes().nodes), 'Nodes amount')
|
||||
for node in Nodes().nodes:
|
||||
self.assertEqual('ready', node.status.text.lower(),
|
||||
'Node status is READY')
|
||||
|
||||
def test_discard_adding_node(self):
|
||||
"""Discard changes after adding new node
|
||||
|
||||
Scenario:
|
||||
1. Add compute node
|
||||
2. Discard changes
|
||||
3. Verify that there are 3 nodes and their statuses are ready
|
||||
"""
|
||||
Nodes().add_nodes.click()
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
self._discard_changes()
|
||||
|
||||
def test_discard_deleting_node(self):
|
||||
"""Discard changes after deleting node
|
||||
|
||||
Scenario:
|
||||
1. Delete one compute node
|
||||
2. Discard changes
|
||||
3. Verify that there are 3 nodes and their statuses are ready
|
||||
"""
|
||||
with Nodes() as n:
|
||||
n.nodes[1].checkbox.click()
|
||||
n.delete_nodes.click()
|
||||
with DeleteNodePopup() as p:
|
||||
p.delete.click()
|
||||
p.wait_until_exists()
|
||||
time.sleep(1)
|
||||
self._discard_changes()
|
|
@ -1,425 +0,0 @@
|
|||
import time
|
||||
import random
|
||||
from pageobjects.environments import Environments, Wizard
|
||||
from pageobjects.settings import Settings
|
||||
from pageobjects.tabs import Tabs
|
||||
from settings import OPENSTACK_CENTOS, OPENSTACK_RELEASE_CENTOS
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
|
||||
class BaseClass(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with Neutron with GRE segmentation
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
cls.get_home()
|
||||
Environments().create_cluster_box.click()
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.network_neutron_gre.click()
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on created environment
|
||||
2. Open Settings tab
|
||||
"""
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
Tabs().settings.click()
|
||||
|
||||
def _test_text_field(self, text_field, value):
|
||||
def_value = None
|
||||
with Settings() as s:
|
||||
def_value = getattr(s, text_field).get_attribute('value')
|
||||
getattr(s, text_field).clear()
|
||||
getattr(s, text_field).send_keys(value)
|
||||
s.save_settings.click()
|
||||
time.sleep(1)
|
||||
self.refresh()
|
||||
with Settings() as s:
|
||||
self.assertEqual(getattr(s, text_field).get_attribute('value'),
|
||||
value)
|
||||
s.load_defaults.click()
|
||||
time.sleep(1)
|
||||
self.assertEqual(
|
||||
getattr(s, text_field).get_attribute('value'), def_value,
|
||||
"load defaults value")
|
||||
|
||||
def _test_tumbler_field(self, tumbler_field):
|
||||
def_value = None
|
||||
with Settings() as s:
|
||||
def_value = getattr(s, tumbler_field).\
|
||||
find_element_by_tag_name('input').is_selected()
|
||||
getattr(s, tumbler_field).click()
|
||||
s.save_settings.click()
|
||||
time.sleep(1)
|
||||
self.refresh()
|
||||
with Settings() as s:
|
||||
self.assertEqual(
|
||||
getattr(s, tumbler_field).
|
||||
find_element_by_tag_name('input').is_selected(), not def_value)
|
||||
s.load_defaults.click()
|
||||
time.sleep(1)
|
||||
self.assertEqual(
|
||||
getattr(s, tumbler_field).
|
||||
find_element_by_tag_name('input').is_selected(), def_value,
|
||||
"load defaults value")
|
||||
|
||||
def _test_radio_group(self, radios, nodefault=None):
|
||||
radios.reverse()
|
||||
for radio in radios:
|
||||
with Settings() as s:
|
||||
getattr(s, radio).click()
|
||||
s.save_settings.click()
|
||||
time.sleep(1)
|
||||
self.refresh()
|
||||
self.assertTrue(
|
||||
getattr(Settings(), radio).
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
# Set group to not default state
|
||||
if not nodefault:
|
||||
random_radio = radios[random.randint(0, len(radios) - 2)]
|
||||
with Settings() as s:
|
||||
getattr(s, random_radio).click()
|
||||
s.load_defaults.click()
|
||||
time.sleep(1)
|
||||
self.assertTrue(
|
||||
getattr(s, radios[-1]).
|
||||
find_element_by_tag_name('input').is_selected(),
|
||||
"load defaults value")
|
||||
|
||||
|
||||
class TestAccess(BaseClass):
|
||||
|
||||
def test_username(self):
|
||||
"""Change username
|
||||
|
||||
Scenario:
|
||||
1. Enter new username
|
||||
2. Save settings
|
||||
3. Verify that username is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that previous username is displayed
|
||||
"""
|
||||
self._test_text_field('username', 'newname')
|
||||
|
||||
def test_password(self):
|
||||
"""Change password
|
||||
|
||||
Scenario:
|
||||
1. Enter new password
|
||||
2. Save settings
|
||||
3. Verify that password is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that previous password is activated
|
||||
"""
|
||||
self._test_text_field('password', 'newpassword')
|
||||
|
||||
def test_password_show(self):
|
||||
"""Show password feature
|
||||
|
||||
Scenario:
|
||||
1. Click show password button
|
||||
2. Verify that text of the password is displayed
|
||||
3. Click on show password button again
|
||||
4. Verify that password text isn't displayed
|
||||
"""
|
||||
with Settings() as s:
|
||||
s.show_password.click()
|
||||
self.assertEqual(s.password.get_attribute('type'), 'text')
|
||||
s.show_password.click()
|
||||
self.assertEqual(s.password.get_attribute('type'), 'password')
|
||||
|
||||
def test_tenant(self):
|
||||
"""Change tenant
|
||||
|
||||
Scenario:
|
||||
1. Enter new tenant
|
||||
2. Save settings
|
||||
3. Verify that tenant is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that previous tenant name is displayed
|
||||
"""
|
||||
self._test_text_field('tenant', 'newtenant')
|
||||
|
||||
def test_email(self):
|
||||
"""Change email
|
||||
|
||||
Scenario:
|
||||
1. Enter new email
|
||||
2. Save settings
|
||||
3. Verify that email is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that previous email is displayed
|
||||
"""
|
||||
self._test_text_field('email', 'newemail@example.org')
|
||||
|
||||
|
||||
class TestAdditionalComponents(BaseClass):
|
||||
|
||||
def test_sahara(self):
|
||||
"""Install Sahara component
|
||||
|
||||
Scenario:
|
||||
1. Click on Install Sahara checkbox
|
||||
2. Save settings
|
||||
3. Verify that Install Sahara checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that Install Sahara checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('install_sahara')
|
||||
|
||||
def test_murano(self):
|
||||
"""Install Murano component
|
||||
|
||||
Scenario:
|
||||
1. Click on Install Murano checkbox
|
||||
2. Save settings
|
||||
3. Verify that Install Murano checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that Install Murano checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('install_murano')
|
||||
|
||||
def test_ceilometer(self):
|
||||
"""Install Ceilometer component
|
||||
|
||||
Scenario:
|
||||
1. Click on Install Ceilometer checkbox
|
||||
2. Save settings
|
||||
3. Verify that Install Ceilometer checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that Install Ceilometer checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('install_ceilometer')
|
||||
|
||||
|
||||
class TestCommon(BaseClass):
|
||||
|
||||
def test_debug(self):
|
||||
"""Enable OpenStack debug logging
|
||||
|
||||
Scenario:
|
||||
1. Click on OpenStack debug logging checkbox
|
||||
2. Save settings
|
||||
3. Verify that OpenStack debug logging checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that OpenStack debug logging checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('debug')
|
||||
|
||||
def test_hypervisor_type(self):
|
||||
"""Change hypervisor type
|
||||
|
||||
Scenario:
|
||||
1. Select hypervisor type 'KVM'
|
||||
2. Save settings
|
||||
3. Verify that KVM hypervisor type is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that QEMU hypervisor is selected
|
||||
"""
|
||||
self._test_radio_group(['hypervisor_qemu', 'hypervisor_kvm'])
|
||||
|
||||
def test_assign_ip(self):
|
||||
"""Enable Auto assign floating IP
|
||||
|
||||
Scenario:
|
||||
1. Click on Auto assign floating IP checkbox
|
||||
2. Save settings
|
||||
3. Verify that Auto assign floating IP checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that Auto assign floating IP checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('assign_ip')
|
||||
|
||||
def test_scheduler_driver(self):
|
||||
"""Change scheduler driver
|
||||
|
||||
Scenario:
|
||||
1. Select 'Simple scheduler' radio button
|
||||
2. Save settings
|
||||
3. Verify that 'Simple scheduler' is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Filter scheduler' is selected
|
||||
"""
|
||||
self._test_radio_group(['filter_scheduler', 'simple_scheduler'])
|
||||
|
||||
def test_vlan_splinters(self):
|
||||
"""Enable VSwitch VLAN splinters
|
||||
|
||||
Scenario:
|
||||
1. Select 'OVS VLAN splinters soft trunks' radio button
|
||||
2. Save settings
|
||||
3. Verify that 'OVS VLAN splinters soft trunks' is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Disabled' is selected
|
||||
"""
|
||||
Settings().vlan_splinters.click()
|
||||
self._test_radio_group(
|
||||
['vlan_splinters_soft', 'vlan_splinters_hard'], nodefault=True)
|
||||
|
||||
def test_use_cow_images(self):
|
||||
"""Enable 'Use qcow format for images'
|
||||
|
||||
Scenario:
|
||||
1. Click on 'Use qcow format for images' checkbox
|
||||
2. Save settings
|
||||
3. Verify that 'Use qcow format for images' checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Use qcow format for images'
|
||||
checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('use_cow_images')
|
||||
|
||||
def test_start_guests(self):
|
||||
"""Enable 'Start guests on host boot'
|
||||
|
||||
Scenario:
|
||||
1. Click on 'Start guests on host boot' checkbox
|
||||
2. Save settings
|
||||
3. Verify that 'Start guests on host boot' checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Start guests on host boot' checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('start_guests')
|
||||
|
||||
def test_auth_key(self):
|
||||
"""Change authorization key
|
||||
|
||||
Scenario:
|
||||
1. Enter new authorization key
|
||||
2. Save settings
|
||||
3. Verify that authorization key is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that default authorization key is active
|
||||
"""
|
||||
self._test_text_field('auth_key', 'newauthkey')
|
||||
|
||||
|
||||
class TestSyslog(BaseClass):
|
||||
|
||||
def test_hostname(self):
|
||||
"""Change hostname
|
||||
|
||||
Scenario:
|
||||
1. Enter new hostname
|
||||
2. Save settings
|
||||
3. Verify that hostname is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that default hostname is displayed
|
||||
"""
|
||||
self._test_text_field('syslog_server', 'newsyslog_server')
|
||||
|
||||
def test_port(self):
|
||||
"""Change port
|
||||
|
||||
Scenario:
|
||||
1. Enter new port value
|
||||
2. Save settings
|
||||
3. Verify that port value is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that default port value is displayed
|
||||
"""
|
||||
self._test_text_field('syslog_port', '8000')
|
||||
|
||||
def test_syslog_protocol(self):
|
||||
"""Change syslog transport protocol
|
||||
|
||||
Scenario:
|
||||
1. Select 'TCP' radio button
|
||||
2. Save settings
|
||||
3. Verify that 'TCP' is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'UDP' is selected
|
||||
"""
|
||||
self._test_radio_group(['syslog_tcp', 'syslog_udp'])
|
||||
|
||||
|
||||
class TestStorage(BaseClass):
|
||||
|
||||
def test_cinder_for_volumes(self):
|
||||
"""Enable 'Cinder LVM'
|
||||
|
||||
Scenario:
|
||||
1. Click on 'Cinder LVM' checkbox
|
||||
2. Save settings
|
||||
3. Verify that 'Cinder LVM' checkbox is not selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Cinder LVM' checkbox is selected
|
||||
"""
|
||||
self._test_tumbler_field('cinder_for_volumes')
|
||||
|
||||
def test_ceph_for_volumes(self):
|
||||
"""Enable 'Ceph for volumes'
|
||||
|
||||
Scenario:
|
||||
1. Click on 'Ceph for volumes' checkbox
|
||||
2. Save settings
|
||||
3. Verify that 'Ceph for volumes' checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Ceph for volumes' checkbox is not selected
|
||||
"""
|
||||
Settings().cinder_for_volumes.click()
|
||||
self._test_tumbler_field('ceph_for_volumes')
|
||||
|
||||
def test_ceph_for_images(self):
|
||||
"""Enable 'Ceph for images'
|
||||
|
||||
Scenario:
|
||||
1. Click on 'Ceph for images' checkbox
|
||||
2. Save settings
|
||||
3. Verify that 'Ceph for images' checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Ceph for images' checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('ceph_for_images')
|
||||
|
||||
def test_ceph_ephemeral(self):
|
||||
"""Enable 'Ceph for ephemeral'
|
||||
|
||||
Scenario:
|
||||
1. Click on 'Ceph for ephemeral' checkbox
|
||||
2. Save settings
|
||||
3. Verify that 'Ceph for ephemeral' checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Ceph for ephemeral' checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('ceph_ephemeral')
|
||||
|
||||
def test_ceph_rados_gw(self):
|
||||
"""Enable 'Ceph RadosGW for objects'
|
||||
|
||||
Scenario:
|
||||
1. Click on 'Ceph RadosGW for objects' checkbox
|
||||
2. Save settings
|
||||
3. Verify that 'Ceph RadosGW for objects' checkbox is selected
|
||||
4. Click Load defaults
|
||||
5. Verify that 'Ceph RadosGW for objects' checkbox is not selected
|
||||
"""
|
||||
self._test_tumbler_field('ceph_rados_gw')
|
||||
|
||||
def test_ceph_factor(self):
|
||||
"""Change ceph factor
|
||||
|
||||
Scenario:
|
||||
1. Enter new ceph factor
|
||||
2. Save settings
|
||||
3. Verify that ceph factor value is correctly saved
|
||||
4. Click Load defaults
|
||||
5. Verify that default ceph factor value is displayed
|
||||
"""
|
||||
self._test_text_field('ceph_factor', '10')
|
|
@ -1,439 +0,0 @@
|
|||
import time
|
||||
from pageobjects.base import PageObject
|
||||
from pageobjects.environments import Environments, Wizard
|
||||
from pageobjects.header import Header
|
||||
from pageobjects.releases import Releases
|
||||
from settings import OPENSTACK_RELEASE_CENTOS
|
||||
from settings import OPENSTACK_RELEASE_UBUNTU, OPENSTACK_RELEASE_REDHAT
|
||||
from settings import OPENSTACK_REDHAT, REDHAT_USERNAME, REDHAT_PASSWORD
|
||||
from settings import REDHAT_SATELLITE, REDHAT_ACTIVATION_KEY
|
||||
from tests.base import BaseTestCase
|
||||
from nose.plugins.attrib import attr
|
||||
|
||||
|
||||
class TestEnvWizard(BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on create environment
|
||||
"""
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_box.click()
|
||||
|
||||
def test_name_field(self):
|
||||
"""Test environment name
|
||||
|
||||
Scenario:
|
||||
1. Enter Environment name
|
||||
2. Click next and then previous button
|
||||
3. Verify that correct name is displayed
|
||||
4. Clear environment name and click next
|
||||
5. Verify that message 'Environment name cannot be empty' appears
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_CENTOS)
|
||||
w.next.click()
|
||||
w.prev.click()
|
||||
self.assertEqual(w.name.get_attribute('value'),
|
||||
OPENSTACK_RELEASE_CENTOS)
|
||||
w.name.clear()
|
||||
w.next.click()
|
||||
self.assertIn(
|
||||
'Environment name cannot be empty',
|
||||
w.name.find_element_by_xpath('..').text)
|
||||
|
||||
def test_name_exists(self):
|
||||
"""Test existing environment name
|
||||
|
||||
Scenario:
|
||||
1. Create environment with 'test name'
|
||||
2. Click create environment again
|
||||
3. Enter 'test name'
|
||||
4. Click next button
|
||||
5. Verify that message 'Environment with name test name
|
||||
already exists' appears
|
||||
"""
|
||||
name = 'test name'
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(name)
|
||||
for i in range(6):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
self.get_home()
|
||||
Environments().create_cluster_box.click()
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(name)
|
||||
w.next.click()
|
||||
time.sleep(1)
|
||||
self.assertIn('Environment with name "{}" already exists'.
|
||||
format(name),
|
||||
w.name.find_element_by_xpath('..').text)
|
||||
|
||||
def test_release_field(self):
|
||||
"""Test environment release field
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select Havana on Ubuntu in release list
|
||||
3. Click next button
|
||||
4. Click previous button
|
||||
5. Verify that correct release is selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
w.prev.click()
|
||||
self.assertEqual(w.release.first_selected_option.text,
|
||||
OPENSTACK_RELEASE_UBUNTU)
|
||||
|
||||
@attr('redhat')
|
||||
def test_rhel_empty_form(self):
|
||||
"""Test validation of empty RHEL form
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select RHOS for RHEL in release list
|
||||
3. Click next button
|
||||
4. Verify that 'Invalid username' and 'Invalid password'
|
||||
messages appear
|
||||
5. Select RHN Satellite license and click next
|
||||
6. Verify that error messages appear
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_REDHAT)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_REDHAT)
|
||||
w.next.click()
|
||||
self.assertIn('Invalid username',
|
||||
w.redhat_username.find_element_by_xpath('..').text)
|
||||
self.assertIn('Invalid password',
|
||||
w.redhat_password.find_element_by_xpath('..').text)
|
||||
|
||||
w.license_rhn.click()
|
||||
w.next.click()
|
||||
self.assertIn('Invalid username',
|
||||
w.redhat_username.find_element_by_xpath('..').text)
|
||||
self.assertIn('Invalid password',
|
||||
w.redhat_password.find_element_by_xpath('..').text)
|
||||
self.assertIn(
|
||||
'Only valid fully qualified domain name is allowed for the '
|
||||
'hostname field',
|
||||
w.redhat_satellite.find_element_by_xpath('..').text)
|
||||
self.assertIn(
|
||||
'Invalid activation key',
|
||||
w.redhat_activation_key.find_element_by_xpath('..').text)
|
||||
|
||||
@attr('redhat')
|
||||
def test_rhel_form(self):
|
||||
"""Test RHEL form on presence of necessary fields
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select RHOS for RHEL in release list
|
||||
3. Verify all necessary fields exist
|
||||
4. Select RHN Satellite license
|
||||
5. Verify satellite and activation key fields appear
|
||||
6. Select RHSM radio button
|
||||
7. Verify satellite and activation key fields disappear
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_REDHAT)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_REDHAT)
|
||||
self.assertTrue(w.license_rhsm.is_displayed())
|
||||
self.assertTrue(w.license_rhn.is_displayed())
|
||||
self.assertTrue(w.redhat_username.is_displayed())
|
||||
self.assertTrue(w.redhat_password.is_displayed())
|
||||
|
||||
w.license_rhn.click()
|
||||
self.assertTrue(w.redhat_satellite.is_displayed())
|
||||
self.assertTrue(w.redhat_activation_key.is_displayed())
|
||||
|
||||
w.license_rhsm.click()
|
||||
self.assertFalse(w.redhat_satellite.is_displayed())
|
||||
self.assertFalse(w.redhat_activation_key.is_displayed())
|
||||
|
||||
def test_mode_radios(self):
|
||||
"""Test development mode
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select Havana on Ubuntu in release list and click next
|
||||
3. Select HA mode and click next
|
||||
4. Click previous
|
||||
5. Verify HA mode is selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
w.mode_ha_compact.click()
|
||||
w.next.click()
|
||||
w.prev.click()
|
||||
self.assertTrue(w.mode_ha_compact.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(w.mode_multinode.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def test_hypervisor_radios(self):
|
||||
"""Select environment hypervisor
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select Havana on Ubuntu in release list and click next
|
||||
3. Click next again
|
||||
4. Select KVM hypervisor and click next
|
||||
5. Click previous
|
||||
6. Verify KVM is selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.hypervisor_qemu.click()
|
||||
w.next.click()
|
||||
w.prev.click()
|
||||
self.assertTrue(w.hypervisor_qemu.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(w.hypervisor_kvm.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def test_network_radios(self):
|
||||
"""Select environment network
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select Havana on Ubuntu in release list
|
||||
and click next three times
|
||||
3. Select Neutron with GRE segmentation
|
||||
4. Click next and click previous button
|
||||
5. Verify Neutron with GRE network is selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.network_neutron_gre.click()
|
||||
w.next.click()
|
||||
w.prev.click()
|
||||
self.assertFalse(w.network_nova.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(w.network_neutron_gre.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(w.network_neutron_vlan.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
w.network_neutron_vlan.click()
|
||||
self.assertFalse(w.network_nova.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(w.network_neutron_gre.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(w.network_neutron_vlan.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def test_storage_radios(self):
|
||||
"""Select environment storage
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select Havana on Ubuntu in release list
|
||||
and click next four times
|
||||
3. Select Ceph for Cinder and Glance
|
||||
4. Click next and click previous button
|
||||
5. Verify Ceph options are selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.storage_cinder_ceph.click()
|
||||
w.storage_glance_ceph.click()
|
||||
w.next.click()
|
||||
w.prev.click()
|
||||
self.assertFalse(w.storage_cinder_default.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(w.storage_cinder_ceph.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(w.storage_glance_default.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(w.storage_glance_ceph.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def test_services_checkboxes(self):
|
||||
"""Select environment additional services
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select Havana on Ubuntu in release list and
|
||||
click next three times
|
||||
3. Select Neutron with GRE network
|
||||
4. Click next two times
|
||||
5. Select install Sahara, Murano, Ceilometer
|
||||
6. Click next and previous button
|
||||
7. Verify checkboxes are selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.network_neutron_gre.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.install_sahara.click()
|
||||
w.install_murano.click()
|
||||
w.install_ceilometer.click()
|
||||
w.next.click()
|
||||
w.prev.click()
|
||||
self.assertTrue(w.install_sahara.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(w.install_murano.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(w.install_ceilometer.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def test_cancel_button(self):
|
||||
"""Cancel environment wizard
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select Havana on Ubuntu in release list and click next
|
||||
3. Select HA mode and click next
|
||||
4. Select KVM hypervisor and click next
|
||||
5. Select Neutron with GRE and click next
|
||||
6. Select Ceph options for Cinder and Glance and click next
|
||||
7. Select install Sahara, Murano and click next
|
||||
8. Click cancel button
|
||||
9. Click create environment again and check that
|
||||
all default values are selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
w.mode_ha_compact.click()
|
||||
w.next.click()
|
||||
w.hypervisor_kvm.click()
|
||||
w.next.click()
|
||||
w.network_neutron_gre.click()
|
||||
w.next.click()
|
||||
w.storage_cinder_ceph.click()
|
||||
w.storage_glance_ceph.click()
|
||||
w.next.click()
|
||||
w.install_sahara.click()
|
||||
w.install_murano.click()
|
||||
w.next.click()
|
||||
w.cancel.click()
|
||||
PageObject.wait_until_exists(w.parent)
|
||||
|
||||
Environments().create_cluster_box.click()
|
||||
with Wizard() as w:
|
||||
self.assertEqual(w.name.get_attribute('value'), '')
|
||||
self.assertEqual(w.release.first_selected_option.text,
|
||||
OPENSTACK_RELEASE_CENTOS)
|
||||
w.name.send_keys(OPENSTACK_RELEASE_UBUNTU)
|
||||
w.next.click()
|
||||
self.assertTrue(w.mode_ha_compact.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
w.next.click()
|
||||
self.assertTrue(w.hypervisor_qemu.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
w.next.click()
|
||||
self.assertTrue(w.network_nova.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
w.next.click()
|
||||
self.assertTrue(w.storage_cinder_default.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(w.storage_glance_default.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
w.next.click()
|
||||
self.assertFalse(w.install_sahara.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(w.install_murano.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
|
||||
class TestEnvWizardRedHat(BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on create environment
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_box.click()
|
||||
|
||||
@attr('redhat')
|
||||
def test_rhsm(self):
|
||||
"""Download RHEL and RHOS by RHSM
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select RHOS in release list
|
||||
3. Enter Redhat username and password
|
||||
4. Click next till the end and click create
|
||||
5. Open releases tab
|
||||
6. Verify that RHOS status is active
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_REDHAT)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_REDHAT)
|
||||
w.license_rhsm.click()
|
||||
w.redhat_username.send_keys(REDHAT_USERNAME)
|
||||
w.redhat_password.send_keys(REDHAT_PASSWORD)
|
||||
for i in range(6):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
Header().releases.click()
|
||||
with Releases() as r:
|
||||
PageObject.wait_until_exists(
|
||||
r.dict[OPENSTACK_REDHAT].download_progress, timeout=20)
|
||||
self.assertEqual(
|
||||
'Active', r.dict[OPENSTACK_REDHAT].status.text,
|
||||
'RHOS status is active')
|
||||
|
||||
@attr('redhat')
|
||||
def test_rhn_satellite(self):
|
||||
"""Download RHEL and RHOS by RHN satellite
|
||||
|
||||
Scenario:
|
||||
1. Enter environment name
|
||||
2. Select RHOS in release list
|
||||
3. Select RHN option
|
||||
4. Enter Redhat username and password, satellite
|
||||
hostname and activation key
|
||||
5. Click next till the end and click create
|
||||
6. Open releases tab
|
||||
7. Verify that RHOS status is active
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_RELEASE_REDHAT)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_REDHAT)
|
||||
w.license_rhn.click()
|
||||
w.redhat_username.send_keys(REDHAT_USERNAME)
|
||||
w.redhat_password.send_keys(REDHAT_PASSWORD)
|
||||
w.redhat_satellite.send_keys(REDHAT_SATELLITE)
|
||||
w.redhat_activation_key.send_keys(REDHAT_ACTIVATION_KEY)
|
||||
for i in range(6):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
Header().releases.click()
|
||||
with Releases() as r:
|
||||
PageObject.wait_until_exists(
|
||||
r.dict[OPENSTACK_REDHAT].download_progress, timeout=20)
|
||||
self.assertEqual(
|
||||
'Active', r.dict[OPENSTACK_REDHAT].status.text,
|
||||
'RHOS status is active')
|
|
@ -1,277 +0,0 @@
|
|||
import time
|
||||
from pageobjects.environments import Environments, Wizard
|
||||
from pageobjects.networks import Networks, NeutronParameters
|
||||
from pageobjects.nodes import Nodes
|
||||
from pageobjects.settings import Settings
|
||||
from pageobjects.tabs import Tabs
|
||||
from settings import OPENSTACK_CENTOS, OPENSTACK_RELEASE_CENTOS
|
||||
from tests.base import BaseTestCase
|
||||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class TestEnvironment(BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Click on create environment
|
||||
"""
|
||||
self.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_box.click()
|
||||
|
||||
def test_default_settings(self):
|
||||
"""Create default environment
|
||||
|
||||
Scenario:
|
||||
1. Create environment with default values
|
||||
2. Click on created environment
|
||||
3. Verify that correct environment name is displayed
|
||||
4. Verify all information is displayed correctly
|
||||
5. Verify all info on Networks and Settings tab
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
for i in range(6):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
self.get_home()
|
||||
cb = Environments().create_cluster_boxes[0]
|
||||
self.assertIn(OPENSTACK_CENTOS, cb.text)
|
||||
cb.click()
|
||||
|
||||
with Nodes() as n:
|
||||
time.sleep(1)
|
||||
self.assertIn(OPENSTACK_CENTOS, n.env_summary.text)
|
||||
self.assertIn('New', n.env_summary.text)
|
||||
self.assertIn('Multi-node', n.env_summary.text)
|
||||
self.assertIn('with HA', n.env_summary.text)
|
||||
Tabs().networks.click()
|
||||
with Networks() as n:
|
||||
self.assertTrue(n.flatdhcp_manager.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
Tabs().settings.click()
|
||||
with Settings() as s:
|
||||
self.assertFalse(s.install_sahara.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(s.install_murano.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(s.install_ceilometer.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(s.hypervisor_qemu.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
pass
|
||||
|
||||
def test_simple_mode(self):
|
||||
"""Create environment with simple mode
|
||||
|
||||
Scenario:
|
||||
1. Create environment with simple mode
|
||||
2. Click on created environment
|
||||
3. Verify that correct environment name is displayed
|
||||
4. Verify all information is displayed correctly
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
w.next.click()
|
||||
w.mode_multinode.click()
|
||||
for i in range(5):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
self.get_home()
|
||||
cb = Environments().create_cluster_boxes[0]
|
||||
cb.click()
|
||||
|
||||
with Nodes() as n:
|
||||
self.assertIn(OPENSTACK_CENTOS,
|
||||
PageObject.get_text(n, 'env_summary'))
|
||||
self.assertIn('Multi-node', n.env_summary.text)
|
||||
|
||||
def test_hypervisor_kvm(self):
|
||||
"""Create environment with KVM hypervisor
|
||||
|
||||
Scenario:
|
||||
1. Create environment with KVM hypervisor
|
||||
2. Click on created environment
|
||||
3. Open settings tab
|
||||
4. Verify KVM hypervisor is selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.hypervisor_kvm.click()
|
||||
for i in range(4):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
Tabs().settings.click()
|
||||
|
||||
with Settings() as s:
|
||||
self.assertTrue(s.hypervisor_kvm.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def test_neutron_gre(self):
|
||||
"""Create environment with Neutron GRE network
|
||||
|
||||
Scenario:
|
||||
1. Create environment with Neutron GRE network
|
||||
2. Click on created environment
|
||||
3. Open networks tab
|
||||
4. Verify Neutron parameters are displayed and
|
||||
Neutron with gre segmentation text is displayed
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.network_neutron_gre.click()
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
Tabs().networks.click()
|
||||
|
||||
with Networks() as n:
|
||||
self.assertEqual(n.segmentation_type.text,
|
||||
'Neutron with GRE segmentation')
|
||||
self.assertTrue(NeutronParameters().parent.is_displayed())
|
||||
|
||||
def test_neutron_vlan(self):
|
||||
"""Create environment with Neutron VLAN network
|
||||
|
||||
Scenario:
|
||||
1. Create environment with Neutron VLAN network
|
||||
2. Click on created environment
|
||||
3. Open networks tab
|
||||
4. Verify Neutron parameters are displayed and
|
||||
Neutron with vlan segmentation text is displayed
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.network_neutron_vlan.click()
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
Tabs().networks.click()
|
||||
|
||||
with Networks() as n:
|
||||
self.assertEqual(n.segmentation_type.text,
|
||||
'Neutron with VLAN segmentation')
|
||||
self.assertTrue(NeutronParameters().parent.is_displayed())
|
||||
|
||||
def test_storage_ceph(self):
|
||||
"""Create environment with Ceph storage
|
||||
|
||||
Scenario:
|
||||
1. Create environment with Ceph storage for Cinder and Glance
|
||||
2. Click on created environment
|
||||
3. Open settings tab
|
||||
4. Verify that Cinder for volumes, Ceph for volumes
|
||||
and images are selected, Ceph for rados isn't selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
for i in range(4):
|
||||
w.next.click()
|
||||
w.storage_cinder_ceph.click()
|
||||
w.storage_glance_ceph.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
Tabs().settings.click()
|
||||
|
||||
with Settings() as s:
|
||||
self.assertTrue(s.ceph_for_volumes.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(s.ceph_for_images.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertFalse(s.ceph_rados_gw.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def test_services(self):
|
||||
"""Create environment with Sahara, Murano, Ceilometer selected
|
||||
|
||||
Scenario:
|
||||
1. Create environment with Install Sahara,
|
||||
Murano, Ceilometer selected
|
||||
2. Click on created environment
|
||||
3. Open settings tab
|
||||
4. Verify that Install Sahara, Murano,
|
||||
Ceilometer checkboxes are selected
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.release.select_by_visible_text(OPENSTACK_RELEASE_CENTOS)
|
||||
for i in range(3):
|
||||
w.next.click()
|
||||
w.network_neutron_gre.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.install_sahara.click()
|
||||
w.install_murano.click()
|
||||
w.install_ceilometer.click()
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
|
||||
Tabs().settings.click()
|
||||
|
||||
with Settings() as s:
|
||||
self.assertTrue(s.install_sahara.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(s.install_murano.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
self.assertTrue(s.install_ceilometer.
|
||||
find_element_by_tag_name('input').is_selected())
|
||||
|
||||
def simle_vcenter_env(self):
|
||||
"""Create VCenter environment with simple
|
||||
mode and verify that element will be created
|
||||
author: Tatyana Dubyk /8th of August
|
||||
|
||||
Test scenario:
|
||||
1.Create openstack env with vCenter hypervisor
|
||||
2.Select all settings by default, besides vCenter's settings
|
||||
3.Check that on page present new created env with required name
|
||||
"""
|
||||
with Wizard() as w:
|
||||
w.name.send_keys(OPENSTACK_CENTOS)
|
||||
w.next.click()
|
||||
w.mode_multinode.click()
|
||||
w.next.click()
|
||||
w.compute_vcenter.click()
|
||||
w.vcenter_ip_inputfield.send_keys('172.16.0.254')
|
||||
w.vcenter_username_inputfield.send_keys(
|
||||
'administrator@vsphere.local')
|
||||
w.vcenter_password_inputfield.send_keys('Qwer!1234')
|
||||
w.vcenter_cluster_inputfield.click()
|
||||
w.vcenter_cluster_inputfield.send_keys('Cluster1,Cluster2')
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.next.click()
|
||||
w.create.click()
|
||||
w.wait_until_exists()
|
||||
w.find_required_env(self, OPENSTACK_CENTOS)
|
||||
self.assertEquals(self, OPENSTACK_CENTOS.lower().replace(" ", ""),
|
||||
w.vcenter_cluster_created_name)
|
|
@ -1,194 +0,0 @@
|
|||
import time
|
||||
from pageobjects.actions import Actions, DeleteEnvironmentPopup
|
||||
from pageobjects.environments import Environments, DeployChangesPopup
|
||||
from pageobjects.nodes import Nodes, RolesPanel
|
||||
from pageobjects.tabs import Tabs
|
||||
from tests import preconditions
|
||||
from tests.base import BaseTestCase
|
||||
from pageobjects.header import TaskResultAlert
|
||||
from pageobjects.base import PageObject
|
||||
|
||||
|
||||
class TestEnvironmentActions(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Create environment with default values
|
||||
2. Open created environment
|
||||
3. Open actions tab
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
preconditions.Environment.simple_flat()
|
||||
Tabs().actions.click()
|
||||
|
||||
def test_rename(self):
|
||||
"""Rename environment
|
||||
|
||||
Scenario:
|
||||
1. Clear environment name
|
||||
2. Enter new name
|
||||
3. Click Rename
|
||||
4. Verify environment name is changed
|
||||
"""
|
||||
value = 'Happy environment'
|
||||
with Actions() as a:
|
||||
a.name.clear()
|
||||
a.name.send_keys(value)
|
||||
a.rename.click()
|
||||
time.sleep(1)
|
||||
Tabs().nodes.click()
|
||||
self.assertIn(value, Nodes().env_name.text,
|
||||
'Environment has been renamed')
|
||||
|
||||
def test_delete(self):
|
||||
"""Delete environment
|
||||
|
||||
Scenario:
|
||||
1. Click delete environment
|
||||
2. Click delete on confirmation pop-up
|
||||
3. Verify that environment is deleted
|
||||
"""
|
||||
with Actions() as a:
|
||||
a.delete.click()
|
||||
DeleteEnvironmentPopup().delete.click()
|
||||
time.sleep(1)
|
||||
self.assertEqual(
|
||||
0, len(Environments().create_cluster_boxes),
|
||||
'Environment has been deleted')
|
||||
|
||||
def test_reset_inactive(self):
|
||||
"""Check reset button is inactive
|
||||
|
||||
Scenario:
|
||||
1. Check reset button is inactive
|
||||
"""
|
||||
self.assertFalse(Actions().reset.is_enabled())
|
||||
|
||||
def test_simple_reset(self):
|
||||
"""Reset simple environment
|
||||
|
||||
Scenario:
|
||||
1. Add controller and compute nodes
|
||||
2. Deploy claster
|
||||
3. Click reset after deploying
|
||||
4. Verify that environment is reseted
|
||||
"""
|
||||
Tabs().nodes.click()
|
||||
Nodes().add_controller_compute_nodes()
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
TaskResultAlert().close.click()
|
||||
Tabs().actions.click()
|
||||
Actions().reset_env()
|
||||
Tabs().nodes.click()
|
||||
for node in Nodes().nodes:
|
||||
self.assertEqual(
|
||||
'pending addition', node.status.text.lower(),
|
||||
'Node status is Pending Addition')
|
||||
self.assertTrue(Nodes().deploy_changes.is_enabled())
|
||||
|
||||
def test_cancel_reset(self):
|
||||
"""Cancel reset environment
|
||||
|
||||
Scenario:
|
||||
1. Add controller and compute nodes
|
||||
2. Deploy claster
|
||||
3. Click reset after deploying and click cancel on popup
|
||||
4. Verify that environment isn't reseted
|
||||
"""
|
||||
Tabs().nodes.click()
|
||||
Nodes().add_controller_compute_nodes()
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
TaskResultAlert().close.click()
|
||||
Tabs().actions.click()
|
||||
Actions().cancel_reset()
|
||||
for node in Nodes().nodes:
|
||||
self.assertEqual(
|
||||
'ready', node.status.text.lower(),
|
||||
'Node status is Ready')
|
||||
Actions().verify_disabled_deploy
|
||||
|
||||
def test_stop_deploy(self):
|
||||
"""Stop deploy
|
||||
|
||||
Scenario:
|
||||
1. Add controller and compute nodes
|
||||
2. Click deploy
|
||||
3. Click stop
|
||||
4. Verify that environment isn't deployed
|
||||
"""
|
||||
Tabs().nodes.click()
|
||||
Nodes().add_controller_compute_nodes()
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
Actions().cancel_popup.click()
|
||||
Actions().stop_deploy_process()
|
||||
for node in Nodes().nodes:
|
||||
self.assertEqual(
|
||||
'pending addition', PageObject.get_lower_text(node, 'status'),
|
||||
'Node status is Pending Addition')
|
||||
self.assertTrue(Nodes().deploy_changes.is_enabled())
|
||||
|
||||
def test_reset_redeploy(self):
|
||||
"""Reset environment after deploy changes
|
||||
|
||||
Scenario:
|
||||
1. Add controller and compute nodes
|
||||
2. Click deploy
|
||||
3. Add new compute node and deploy changes
|
||||
4. Reset environment
|
||||
4. Verify that environment is reseted
|
||||
"""
|
||||
Tabs().nodes.click()
|
||||
Nodes().add_controller_compute_nodes()
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
TaskResultAlert().close.click()
|
||||
Nodes().add_nodes.click()
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
PageObject.wait_until_exists(Nodes().apply_changes)
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
TaskResultAlert().close.click()
|
||||
Tabs().actions.click()
|
||||
Actions().reset_env()
|
||||
Tabs().nodes.click()
|
||||
for node in Nodes().nodes:
|
||||
self.assertEqual(
|
||||
'pending addition', node.status.text.lower(),
|
||||
'Node status is Pending Addition')
|
||||
self.assertTrue(Nodes().deploy_changes.is_enabled())
|
||||
|
||||
def test_stop_reset(self):
|
||||
"""Stop and then reset environment
|
||||
|
||||
Scenario:
|
||||
1. Add controller and compute nodes
|
||||
2. Click deploy
|
||||
3. Click stop
|
||||
4. Reset environment
|
||||
4. Verify that environment is reseted
|
||||
"""
|
||||
Tabs().nodes.click()
|
||||
Nodes().add_controller_compute_nodes()
|
||||
Nodes().deploy_changes.click()
|
||||
DeployChangesPopup().deploy.click()
|
||||
Actions().cancel_popup.click()
|
||||
Actions().stop_deploy_process()
|
||||
Tabs().actions.click()
|
||||
Actions().reset_env()
|
||||
Tabs().nodes.click()
|
||||
for node in Nodes().nodes:
|
||||
self.assertEqual(
|
||||
'pending addition', node.status.text.lower(),
|
||||
'Node status is Pending Addition')
|
||||
self.assertTrue(Nodes().deploy_changes.is_enabled())
|
|
@ -1,713 +0,0 @@
|
|||
import time
|
||||
from pageobjects.environments import Environments
|
||||
from pageobjects.networks import Networks
|
||||
from pageobjects.nodes import Nodes, RolesPanel
|
||||
from pageobjects.tabs import Tabs
|
||||
from tests.base import BaseTestCase
|
||||
import preconditions
|
||||
|
||||
RANGES = [
|
||||
['172.16.0.3', '172.16.0.10'],
|
||||
['172.16.0.20', '172.16.0.50'],
|
||||
['172.16.0.128', '172.16.0.140'],
|
||||
['172.16.0.158', '172.16.0.165']
|
||||
]
|
||||
|
||||
|
||||
class SimpleFlatNetworks(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.simple_flat()
|
||||
|
||||
def setUp(self):
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
Tabs().networks.click()
|
||||
time.sleep(1)
|
||||
|
||||
def _assert_save_cancel_disabled(self):
|
||||
self.assertFalse(Networks().save_settings.is_enabled(),
|
||||
'Save settings is disabled')
|
||||
self.assertFalse(Networks().cancel_changes.is_enabled(),
|
||||
'Cancel changes is disabled')
|
||||
|
||||
def _assert_save_verify_disabled(self):
|
||||
self.assertFalse(Networks().save_settings.is_enabled(),
|
||||
'Save settings is disabled')
|
||||
self.assertFalse(Networks().verify_networks.is_enabled(),
|
||||
'Verify networks is disabled')
|
||||
|
||||
def _save_settings(self):
|
||||
Networks().save_settings.click()
|
||||
time.sleep(1)
|
||||
self._assert_save_cancel_disabled()
|
||||
self.refresh()
|
||||
|
||||
def _test_ranges_plus_icon(self, network):
|
||||
with getattr(Networks(), network) as n:
|
||||
n.ip_ranges[0].icon_plus.click()
|
||||
self.assertEqual(len(n.ip_ranges), 2, 'Plus icon. row 1')
|
||||
n.ip_ranges[1].icon_plus.click()
|
||||
self.assertEqual(len(n.ip_ranges), 3, 'Plus icon. row 2')
|
||||
n.ip_ranges[1].start.send_keys(RANGES[0][0])
|
||||
n.ip_ranges[1].end.send_keys(RANGES[0][1])
|
||||
n.ip_ranges[0].icon_plus.click()
|
||||
self.assertEqual(len(n.ip_ranges), 4, 'Plus icon. row 1')
|
||||
self.assertEqual(n.ip_ranges[1].start.get_attribute('value'), '')
|
||||
self.assertEqual(n.ip_ranges[1].end.get_attribute('value'), '')
|
||||
self.assertEqual(n.ip_ranges[2].start.get_attribute('value'),
|
||||
RANGES[0][0])
|
||||
self.assertEqual(n.ip_ranges[2].end.get_attribute('value'),
|
||||
RANGES[0][1])
|
||||
|
||||
def _test_ranges_minus_icon(self, network):
|
||||
with getattr(Networks(), network) as n:
|
||||
for i in range(3):
|
||||
n.ip_ranges[i].icon_plus.click()
|
||||
n.ip_ranges[3].icon_minus.click()
|
||||
self.assertEqual(len(n.ip_ranges), 3, 'Minus icon. last row')
|
||||
n.ip_ranges[2].start.send_keys(RANGES[0][0])
|
||||
n.ip_ranges[2].end.click()
|
||||
n.ip_ranges[2].end.clear()
|
||||
n.ip_ranges[2].end.send_keys(RANGES[0][1])
|
||||
n.ip_ranges[1].icon_minus.click()
|
||||
self.assertEqual(len(n.ip_ranges), 2, 'Minus icon. second row')
|
||||
self.assertEqual(n.ip_ranges[1].start.get_attribute('value'),
|
||||
RANGES[0][0])
|
||||
self.assertEqual(n.ip_ranges[1].end.get_attribute('value'),
|
||||
RANGES[0][1])
|
||||
|
||||
def _test_ranges(self, network, values):
|
||||
with getattr(Networks(), network) as n:
|
||||
n.ip_ranges[0].icon_plus.click()
|
||||
n.ip_ranges[0].start.clear()
|
||||
n.ip_ranges[0].start.send_keys(values[0][0])
|
||||
n.ip_ranges[0].end.clear()
|
||||
n.ip_ranges[0].end.send_keys(values[0][1])
|
||||
n.ip_ranges[1].start.send_keys(values[1][0])
|
||||
n.ip_ranges[1].end.clear()
|
||||
n.ip_ranges[1].end.send_keys(values[1][1])
|
||||
self._save_settings()
|
||||
with getattr(Networks(), network) as n:
|
||||
self.assertEqual(n.ip_ranges[0].start.get_attribute('value'),
|
||||
values[0][0])
|
||||
self.assertEqual(n.ip_ranges[0].end.get_attribute('value'),
|
||||
values[0][1])
|
||||
self.assertEqual(n.ip_ranges[1].start.get_attribute('value'),
|
||||
values[1][0])
|
||||
self.assertEqual(n.ip_ranges[1].end.get_attribute('value'),
|
||||
values[1][1])
|
||||
|
||||
n.ip_ranges[0].start.clear()
|
||||
n.ip_ranges[0].start.send_keys(' ')
|
||||
self.assertIn('Invalid IP range start',
|
||||
n.ip_ranges[0].start.
|
||||
find_element_by_xpath('../../..').text)
|
||||
|
||||
n.ip_ranges[1].end.clear()
|
||||
n.ip_ranges[1].end.send_keys(' ')
|
||||
self.assertIn('Invalid IP range end',
|
||||
n.ip_ranges[1].end.
|
||||
find_element_by_xpath('../../..').text)
|
||||
|
||||
def _test_use_vlan_tagging(self, network, vlan_id, initial_value=False):
|
||||
def assert_on():
|
||||
with getattr(Networks(), network) as n:
|
||||
self.assertTrue(
|
||||
n.vlan_tagging.
|
||||
find_element_by_tag_name('input').is_selected(),
|
||||
'use vlan tagging is turned on')
|
||||
self.assertEqual(n.vlan_id.get_attribute('value'), vlan_id,
|
||||
'vlan id value')
|
||||
|
||||
def assert_off():
|
||||
with getattr(Networks(), network) as n:
|
||||
self.assertFalse(
|
||||
n.vlan_tagging.
|
||||
find_element_by_tag_name('input').is_selected(),
|
||||
'use vlan tagging is turned off')
|
||||
self.assertFalse(n.vlan_id.is_displayed(),
|
||||
'vlan id input is not visible')
|
||||
|
||||
def turn_on():
|
||||
with getattr(Networks(), network) as n:
|
||||
n.vlan_tagging.click()
|
||||
self.assertTrue(n.vlan_id.is_displayed(),
|
||||
'vlan id input is visible')
|
||||
n.vlan_id.send_keys(vlan_id)
|
||||
time.sleep(0.5)
|
||||
self._save_settings()
|
||||
assert_on()
|
||||
with getattr(Networks(), network) as n:
|
||||
n.vlan_id.clear()
|
||||
n.vlan_id.send_keys(' ')
|
||||
self.assertIn('Invalid VLAN ID',
|
||||
n.vlan_id.find_element_by_xpath('../../..').text)
|
||||
self._assert_save_verify_disabled()
|
||||
|
||||
def turn_off():
|
||||
with getattr(Networks(), network) as n:
|
||||
n.vlan_tagging.click()
|
||||
self.assertFalse(n.vlan_id.is_displayed(),
|
||||
'vlan id input is not visible')
|
||||
time.sleep(0.5)
|
||||
self._save_settings()
|
||||
assert_off()
|
||||
|
||||
if initial_value:
|
||||
turn_off()
|
||||
turn_on()
|
||||
else:
|
||||
turn_on()
|
||||
turn_off()
|
||||
|
||||
def _test_text_field(self, network, field, value):
|
||||
with getattr(Networks(), network) as n:
|
||||
getattr(n, field).clear()
|
||||
getattr(n, field).send_keys(value)
|
||||
self._save_settings()
|
||||
with getattr(Networks(), network) as n:
|
||||
self.assertEqual(
|
||||
getattr(n, field).get_attribute('value'), value,
|
||||
'New value')
|
||||
getattr(n, field).clear()
|
||||
getattr(n, field).send_keys(' ')
|
||||
self.assertIn('Invalid',
|
||||
getattr(n, field).
|
||||
find_element_by_xpath('../../..').text)
|
||||
self._assert_save_verify_disabled()
|
||||
Networks().cancel_changes.click()
|
||||
time.sleep(1)
|
||||
with getattr(Networks(), network) as n:
|
||||
self.assertEqual(
|
||||
getattr(n, field).get_attribute('value'), value,
|
||||
"cancel changes")
|
||||
|
||||
def _test_select_field(self, network, field, value):
|
||||
with getattr(Networks(), network) as n:
|
||||
getattr(n, field).select_by_visible_text(value)
|
||||
self._save_settings()
|
||||
with getattr(Networks(), network) as n:
|
||||
self.assertEqual(
|
||||
getattr(n, field).first_selected_option.text, value,
|
||||
'New value')
|
||||
getattr(n, field).options[0].click()
|
||||
Networks().cancel_changes.click()
|
||||
time.sleep(1)
|
||||
with getattr(Networks(), network) as n:
|
||||
self.assertEqual(
|
||||
getattr(n, field).first_selected_option.text, value,
|
||||
"cancel changes")
|
||||
|
||||
|
||||
class TestNeutronNetworks(SimpleFlatNetworks):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with Neutron GRE
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.simple_neutron_gre()
|
||||
|
||||
def test_id_start(self):
|
||||
"""Change id start value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in id start field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave id start field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'id_start', '1500')
|
||||
|
||||
def test_id_end(self):
|
||||
"""Change id end value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in id end field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave id end field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'id_end', '3500')
|
||||
|
||||
def test_base_mac(self):
|
||||
"""Change Base Mac address value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in base mac address field
|
||||
2. Click save settings
|
||||
3. Verify that base mac address value is saved
|
||||
4. Leave base mac address field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'base_mac', 'aa:bb:3e:14:b4:a3')
|
||||
|
||||
def test_floating_start(self):
|
||||
"""Change floating ip start value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in floating ip start field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave floating ip start field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'floating_start', RANGES[3][0])
|
||||
|
||||
def test_floating_end(self):
|
||||
"""Change floating ip end value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in floating ip end field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave floating ip end field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'floating_end', RANGES[3][1])
|
||||
|
||||
def test_cidr(self):
|
||||
"""Change CIDR value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in CIDR field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave CIDR field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'cidr', '192.168.111.0/16')
|
||||
|
||||
def test_gateway(self):
|
||||
"""Change Gateway value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in Gateway field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave Gateway field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'gateway', '192.168.111.2')
|
||||
|
||||
def test_nameserver0(self):
|
||||
"""Change first nameserver value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in first nameserver field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave nameserver field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'nameserver0', '5.5.5.5')
|
||||
|
||||
def test_nameserver1(self):
|
||||
"""Change second nameserver value in Neutron L2 configuration
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in second nameserver field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave nameserver field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('neutron', 'nameserver1', '5.5.5.5')
|
||||
|
||||
|
||||
class TestSimpleVlanNetworks(SimpleFlatNetworks):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Click on created environment and open networks tab
|
||||
3. Select VLAN Manager and save settings
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.simple_flat()
|
||||
Tabs().networks.click()
|
||||
with Networks() as n:
|
||||
n.vlan_manager.click()
|
||||
n.save_settings.click()
|
||||
time.sleep(1)
|
||||
|
||||
def test_fixed_number_of_networks(self):
|
||||
"""Change number of networks in VLAN Manager
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in number of networks field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave number of networks field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('fixed', 'number_of_networks', '3')
|
||||
|
||||
def test_fixed_size_of_networks(self):
|
||||
"""Change Size of Networks in VLAN Manager
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in Size of Networks field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave Size of Networks field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_select_field('fixed', 'network_size', '128')
|
||||
|
||||
def test_fixed_vlan_range_start(self):
|
||||
"""Change VLAN id start in VLAN Manager
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in VLAN id start field
|
||||
2. Click save settings
|
||||
3. Verify that value is saved
|
||||
4. Leave VLAN id start field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('fixed', 'vlan_id', '120')
|
||||
|
||||
def test_fixed_vlan_range_end_calculation(self):
|
||||
"""Check calculation of VLAN id end
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in VLAN id start field
|
||||
2. Click save settings
|
||||
3. Verify that value in VLAN id end equals to VLAN id start
|
||||
plus number of networks minus 1
|
||||
"""
|
||||
start_values = [105, 120]
|
||||
with Networks().fixed as n:
|
||||
number = int(n.number_of_networks.get_attribute('value'))
|
||||
for v in start_values:
|
||||
n.vlan_id.clear()
|
||||
n.vlan_id.send_keys(v)
|
||||
self.assertEqual(
|
||||
n.vlan_end.get_attribute('value'),
|
||||
str(v + number - 1), 'end value')
|
||||
|
||||
def test_fixed_vlan_range_end_calculation_2(self):
|
||||
"""Check calculation of VLAN id end when number of networks is changed
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in number of networks field
|
||||
2. Click save settings
|
||||
3. Verify that value in VLAN id end equals to VLAN id start
|
||||
plus number of networks minus 1
|
||||
"""
|
||||
numbers = [5, 20]
|
||||
with Networks().fixed as n:
|
||||
start = int(n.vlan_id.get_attribute('value'))
|
||||
for v in numbers:
|
||||
n.number_of_networks.clear()
|
||||
n.number_of_networks.send_keys(v)
|
||||
self.assertEqual(
|
||||
n.vlan_end.get_attribute('value'),
|
||||
str(v + start - 1), 'end value')
|
||||
|
||||
|
||||
class TestRangesControls(SimpleFlatNetworks):
|
||||
|
||||
def test_public_plus_icon(self):
|
||||
"""Add new ip ranges for public network
|
||||
|
||||
Scenario:
|
||||
1. Click on '+' to add new ip range
|
||||
2. Enter values in start and end fields
|
||||
3. Click on '+' to add new ip range after first ip range
|
||||
4. Verify that fields are added after first range
|
||||
"""
|
||||
self._test_ranges_plus_icon('public')
|
||||
|
||||
def test_public_minus_icon(self):
|
||||
"""Delete ip range for public network
|
||||
|
||||
Scenario:
|
||||
1. Add three new ip ranges
|
||||
2. Enter values in start and end fields of last ip range
|
||||
3. Click on '-' for last but one ip range
|
||||
4. Verify that last ip range values are saved
|
||||
"""
|
||||
self._test_ranges_minus_icon('public')
|
||||
|
||||
|
||||
class TestPublicNetwork(SimpleFlatNetworks):
|
||||
|
||||
def test_ranges(self):
|
||||
"""Ip range for public network
|
||||
|
||||
Scenario:
|
||||
1. Add one new ip range
|
||||
2. Enter values in start and end field of first and second ip range
|
||||
3. Click save settings
|
||||
4. Verify that values are saved
|
||||
5. Delete values from the first range
|
||||
6. Verify that validation messages are displayed
|
||||
"""
|
||||
self._test_ranges('public', RANGES[:2])
|
||||
|
||||
def test_use_vlan_tagging(self):
|
||||
"""Use VLAN tagging for public network
|
||||
|
||||
Scenario:
|
||||
1. Enable VLAN tagging
|
||||
2. Enter value in this field
|
||||
3. Click save settings
|
||||
4. Verify that value is saved
|
||||
5. Clear value from VLAN tagging field
|
||||
6. Verify that validation messages are displayed
|
||||
"""
|
||||
self._test_use_vlan_tagging('public', '111', False)
|
||||
|
||||
def test_gateway(self):
|
||||
"""Change gateway for public network
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in gateway field
|
||||
2. Click save settings
|
||||
3. Verify that gateway value is saved
|
||||
4. Leave gateway field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('public', 'gateway', '172.16.0.1')
|
||||
|
||||
|
||||
class TestManagementNetwork(SimpleFlatNetworks):
|
||||
|
||||
def test_cidr(self):
|
||||
"""Change CIDR for management network
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in management CIDR field
|
||||
2. Click save settings
|
||||
3. Verify that CIDR value is saved
|
||||
4. Leave CIDR field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('management', 'cidr', '192.169.0.0/16')
|
||||
|
||||
def test_use_vlan_tagging(self):
|
||||
"""Use VLAN tagging for management network
|
||||
|
||||
Scenario:
|
||||
1. Enable VLAN tagging for management network
|
||||
2. Enter value in this field
|
||||
3. Click save settings
|
||||
4. Verify that value is saved
|
||||
5. Clear value from VLAN tagging field
|
||||
6. Verify that validation messages are displayed
|
||||
"""
|
||||
self._test_use_vlan_tagging('management', '111', True)
|
||||
|
||||
|
||||
class TestStorageNetwork(SimpleFlatNetworks):
|
||||
|
||||
def test_cidr(self):
|
||||
"""Change CIDR for storage network
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in storage CIDR field
|
||||
2. Click save settings
|
||||
3. Verify that CIDR value is saved
|
||||
4. Leave CIDR field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('storage', 'cidr', '192.170.0.0/16')
|
||||
|
||||
def test_use_vlan_tagging(self):
|
||||
"""Use VLAN tagging for storage network
|
||||
|
||||
Scenario:
|
||||
1. Enable VLAN tagging for storage network
|
||||
2. Enter value in this field
|
||||
3. Click save settings
|
||||
4. Verify that value is saved
|
||||
5. Clear value from VLAN tagging field
|
||||
6. Verify that validation messages are displayed
|
||||
"""
|
||||
self._test_use_vlan_tagging('storage', '111', True)
|
||||
|
||||
|
||||
class TestFixedNetwork(SimpleFlatNetworks):
|
||||
|
||||
def test_cidr(self):
|
||||
"""Change CIDR for VM(fixed) network
|
||||
|
||||
Scenario:
|
||||
1. Enter new value in VM(fixed) CIDR field
|
||||
2. Click save settings
|
||||
3. Verify that CIDR value is saved
|
||||
4. Leave CIDR field empty
|
||||
5. Verify that Save settings and
|
||||
Verify Networks buttons are disabled
|
||||
"""
|
||||
self._test_text_field('fixed', 'cidr', '10.1.0.0/24')
|
||||
|
||||
def test_use_vlan_tagging(self):
|
||||
"""Use VLAN tagging for VM(fixed) network
|
||||
|
||||
Scenario:
|
||||
1. Enable VLAN tagging for VM(fixed) network
|
||||
2. Enter value in this field
|
||||
3. Click save settings
|
||||
4. Verify that value is saved
|
||||
5. Clear value from VLAN tagging field
|
||||
6. Verify that validation messages are displayed
|
||||
"""
|
||||
self._test_use_vlan_tagging('fixed', '111', True)
|
||||
|
||||
|
||||
class TestDnsServers(SimpleFlatNetworks):
|
||||
|
||||
def test_name_servers(self):
|
||||
"""Change dns servers
|
||||
|
||||
Scenario:
|
||||
1. Change dns servers value
|
||||
2. Click save settings
|
||||
3. Verify that values are saved
|
||||
5. Clear values for dns servers
|
||||
6. Verify that Save settings and Verify networks are disabled
|
||||
"""
|
||||
v1 = '8.7.7.7'
|
||||
v2 = '8.6.6.6'
|
||||
with Networks() as n:
|
||||
n.dns1.clear()
|
||||
n.dns1.send_keys(v1)
|
||||
n.dns2.clear()
|
||||
n.dns2.send_keys(v2)
|
||||
self._save_settings()
|
||||
with Networks() as n:
|
||||
self.assertEqual(n.dns1.get_attribute('value'), v1, 'dns1')
|
||||
self.assertEqual(n.dns1.get_attribute('value'), v1, 'dns2')
|
||||
n.dns1.clear()
|
||||
n.dns1.send_keys(' ')
|
||||
self.assertIn('Invalid nameserver',
|
||||
n.dns1.find_element_by_xpath('../../..').text)
|
||||
|
||||
n.dns2.clear()
|
||||
n.dns2.send_keys(' ')
|
||||
self.assertIn('Invalid nameserver',
|
||||
n.dns2.find_element_by_xpath('../../..').text)
|
||||
self._assert_save_verify_disabled()
|
||||
|
||||
Networks().cancel_changes.click()
|
||||
self.assertEqual(n.dns1.get_attribute('value'), v1,
|
||||
'cancel changes dns1')
|
||||
self.assertEqual(n.dns1.get_attribute('value'), v1,
|
||||
'cancel changes dns2')
|
||||
|
||||
|
||||
class TestFlatVerifyNetworks(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Create simple environment with default values
|
||||
2. Click on created environment and open Networks tab
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
preconditions.Environment.simple_flat()
|
||||
Tabs().networks.click()
|
||||
time.sleep(1)
|
||||
|
||||
def test_no_nodes(self):
|
||||
"""Verify network without added nodes
|
||||
|
||||
Scenario:
|
||||
1. Click Verify Networks
|
||||
2. Verify that message 'At least two nodes are required' appears
|
||||
"""
|
||||
with Networks() as n:
|
||||
n.verify_networks.click()
|
||||
self.assertIn(
|
||||
'At least two nodes are required',
|
||||
n.verification_alert.text,
|
||||
'Alert text contains "At least two nodes are required"')
|
||||
|
||||
def test_one_node(self):
|
||||
"""Verify network with one added nodes
|
||||
|
||||
Scenario:
|
||||
1. Add one controller node
|
||||
2. Open Networks tab
|
||||
3. Click Verify Networks
|
||||
4. Verify that message 'At least two nodes are required' appears
|
||||
"""
|
||||
Tabs().nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
RolesPanel().controller.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
Tabs().networks.click()
|
||||
time.sleep(1)
|
||||
with Networks() as n:
|
||||
n.verify_networks.click()
|
||||
self.assertIn(
|
||||
'At least two nodes are required',
|
||||
n.verification_alert.text,
|
||||
'Alert text contains "At least two nodes are required"')
|
||||
|
||||
def test_two_nodes(self):
|
||||
"""Verify network with two added nodes
|
||||
|
||||
Scenario:
|
||||
1. Add two compute nodes
|
||||
2. Open Networks tab
|
||||
3. Click Verify Networks
|
||||
4. Verify that message 'Verification succeeded.
|
||||
Your network is configured correctly' appears
|
||||
"""
|
||||
Tabs().nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
Nodes().nodes_discovered[0].checkbox.click()
|
||||
Nodes().nodes_discovered[1].checkbox.click()
|
||||
RolesPanel().compute.click()
|
||||
Nodes().apply_changes.click()
|
||||
time.sleep(1)
|
||||
Tabs().networks.click()
|
||||
time.sleep(1)
|
||||
with Networks() as n:
|
||||
n.verify_networks.click()
|
||||
self.assertIn(
|
||||
'Verification succeeded. '
|
||||
'Your network is configured correctly.',
|
||||
n.verification_alert.text,
|
||||
'Verification succeeded')
|
|
@ -1,111 +0,0 @@
|
|||
from pageobjects.base import PageObject
|
||||
from pageobjects.environments import RedhatAccountPopup
|
||||
from pageobjects.header import Header
|
||||
from pageobjects.releases import Releases
|
||||
from settings import OPENSTACK_REDHAT, REDHAT_USERNAME, REDHAT_PASSWORD, \
|
||||
REDHAT_SATELLITE, REDHAT_ACTIVATION_KEY, OPENSTACK_CENTOS, \
|
||||
OPENSTACK_UBUNTU
|
||||
from tests.base import BaseTestCase
|
||||
from nose.plugins.attrib import attr
|
||||
|
||||
|
||||
class TestReleases(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
Header().releases.click()
|
||||
|
||||
def test_centos_is_active(self):
|
||||
"""Check Centos status is active on releases tab
|
||||
|
||||
Scenario:
|
||||
1. Open releases tab
|
||||
2. Check that Centos status is active
|
||||
"""
|
||||
with Releases() as r:
|
||||
self.assertEqual(
|
||||
'Active', r.dict[OPENSTACK_CENTOS].status.text,
|
||||
'CentOS status is active')
|
||||
|
||||
def test_ubuntu_is_active(self):
|
||||
"""Check Ubuntu status is active on releases tab
|
||||
|
||||
Scenario:
|
||||
1. Open releases tab
|
||||
2. Check that Ubuntu status is active
|
||||
"""
|
||||
with Releases() as r:
|
||||
self.assertEqual(
|
||||
'Active', r.dict[OPENSTACK_UBUNTU].status.text,
|
||||
'Ubuntu status is active')
|
||||
|
||||
@attr('redhat')
|
||||
def test_rhos_is_active(self):
|
||||
"""Check RHOS status is active on releases tab
|
||||
|
||||
Scenario:
|
||||
1. Open releases tab
|
||||
2. Check that RHOS status is Not available
|
||||
"""
|
||||
with Releases() as r:
|
||||
self.assertEqual(
|
||||
'Not available', r.dict[OPENSTACK_REDHAT].status.text,
|
||||
'RHOS status is Not available')
|
||||
|
||||
@attr('redhat')
|
||||
def test_rhsm(self):
|
||||
"""Download RHEL with RHSM option
|
||||
|
||||
Scenario:
|
||||
1. Open releases tab
|
||||
2. Click Configure button in actions column
|
||||
3. Select 'RHSM' radiobutton
|
||||
4. Enter username and password and click apply
|
||||
5. Check that RHOS status is active
|
||||
"""
|
||||
Releases().rhel_setup.click()
|
||||
with RedhatAccountPopup() as p:
|
||||
p.license_rhsm.click()
|
||||
p.redhat_username.send_keys(REDHAT_USERNAME)
|
||||
p.redhat_password.send_keys(REDHAT_PASSWORD)
|
||||
p.apply.click()
|
||||
p.wait_until_exists()
|
||||
with Releases() as r:
|
||||
PageObject.wait_until_exists(
|
||||
r.dict[OPENSTACK_REDHAT].download_progress, timeout=20)
|
||||
self.assertEqual(
|
||||
'Active', r.dict[OPENSTACK_REDHAT].status.text,
|
||||
'RHOS status is active')
|
||||
|
||||
@attr('redhat')
|
||||
def test_rhn_satellite(self):
|
||||
"""Download RHEL with RHN option
|
||||
|
||||
Scenario:
|
||||
1. Open releases tab
|
||||
2. Click Configure button in actions column
|
||||
3. Select 'RHN' radiobutton
|
||||
4. Enter username and password
|
||||
5. Enter satellite hostname, activation key and click apply
|
||||
6. Check that RHOS status is active
|
||||
"""
|
||||
Releases().rhel_setup.click()
|
||||
with RedhatAccountPopup() as p:
|
||||
p.license_rhn.click()
|
||||
p.redhat_username.send_keys(REDHAT_USERNAME)
|
||||
p.redhat_password.send_keys(REDHAT_PASSWORD)
|
||||
p.redhat_satellite.send_keys(REDHAT_SATELLITE)
|
||||
p.redhat_activation_key.send_keys(REDHAT_ACTIVATION_KEY)
|
||||
p.apply.click()
|
||||
p.wait_until_exists()
|
||||
with Releases() as r:
|
||||
PageObject.wait_until_exists(
|
||||
r.dict[OPENSTACK_REDHAT].download_progress, timeout=20)
|
||||
self.assertEqual(
|
||||
'Active', r.dict[OPENSTACK_REDHAT].status.text,
|
||||
'RHOS status is active')
|
|
@ -1,250 +0,0 @@
|
|||
import time
|
||||
from pageobjects.environments import Environments
|
||||
from pageobjects.nodes import Nodes, RolesPanel
|
||||
from tests import preconditions
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
ERROR_ROLE_CANNOT_COMBINE = 'This role cannot be combined' \
|
||||
' with the other roles already selected.'
|
||||
ROLE_UNALLOCATED = 'UNALLOCATED'
|
||||
ROLE_CONTROLLER = 'CONTROLLER'
|
||||
ROLE_COMPUTE = 'COMPUTE'
|
||||
ROLE_CINDER = 'CINDER'
|
||||
ROLE_CEPH = 'CEPH-OSD'
|
||||
|
||||
|
||||
class BaseClass(BaseTestCase):
|
||||
|
||||
def assertNodeInRoles(self, node, roles):
|
||||
for role in roles:
|
||||
self.assertIn(role, node.roles.text, "node's roles")
|
||||
|
||||
def setUp(self):
|
||||
BaseTestCase.setUp(self)
|
||||
Environments().create_cluster_boxes[0].click()
|
||||
time.sleep(1)
|
||||
Nodes().add_nodes.click()
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
class TestRolesSimpleFlat(BaseClass):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Global precondition
|
||||
|
||||
steps:
|
||||
1. Create simple environment with default values
|
||||
"""
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.simple_flat()
|
||||
|
||||
def test_controller(self):
|
||||
"""Check controller node
|
||||
|
||||
Scenario:
|
||||
1. Select first node and assign controller role
|
||||
2. Verify that role of the node is changed,
|
||||
compute role is disabled
|
||||
3. Deselect node
|
||||
4. Verify that role is unallocated
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.controller.click()
|
||||
self.assertFalse(r.compute.is_enabled())
|
||||
self.assertIn(
|
||||
ERROR_ROLE_CANNOT_COMBINE,
|
||||
r.compute.find_element_by_xpath('../..').text,
|
||||
'error "{}" is visible'.format(ERROR_ROLE_CANNOT_COMBINE))
|
||||
with Nodes()as n:
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_CONTROLLER])
|
||||
self.assertTrue(n.apply_changes.is_enabled())
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
self.assertFalse(n.apply_changes.is_enabled())
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_UNALLOCATED])
|
||||
|
||||
def test_one_controller_allowed_nodes_disabled(self):
|
||||
"""Check that only one controller node is possible
|
||||
|
||||
Scenario:
|
||||
1. Select first node and assign controller role
|
||||
2. Verify that checkboxes of other nodes are disabled
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.controller.click()
|
||||
for n in Nodes().nodes_discovered[1:]:
|
||||
self.assertFalse(
|
||||
n.checkbox.find_element_by_tag_name('input').is_enabled(),
|
||||
'Checkbox is disabled')
|
||||
|
||||
def test_one_controller_allowed_controller_role_disabled(self):
|
||||
"""Check controller node is disabled if many nodes are selected
|
||||
|
||||
Scenario:
|
||||
1. Select all nodes
|
||||
2. Verify that controller role is disabled
|
||||
"""
|
||||
with Nodes()as n:
|
||||
with RolesPanel() as r:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
self.assertTrue(r.controller.is_enabled())
|
||||
for node in n.nodes_discovered[1:]:
|
||||
node.checkbox.click()
|
||||
self.assertFalse(r.controller.is_enabled())
|
||||
|
||||
def test_compute(self):
|
||||
"""Check compute node
|
||||
|
||||
Scenario:
|
||||
1. Select first node and assign compute role
|
||||
2. Verify that role of the node is changed,
|
||||
controller role is disabled
|
||||
3. Deselect node
|
||||
4. Verify that role is unallocated
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.compute.click()
|
||||
self.assertFalse(r.controller.is_enabled())
|
||||
self.assertIn(
|
||||
ERROR_ROLE_CANNOT_COMBINE,
|
||||
r.controller.find_element_by_xpath('../..').text,
|
||||
'error "{}" is visible'.format(ERROR_ROLE_CANNOT_COMBINE))
|
||||
with Nodes()as n:
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_COMPUTE])
|
||||
self.assertTrue(n.apply_changes.is_enabled())
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
self.assertFalse(n.apply_changes.is_enabled())
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_UNALLOCATED])
|
||||
|
||||
def test_cinder(self):
|
||||
"""Check cinder node
|
||||
|
||||
Scenario:
|
||||
1. Select first node and assign cinder role
|
||||
2. Verify that role of the node is changed
|
||||
3. Deselect node
|
||||
4. Verify that role is unallocated
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.cinder.click()
|
||||
with Nodes()as n:
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_CINDER])
|
||||
self.assertTrue(n.apply_changes.is_enabled())
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
self.assertFalse(n.apply_changes.is_enabled())
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_UNALLOCATED])
|
||||
|
||||
def test_ceph(self):
|
||||
"""Check ceph node
|
||||
|
||||
Scenario:
|
||||
1. Select first node and assign ceph role
|
||||
2. Verify that role of the node is changed
|
||||
3. Deselect node
|
||||
4. Verify that role is unallocated
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.ceph_osd.click()
|
||||
with Nodes()as n:
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_CEPH])
|
||||
self.assertTrue(n.apply_changes.is_enabled())
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
self.assertFalse(n.apply_changes.is_enabled())
|
||||
self.assertNodeInRoles(n.nodes_discovered[0], [ROLE_UNALLOCATED])
|
||||
|
||||
def test_multiroles(self):
|
||||
"""Check multiroles node
|
||||
|
||||
Scenario:
|
||||
1. Select first node and assign controller, ceph, cinder roles
|
||||
2. Verify that role of the node is changed
|
||||
3. Deselect node
|
||||
4. Verify that role is unallocated
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.controller.click()
|
||||
r.cinder.click()
|
||||
r.ceph_osd.click()
|
||||
with Nodes()as n:
|
||||
self.assertNodeInRoles(
|
||||
n.nodes_discovered[0],
|
||||
[ROLE_CONTROLLER, ROLE_CINDER, ROLE_CEPH])
|
||||
|
||||
def test_several_nodes(self):
|
||||
"""Check multiroles for many nodes
|
||||
|
||||
Scenario:
|
||||
1. Select three nodes and assign controller, ceph, cinder roles
|
||||
2. Verify that role of the nodes is changed
|
||||
3. Deselect nodes
|
||||
4. Verify that role is unallocated
|
||||
"""
|
||||
with Nodes()as n:
|
||||
n.nodes_discovered[0].checkbox.click()
|
||||
n.nodes_discovered[1].checkbox.click()
|
||||
n.nodes_discovered[2].checkbox.click()
|
||||
with RolesPanel() as r:
|
||||
r.compute.click()
|
||||
r.cinder.click()
|
||||
r.ceph_osd.click()
|
||||
with Nodes()as n:
|
||||
self.assertNodeInRoles(
|
||||
n.nodes_discovered[0],
|
||||
[ROLE_COMPUTE, ROLE_CINDER, ROLE_CEPH])
|
||||
self.assertNodeInRoles(
|
||||
n.nodes_discovered[1],
|
||||
[ROLE_COMPUTE, ROLE_CINDER, ROLE_CEPH])
|
||||
self.assertNodeInRoles(
|
||||
n.nodes_discovered[2],
|
||||
[ROLE_COMPUTE, ROLE_CINDER, ROLE_CEPH])
|
||||
|
||||
|
||||
class TestRolesHAFlat(BaseClass):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
preconditions.Environment.ha_flat()
|
||||
|
||||
def test_controller_role_always_enabled(self):
|
||||
"""Check controller node in HA mode
|
||||
|
||||
Scenario:
|
||||
1. Select all nodes
|
||||
2. Assign controller role
|
||||
3. Verify that nodes are with controller role
|
||||
"""
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_discovered:
|
||||
node.checkbox.click()
|
||||
self.assertTrue(RolesPanel().controller.is_enabled())
|
||||
RolesPanel().controller.click()
|
||||
for node in n.nodes_discovered:
|
||||
self.assertNodeInRoles(node, [ROLE_CONTROLLER])
|
||||
|
||||
def test_all_nodes_could_be_controller(self):
|
||||
"""Check all nodes with controller role in HA mode
|
||||
|
||||
Scenario:
|
||||
1. Select all nodes
|
||||
2. Assign controller role
|
||||
3. Verify that nodes are with controller role
|
||||
"""
|
||||
RolesPanel().controller.click()
|
||||
with Nodes()as n:
|
||||
for node in n.nodes_discovered:
|
||||
node.checkbox.click()
|
||||
for node in n.nodes_discovered:
|
||||
self.assertNodeInRoles(node, [ROLE_CONTROLLER])
|
|
@ -1,89 +0,0 @@
|
|||
import re
|
||||
import time
|
||||
import browser
|
||||
from pageobjects.base import PageObject
|
||||
from pageobjects.header import Header
|
||||
from pageobjects.support import Support
|
||||
from tests.base import BaseTestCase
|
||||
|
||||
|
||||
class TestSupport(BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
BaseTestCase.setUpClass()
|
||||
|
||||
def setUp(self):
|
||||
"""Each test precondition
|
||||
|
||||
Steps:
|
||||
1. Open Support page
|
||||
"""
|
||||
BaseTestCase.clear_nailgun_database()
|
||||
BaseTestCase.setUp(self)
|
||||
time.sleep(1)
|
||||
Header().support.click()
|
||||
time.sleep(1)
|
||||
|
||||
def test_register_fuel(self):
|
||||
"""Register Fuel
|
||||
|
||||
Scenario:
|
||||
1. Click Register Fuel
|
||||
2. Verify that register form is present
|
||||
"""
|
||||
with Support() as s:
|
||||
key = re.search(
|
||||
'key=(?P<key>.*)',
|
||||
s.register_fuel.get_attribute('href')).group('key')
|
||||
self.assertEqual(216, len(key), 'Key not empty')
|
||||
|
||||
s.register_fuel.click()
|
||||
time.sleep(4)
|
||||
browser.driver.switch_to_window(browser.driver.window_handles.pop())
|
||||
self.assertTrue(
|
||||
browser.driver.find_element_by_css_selector(
|
||||
'[value="Register and Activate subscription"]').is_displayed(),
|
||||
'"Register and Activate subscription" is displayed')
|
||||
|
||||
def test_contact_support(self):
|
||||
"""Contact Support
|
||||
|
||||
Scenario:
|
||||
1. Click contact support
|
||||
2. Verify that support page is present
|
||||
"""
|
||||
Support().contact_support.click()
|
||||
time.sleep(4)
|
||||
browser.driver.switch_to_window(browser.driver.window_handles.pop())
|
||||
self.assertIn('http://software.mirantis.com/',
|
||||
browser.driver.current_url)
|
||||
|
||||
def test_diagnostic_snapshot(self):
|
||||
"""Generate diagnostic snapshot
|
||||
|
||||
Scenario:
|
||||
1. Click generate diagnostic snapshot
|
||||
2. Verify that snapshot is available to download
|
||||
"""
|
||||
Support().generate_snapshot.click()
|
||||
with Support() as s:
|
||||
PageObject.wait_element(s, 'download_snapshot')
|
||||
self.assertTrue(
|
||||
s.download_snapshot.is_enabled(),
|
||||
'"Diagnostic Snapshot" is displayed')
|
||||
|
||||
def test_capacity_audit(self):
|
||||
"""View capacity audit
|
||||
|
||||
Scenario:
|
||||
1. Click view capacity audit
|
||||
2. Verify that system information is present
|
||||
"""
|
||||
Support().view_capacity_audit.click()
|
||||
PageObject.wait_element(Support(), 'capacity_report')
|
||||
self.assertEqual(
|
||||
'Home/Support/Capacity',
|
||||
Header().breadcrumb.text,
|
||||
'Breadcrumb text'
|
||||
)
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
flake8 --ignore=H302,H802 --exclude bin/,include/,lib/,local/,tmp/ --show-source fuelweb_test fuelweb_ui_test
|
||||
|
Loading…
Reference in New Issue