Update WebUI tests

-added compatibility with python2.6
-added new tests

Change-Id: I3f42f4954e14ccc4843ce1871a593b2cf8f4c021
This commit is contained in:
Anastasia Kuznetsova
2014-04-25 20:37:45 +04:00
parent 0b74f66af1
commit 74047900de
24 changed files with 982 additions and 369 deletions

View File

@@ -1 +1,2 @@
*.pyc
*~

View File

@@ -0,0 +1,31 @@
Namespaces:
=: io.murano.apps.AppForUploadTest
std: io.murano
res: io.murano.resources
Name: AppForUploadTest
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
instance:
Contract: $.class(res:Instance).notNull()
username:
Contract: $.string().notNull()
password:
Contract: $.string().notNull()
database:
Contract: $.string().notNull()
Workflow:
deploy:
Body:
- $.instance.deploy()
- $resources: new('io.murano.system.Resources')

View File

@@ -0,0 +1,85 @@
Version: 2
Application:
?:
type: io.murano.apps.AppForUploadTest
name: $.serviceConfiguration.name
database: $.serviceConfiguration.database
username: $.serviceConfiguration.username
password: $.serviceConfiguration.password
instance:
?:
type: io.murano.resources.Instance
name: generateHostname($.serviceConfiguration.unitNamingPattern, 1)
flavor: $.instanceConfiguration.flavor
image: $.instanceConfiguration.osImage
Forms:
- serviceConfiguration:
fields:
- name: name
type: string
label: Service Name
description: >-
To identify your service in logs please specify a service name
- name: database
type: string
label: Database
description: >-
Please, provide database name that is going to be created
- name: username
type: string
label: Username
description: >-
Please, provide username that is going to be used to connect to the database
- name: password
type: password
label: Password
descriptionTitle: Password
description: >-
Please, provide password that is going to be used to connect to the database
- name: dcInstances
type: integer
hidden: true
initial: 1
- name: unitNamingPattern
type: string
required: false
hidden: true
widgetMedia:
js: ['muranodashboard/js/support_placeholder.js']
css: {all: ['muranodashboard/css/support_placeholder.css']}
- instanceConfiguration:
fields:
- name: title
type: string
required: false
hidden: true
descriptionTitle: Instance Configuration
description: Specify some instance parameters on which service would be created.
- name: flavor
type: flavor
label: Instance flavor
description: >-
Select registered in Openstack flavor. Consider that service performance
depends on this parameter.
required: false
- name: osImage
type: image
imageType: linux
label: Instance image
description: >-
Select valid image for a service. Image should already be prepared and
registered in glance.
- name: keyPair
type: keypair
label: Key Pair
description: >-
Select the Key Pair to control access to instances. You can login to
instances using this KeyPair after the deployment of service.
required: false
- name: availabilityZone
type: azone
label: Availability zone
description: Select availability zone where service would be installed.
required: false

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,10 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.AppForUploadTest
Name: AppForUploadTest
Description: |
This is test package.
Author: 'Mirantis, Inc'
Tags: [test_tag]
Classes:
io.murano.apps.AppForUploadTest: AppForUploadTest.yaml

View File

@@ -0,0 +1,47 @@
Namespaces:
=: io.murano.apps.PostgreSql
std: io.murano
res: io.murano.resources
Name: PostgreSql
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
instance:
Contract: $.class(res:Instance).notNull()
username:
Contract: $.string().notNull()
password:
Contract: $.string().notNull()
database:
Contract: $.string().notNull()
Workflow:
deploy:
Body:
- $.instance.deploy()
- $resources: new('io.murano.system.Resources')
# Deploy PostgreSql
- $template: $resources.yaml('DeployPostgreSql.template')
- $.instance.agent.call($template, $resources)
# Configure Database on PostgreSQL
- $template: $resources.yaml('ConfigurePostgreSqlDatabase.template').bind(dict(
database => $.database,
username => $.username,
password => $.password
))
- $.instance.agent.call($template, $resources)
getIp:
Body:
- $resources: new('io.murano.system.Resources')
- $template: $resources.yaml('GetIP.template')
- $.instance.agent.call($template, $resources)

View File

@@ -0,0 +1,22 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Add database and user to PostgreSql
Parameters:
database: $database
username: $username
password: $password
Body: |
return configure('{0} {1} {2}'.format(args.database, args.username, args.password)).stdout
Scripts:
configure:
Type: Application
Version: 1.0.0
EntryPoint: configurePostgreSqlDatabase.sh
Files:
- <common.sh>
Options:
captureStdout: true
captureStderr: false

View File

@@ -0,0 +1,21 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Deploy PostgreSql
Parameters:
appName: $appName
Body: |
return deploy(args.appName).stdout
Scripts:
deploy:
Type: Application
Version: 1.0.0
EntryPoint: deployPostgreSql.sh
Files:
- <installer.sh>
- <common.sh>
Options:
captureStdout: true
captureStderr: false

View File

@@ -0,0 +1,19 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Deploy Tomcat
Parameters:
appName: $appName
Body: |
return getIp(args.appName).stdout
Scripts:
getIp:
Type: Application
Version: 1.0.0
EntryPoint: Linux/getIp.sh
Files: []
Options:
captureStdout: true
captureStderr: false

View File

@@ -0,0 +1,204 @@
#!/bin/bash
#
DEBUGLVL=3
LOGFILE=/tmp/muranodeployment.log
PIPAPPS="pip python-pip pip-python"
PIPCMD=""
if [ "$DEBUGLVL" -eq 4 ]; then
set -x
fi
function log {
if [ "$DEBUGLVL" -gt 0 ]; then
chars=$(echo "@$" | wc -c)
case $DEBUGLVL in
1 )
echo -e "LOG:>$@"
;;
2)
echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE
;;
3)
echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" >> $LOGFILE
;;
4)
echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE
;;
esac
fi
}
function lowercase(){
echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}
function find_pip()
{
for cmd in $PIPAPPS
do
_cmd=$(which $cmd 2>/dev/null)
if [ $? -eq 0 ];then
break
fi
done
if [ -z $_cmd ];then
echo "Can't find \"pip\" in system, please install it first, exiting!"
exit 1
else
PIPCMD=$_cmd
fi
}
OPTIND=1 # Reset if getopts used previously
function collect_args(){
_n=$1
shift
ARGS=''
while true
do
if [[ "$_n" == -* ]] || [ -z "$_n" ]; then
OPTIND=$((OPTIND - 1))
break
fi
#echo "_n=$_n ; $OPTIND"
if [ -z "$ARGS" ]; then
ARGS=$OPTARG
else
ARGS="$ARGS $_n"
fi
eval _n=\$$OPTIND
OPTIND=$((OPTIND + 1))
#sleep 1
done
echo $ARGS
unset _n
unset ARGS
}
function get_os(){
KERNEL=$(uname -r)
MACH=$(uname -m)
OS=$(uname)
if [ "${OS}" = "Linux" ] ; then
if [ -f /etc/redhat-release ] ; then
DistroBasedOn='RedHat'
Packager='yum'
DIST=$(cat /etc/redhat-release |sed s/\ release.*//)
PSUEDONAME=$(cat /etc/redhat-release | sed s/.*\(// | sed s/\)//)
REV=$(cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//)
elif [ -f /etc/SuSE-release ] ; then
DistroBasedOn='SuSe'
Packager='zypper'
PSUEDONAME=$(cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//)
REV=$(cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //)
elif [ -f /etc/mandrake-release ] ; then
DistroBasedOn='Mandrake'
Packager='urpmi urpme'
PSUEDONAME=$(cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//)
REV=$(cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//)
elif [ -f /etc/debian_version ] ; then
DistroBasedOn='Debian'
Packager='apt-get'
DIST=$(cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }')
PSUEDONAME=$(cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }')
REV=$(cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }')
fi
if [ -f /etc/UnitedLinux-release ] ; then
DIST="${DIST}[$(cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//)]"
fi
OS=$(lowercase $OS)
DistroBasedOn=$(lowercase $DistroBasedOn)
readonly OS
readonly DIST
readonly DistroBasedOn
readonly PSUEDONAME
readonly REV
readonly KERNEL
readonly MACH
#readonly Packager
else
OS=unknown
readonly OS
log "OS:$OS"
exit 1
fi
}
function add_fw_rule(){
_rule_string=$@
_tmp_fw_port=$(echo $_rule_string | grep -o -e "dport [0-9]*\s")
_tmp_fw_proto=$(echo $_rule_string | grep -o -e "-p \w*\s")
_fw_port=$(echo $_tmp_fw_port | awk '{print $2}')
_fw_proto=$(echo $_tmp_fw_proto |awk '{print $2}')
_fw_reload=""
#find iptables and add rule
case $DIST in
"Fedora")
_fw_cmd=$(which firewall-cmd)
_fw_port=$(echo $_rule_string | grep -o -e "dport [0-9]*\s" | awk '{print $2}')
_fw_proto=$(echo $_rule_string | grep -o -e "-p \w*\s" | awk '{print $2}')
_fw_rule="--permanent --add-port=$_fw_port/$_fw_proto"
_fw_enable_rules="$_fw_cmd --reload"
;;
*)
_fw_cmd=$(which iptables)
_fw_rule=$_rule_string
_fw_enable_rules="service $(basename $_fw_cmd) save"
;;
esac
iptcmdsave=$(which iptables-save)
if [[ "$_fw_cmd" != '' ]] && [[ "$iptcmdsave" != '' ]]; then
eval "$iptcmdsave | grep -e \"$_tmp_fw_port\" | grep -e \"$_tmp_fw_proto\"" > /dev/null 2>&1
if [ $? -ne 0 ]; then
eval $_fw_cmd $_fw_rule
if [ $? -ne 0 ]; then
log "Can't set firewall rules, exiting..."
exit 1
else
if [ -n "$_fw_enable_rules" ]; then
log "Running \"$_fw_enable_rules\""
$_fw_enable_rules > /dev/null
fi
log "$_fw_cmd rule with $_fw_rule set."
fi
else
log "$_fw_cmd rule exists."
fi
else
log "There are no fw found..."
fi
}
function enable_init(){
_initctrl=""
_init_suffix=""
_service=$1
case $DistroBasedOn in
"debian")
_initctrl="update-rc.d"
_init_suffix="defaults"
;;
*)
_initctrl="chkconfig"
_init_suffix="on"
;;
esac
$_initctrl $_service $_init_suffix
if [ $? -ne 0 ]; then
log "$_initctrl $_service $_init_suffix - fails!"
exit 1
fi
}
function restart_service(){
_service=$1
service $_service restart > /dev/null 2>&1
if [ $? -ne 0 ]; then
log "Can't start $_service service!"
exit 1
fi
}
function package_renamer(){
_pkg=$1
case $DistroBasedOn in
"debian")
_pkg=$(echo $_pkg | sed 's/-devel$/-dev/')
;;
*)
_pkg=$(echo $_pkg | sed 's/-dev$/-devel/')
;;
esac
echo $_pkg
}

View File

@@ -0,0 +1,28 @@
#!/bin/bash
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
get_os
[[ $? -ne 0 ]] && exit 1
if [[ "$DistroBasedOn" != "redhat" ]]; then
DEBUGLVL=4
log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!"
exit 1
fi
su -c "psql -d postgres -c \"CREATE DATABASE $1\"" -s /bin/sh postgres
su -c "psql -d postgres -c \"CREATE USER $2 WITH PASSWORD '$3'\"" -s /bin/sh postgres
su -c "psql -d postgres -c \"GRANT ALL PRIVILEGES ON DATABASE $1 to $2;\"" -s /bin/sh postgres
echo "host $1 $2 all md5" >> /var/lib/pgsql/data/pg_hba.conf
systemctl restart postgresql.service

View File

@@ -0,0 +1,31 @@
#!/bin/bash
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
get_os
[[ $? -ne 0 ]] && exit 1
if [[ "$DistroBasedOn" != "redhat" ]]; then
DEBUGLVL=4
log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!"
exit 1
fi
bash installer.sh -p sys -i "postgresql-server postgresql-contrib"
postgresql-setup initdb
sed -e "s/^#listen_addresses =.*$/listen_addresses = \'*\'/" -i /var/lib/pgsql/data/postgresql.conf
add_fw_rule '-I INPUT 1 -p tcp -m tcp --dport 5432 -j ACCEPT -m comment --comment "by murano, PostgreSQL"'
systemctl enable postgresql.service
systemctl start postgresql.service

View File

@@ -0,0 +1,2 @@
#!/bin/sh
curl -s http://169.254.169.254/latest/meta-data/local-ipv4

View File

@@ -0,0 +1,142 @@
#!/bin/bash
#
INSTALLER_OPTS=""
UNINSTALLER_OPTS=""
PMGR=""
PMGR_LIST_OPTS=""
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
exit 1
fi
}
function set_install_options(){
case $1 in
apt-get )
INSTALLER_OPTS="-y -q install"
UNINSTALLER_OPTS="-y -q remove"
PMGR="dpkg"
PMGR_LIST_OPTS="-s"
;;
yum )
INSTALLER_OPTS="--assumeyes install"
UNINSTALLER_OPTS="--assumeyes erase"
PMGR="rpm"
PMGR_LIST_OPTS="-q"
;;
urpm* )
INSTALLER_OPTS="-y"
UNINSTALLER_OPTS=""
PMGR="rpm"
PMGR_LIST_OPTS="-q"
;;
zypper )
INSTALLER_OPTS="install"
UNINSTALLER_OPTS="remove --quiet"
PMGR="rpm"
PMGR_LIST_OPTS="-q"
;;
pip )
INSTALLER_OPTS="install"
UNINSTALLER_OPTS="uninstall --yes"
find_pip
PACKAGER=$PIPCMD
PMGR=$PIPCMD
PMGR_LIST_OPTS="freeze | grep"
;;
* )
exit 1
;;
esac
PACKAGER=$(which $1)
if [ $? -ne 0 ]; then
log "Can't find \"$1\", exiting!"
exit 1
fi
}
function package_install(){
PKG=$1
eval "$PMGR $PMGR_LIST_OPTS $PKG" > /dev/null 2>&1
if [ $? -eq 0 ]; then
log "\"$PKG\" already installed"
else
log "Installing \"$PKG\" ..."
$PACKAGER $INSTALLER_OPTS $PKG > /dev/null 2>&1
if [ $? -ne 0 ]; then
log "\"$PKG\" installation fails, exiting!"
exit 1
else
log "\t\t...success"
fi
fi
}
function package_uninstall(){
PKG=$1
eval "$PMGR $PMGR_LIST_OPTS $PKG" > /dev/null 2>&1
if [ $? -eq 1 ]; then
log "\"$PKG\" not installed"
else
log "Unnstalling \"$PKG\" ..."
$PACKAGER $UNINSTALLER_OPTS $PKG > /dev/null 2>&1
if [ $? -ne 0 ]; then
log "\"$PKG\" uninstallation fails, exiting!"
exit 1
else
log "\t\t...success"
fi
fi
}
function run_install(){
for PKG in $@
do
package_install $PKG
done
}
function run_uninstall(){
for PKG in $@
do
package_uninstall $PKG
done
}
# Main workflow
include "common.sh"
if [ $# -eq 0 ]; then
script=$(basename $0)
echo -e "Usage:\n\t* install packages -- ./$script -p package_manager -i package0 [packageN]\n\t* remove packages -- ./$script -p package_manager -r package0 [packageN]"
exit 1
fi
Packager=''
get_os
if [ $? -ne 0 ]; then
log "Unsupported *nix version ($DistroBasedOn - $DIST/$PSUEDONAME/$REV/$MACH)"
exit 1
fi
while getopts ":p:i:r:" opt ; do
case "$opt" in
p)
if [[ "$OPTARG" != sys ]]; then
Packager=$OPTARG
fi
set_install_options $Packager
;;
i)
n=$OPTARG
run_install $(collect_args $n $@)
break;
;;
r)
n=$OPTARG
run_uninstall $(collect_args $n $@)
break;
;;
\?)
log "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
shift $((OPTIND-1))

View File

@@ -0,0 +1,85 @@
Version: 2
Application:
?:
type: io.murano.apps.PostgreSql
name: $.serviceConfiguration.name
database: $.serviceConfiguration.database
username: $.serviceConfiguration.username
password: $.serviceConfiguration.password
instance:
?:
type: io.murano.resources.Instance
name: generateHostname($.serviceConfiguration.unitNamingPattern, 1)
flavor: $.instanceConfiguration.flavor
image: $.instanceConfiguration.osImage
Forms:
- serviceConfiguration:
fields:
- name: name
type: string
label: Service Name
description: >-
To identify your service in logs please specify a service name
- name: database
type: string
label: Database
description: >-
Please, provide database name that is going to be created
- name: username
type: string
label: Username
description: >-
Please, provide username that is going to be used to connect to the database
- name: password
type: password
label: Password
descriptionTitle: Password
description: >-
Please, provide password that is going to be used to connect to the database
- name: dcInstances
type: integer
hidden: true
initial: 1
- name: unitNamingPattern
type: string
required: false
hidden: true
widgetMedia:
js: ['muranodashboard/js/support_placeholder.js']
css: {all: ['muranodashboard/css/support_placeholder.css']}
- instanceConfiguration:
fields:
- name: title
type: string
required: false
hidden: true
descriptionTitle: Instance Configuration
description: Specify some instance parameters on which service would be created.
- name: flavor
type: flavor
label: Instance flavor
description: >-
Select registered in Openstack flavor. Consider that service performance
depends on this parameter.
required: false
- name: osImage
type: image
imageType: linux
label: Instance image
description: >-
Select valid image for a service. Image should already be prepared and
registered in glance.
- name: keyPair
type: keypair
label: Key Pair
description: >-
Select the Key Pair to control access to instances. You can login to
instances using this KeyPair after the deployment of service.
required: false
- name: availabilityZone
type: azone
label: Availability zone
description: Select availability zone where service would be installed.
required: false

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,13 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.PostgreSql
Name: PostgreSQL
Description: |
PostgreSQL is a powerful, open source object-relational database system.
It has more than 15 years of active development and a proven architecture
that has earned it a strong reputation for reliability, data integrity,
and correctness.
Author: 'Mirantis, Inc'
Tags: [Database, Postgre, SQL, RDBMS]
Classes:
io.murano.apps.PostgreSql: PostgreSql.yaml

View File

@@ -1,10 +1,12 @@
import datetime
import os
import random
import sys
import ConfigParser
import json
import logging
import requests
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import selenium.webdriver.common.by as by
@@ -12,6 +14,7 @@ from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait
import testtools
import time
import zipfile
from keystoneclient.v2_0 import client as ksclient
from muranoclient.client import Client as mclient
@@ -22,6 +25,17 @@ log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
log.addHandler(logging.StreamHandler())
if sys.version_info >= (2, 7):
class BaseDeps(testtools.TestCase):
pass
else:
# Define asserts for python26
import unittest2
class BaseDeps(testtools.TestCase,
unittest2.TestCase):
pass
class ImageException(Exception):
message = "Image doesn't exist"
@@ -34,13 +48,11 @@ class ImageException(Exception):
return self._error_string
class UITestCase(testtools.TestCase):
class UITestCase(BaseDeps):
@classmethod
def setUpClass(cls):
super(UITestCase, cls).setUpClass()
keystone_client = ksclient.Client(username=cfg.common.user,
password=cfg.common.password,
tenant_name=cfg.common.tenant,
@@ -54,6 +66,8 @@ class UITestCase(testtools.TestCase):
glance = gclient('1', endpoint=glance_endpoint,
token=keystone_client.auth_token)
cls.headers = {'X-Auth-Token': keystone_client.auth_token}
image_list = []
for i in glance.images.list():
image_list.append(i)
@@ -69,6 +83,42 @@ class UITestCase(testtools.TestCase):
cls.elements.read('common.ini')
cls.logger = logging.getLogger(__name__)
cls.location = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
def archive_app(app_name):
__folderpath__ = os.path.join(cls.location, "{0}".format(app_name))
__rootlen__ = len(__folderpath__) + 1
with zipfile.ZipFile(os.path.join(
cls.location,
"{0}.zip".format(app_name)), "w") as zf:
for dirname, _, files in os.walk(__folderpath__):
for filename in files:
fn = os.path.join(dirname, filename)
zf.write(fn, fn[__rootlen__:])
archive_app('PostgreSQL')
archive_app('AppForUploadTest')
def upload_package(package_name, body):
files = {'%s' % package_name: open(
os.path.join(cls.location, 'PostgreSQL.zip'), 'rb')}
post_body = {'JsonString': json.dumps(body)}
request_url = '{endpoint}{url}'.format(
endpoint=cfg.common.murano_url,
url='/v1/catalog/packages')
return requests.post(request_url,
files=files,
data=post_body,
headers=cls.headers).json()['id']
cls.postgre_id = upload_package(
'PostgreSQL',
{"categories": ["Web"], "tags": ["tag"]})
def setUp(self):
super(UITestCase, self).setUp()
@@ -88,6 +138,18 @@ class UITestCase(testtools.TestCase):
for env in self.murano_client.environments.list():
self.murano_client.environments.delete(env.id)
@classmethod
def tearDownClass(cls):
super(UITestCase, cls).tearDownClass()
os.remove(os.path.join(cls.location, 'PostgreSQL.zip'))
os.remove(os.path.join(cls.location, 'AppForUploadTest.zip'))
request_url = '{endpoint}{url}'.format(
endpoint=cfg.common.murano_url,
url='/v1/catalog/packages/{0}'.format(cls.postgre_id))
requests.delete(request_url, headers=cls.headers)
def take_screenshot(self, test_name):
screenshot_dir = './screenshots'
if not os.path.exists(screenshot_dir):
@@ -173,7 +235,7 @@ class UITestCase(testtools.TestCase):
return False
return True
def env_to_service(self, env_name):
def env_to_components_list(self, env_name):
element_id = self.get_element_id(env_name)
self.driver.find_element_by_id(
"murano__row_{0}__action_show".format(element_id)).click()
@@ -364,11 +426,10 @@ class UITestCase(testtools.TestCase):
self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click()
def create_postgreSQL_service(self, service_name):
def create_postgreSQL_service(self, app_name):
self.driver.find_element_by_xpath(
self.elements.get('apps', 'postgreSQL')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name)
self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-database', 'psql-base')
self.fill_field(by.By.ID, 'id_0-username', 'admin')
self.fill_field(by.By.ID, 'id_0-password', 'P@ssw0rd')
@@ -387,11 +448,18 @@ class UITestCase(testtools.TestCase):
".//*[@data-display='{0}']".format(el_name)).get_attribute("id")
return path.split('__')[-1]
def delete_service(self, service_name):
service_id = self.get_element_id(service_name)
def click_to_add_to_env(self, app_name):
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
app_id = self.get_element_id(app_name)
self.navigate_to('Application_Catalog')
self.go_to_submenu('Applications')
def delete_component(self, component_name):
component_id = self.get_element_id(component_name)
self.driver.find_element_by_id(
'services__row_{0}__action_delete'.format(service_id)).click()
self.driver.find_element_by_link_text('Delete Service').click()
'services__row_{0}__action_delete'.format(component_id)).click()
self.driver.find_element_by_link_text('Delete Component').click()
def get_env_subnet(self):
help_text = self.driver.find_element_by_xpath(

View File

@@ -1,23 +0,0 @@
{
"Resources": {
"$MuranoSecurityGroup-{envName}": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"SecurityGroupIngress": [
{
"ToPort": "80",
"IpProtocol": "tcp",
"FromPort": "80",
"CidrIp": "0.0.0.0/0"
},
{
"ToPort": "443",
"IpProtocol": "tcp",
"FromPort": "443",
"CidrIp": "0.0.0.0/0"
}
]
}
}
}
}

View File

@@ -1,53 +0,0 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"KeyName": {
"Description": "Key Pair name for Load Balancer",
"Type": "String",
"Default": "murano-lb-key"
}
},
"Resources": {
"$instanceName": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType": "$instanceType",
"ImageId": "$imageName",
"AvailabilityZone": "$availabilityZone",
"UserData": "$userData"
}
},
"MuranoDefaultSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"SecurityGroupIngress": [
{
"ToPort": "3389",
"IpProtocol": "tcp",
"FromPort": "3389",
"CidrIp": "0.0.0.0/0"
},
{
"ToPort": "22",
"IpProtocol": "tcp",
"FromPort": "22",
"CidrIp": "0.0.0.0/0"
},
{
"ToPort": "-1",
"IpProtocol": "icmp",
"FromPort": "-1",
"CidrIp": "0.0.0.0/0"
}
],
"GroupDescription": "Default security group for Murano Environments"
}
}
},
"Outputs": {
}
}

View File

@@ -1,42 +0,0 @@
Function DeployTestingFunction {
$stream = [System.IO.StreamWriter] "C:/test_report.txt"
$stream.WriteLine(Test Report)
$host_name = [System.Net.Dns]::GetHostByName((hostname)).HostName
$stream.WriteLine(Host: $host_name)
$ip_address = [System.Net.Dns]::GetHostByName((hostname)).AddressList.IPAddressToString
$stream.WriteLine(IP Address: $ip_address)
$win_agent = Get-Process WindowsAgent | Select-Object name,fileversion,productversion,company
if ($win_agent) { $agent_status = running } else { $agent_status = error }
$stream.WriteLine(Murano Windows Agent Process Status: $agent_status)
if ($win_agent) { $agent_version = $win_agent.FileVersion
$stream.WriteLine(Murano Windows Agent Version: $agent_version) }
$stream.WriteLine(Firewall Opened Ports:)
$firewall_rules = Get-NetFirewallPortFilter | Select-Object Protocol, RemotePort, LocalPort
foreach ($rule in $firewall_rules) { $stream.WriteLine($rule) }
$stream.close()
}

View File

@@ -1,108 +0,0 @@
name: Test Validation Another Fields
type: newService2
description: <strong> Check validation another fields (except String) </strong>
unitTemplates:
- isMaster: true
recoveryPassword: {YAQL: $.serviceConfiguration.recoveryPassword}
- isMaster: false
recoveryPassword: {YAQL: $.serviceConfiguration.recoveryPassword}
forms:
- serviceConfiguration:
fields:
- name: name
type: string
label: IIS Name
description: >-
Enter a desired name for a service. Just A-Z, a-z, 0-9, dash and
underline are allowed.
minLength: 2
maxLength: 64
regexpValidator: '^[-\w]+$'
errorMessages:
invalid: Just letters, numbers, underscores and hyphens are allowed.
helpText: Just letters, numbers, underscores and hyphens are allowed
- name: dcInstances
type: instance
label: Instance Count
description: >-
You can create several Active Directory instances by setting
instance number larger than one. One primary Domain Controller
and a few secondary DCs will be created.
attributeNames: units
minValue: 1
maxValue: 100
initial: 1
helpText: Enter an integer value between 1 and 100
- name: adminPassword
type: password
label: Administrator password
descriptionTitle: Passwords
description: >-
Windows requires strong password for service administration.
Your password should have at least one letter in each
register, a number and a special character. Password length should be
a minimum of 7 characters.
Once you forget your password you won't be able to
operate the service until recovery password would be entered. So it's
better for Recovery and Administrator password to be different.
- name: recoveryPassword
type: password
label: Recovery password
attributeNames: false
- name: unitNamingPattern
type: string
label: Hostname template
description: >-
For your convenience all instance hostnames can be named
in the same way. Enter a name and use # character for incrementation.
For example, host# turns into host1, host2, etc. Please follow Windows
hostname restrictions.
required: false
regexpValidator: '^(([a-zA-Z0-9#][a-zA-Z0-9-#]*[a-zA-Z0-9#])\.)*([A-Za-z0-9#]|[A-Za-z0-9#][A-Za-z0-9-#]*[A-Za-z0-9#])$'
helpText: Optional field for a machine hostname template
# temporaryHack
widgetMedia:
js: [muranodashboard/js/support_placeholder.js]
css: {all: [muranodashboard/css/support_placeholder.css]}
validators:
# if unitNamingPattern is given and dcInstances > 1, then '#' should occur in unitNamingPattern
- expr: {YAQL: $.serviceConfiguration.dcInstances < 2 or not $.serviceConfiguration.unitNamingPattern.bool() or ('#' in $.serviceConfiguration.unitNamingPattern)}
message: Incrementation symbol "#" is required in the Hostname template
- name: repository
type: string
label: Git repository
description: >-
URL of a git repository with the application you want to deploy.
regexpValidator: '/(\w+://)(.+@)*([\w\d\.]+)(:[\d]+)?/*(.*)/i'
errorMessages:
invalid: Enter correct git repository url
helpText: Enter a valid git repository URL
- instanceConfiguration:
fields:
- name: title
type: string
required: false
hidden: true
attributeNames: false
descriptionTitle: Instance Configuration
description: Specify some instance parameters on which service would be created.
- name: flavor
type: flavor
label: Instance flavor
description: >-
Select registered in Openstack flavor. Consider that service performance
depends on this parameter.
required: false
- name: osImage
type: image
imageType: windows
label: Instance image
description: >-
Select valid image for a service. Image should already be prepared and
registered in glance.

View File

@@ -94,8 +94,32 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'TestImageForDeletion'))
def test_005_check_image_info(self):
"""
Test check ability to view image details
Scenario:
1. Navigate to Images page
2. Create test image
3. Click on the name of selected image, check image info
"""
self.navigate_to('Manage')
self.go_to_submenu('Images')
self.driver.find_element_by_id(
'marked_images__action_mark_image').click()
self.select_from_list('image', 'TestImageForDeletion')
self.fill_field(by.By.ID, 'id_title', 'TestImage')
self.select_from_list('type', ' Windows Server 2012')
self.select_and_click_element('Mark')
self.driver.find_element_by_link_text('TestImageForDeletion').click()
self.assertIn('{"type": "windows.2012", "title": "TestImage"}',
self.driver.page_source)
@testtools.skip("New UI in progress")
def test_005_create_and_delete_demo_service(self):
def test_006_create_and_delete_demo_service(self):
"""
Test check ability to create and delete demo service
@@ -108,22 +132,22 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.create_demo_service('DemoService')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'DemoService'))
self.delete_service('DemoService')
self.delete_component('DemoService')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'DemoService'))
@testtools.skip("New UI in progress")
def test_006_create_and_delete_linux_telnet(self):
def test_007_create_and_delete_linux_telnet(self):
"""
Test check ability to create and delete linux telnet service
@@ -136,22 +160,22 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.create_linux_telnet('linuxtelnet')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'linuxtelnet'))
self.delete_service('linuxtelnet')
self.delete_component('linuxtelnet')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'linuxtelnet'))
@testtools.skip("New UI in progress")
def test_007_create_and_delete_linux_apache(self):
def test_008_create_and_delete_linux_apache(self):
"""
Test check ability to create and delete linux apache service
@@ -164,22 +188,22 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_linux_apache('linuxapache')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'linuxapache'))
self.delete_service('linuxapache')
self.delete_component('linuxapache')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'linuxapache'))
@testtools.skip("New UI in progress")
def test_008_create_and_delete_ad_service(self):
def test_009_create_and_delete_ad_service(self):
"""
Test check ability to create and delete active directory service
@@ -192,24 +216,24 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.driver.find_element_by_xpath(
self.elements.get('apps', 'AD')).click()
self.create_ad_service('muranotest.domain')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'muranotest.domain'))
self.delete_service('muranotest.domain')
self.delete_component('muranotest.domain')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'muranotest.domain'))
@testtools.skip("New UI in progress")
def test_009_create_and_delete_iis_service(self):
def test_010_create_and_delete_iis_service(self):
"""
Test check ability to create and delete IIS service
@@ -222,21 +246,21 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_iis_service('IISService')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'IISService'))
self.delete_service('IISService')
self.delete_component('IISService')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'IISService'))
@testtools.skip("New UI in progress")
def test_010_create_and_delete_asp_service(self):
def test_011_create_and_delete_asp_service(self):
"""
Test check ability to create and delete ASP.Net service
@@ -249,22 +273,22 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_asp_service('ASPService')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'ASPService'))
self.delete_service('ASPService')
self.delete_component('ASPService')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'ASPService'))
@testtools.skip("New UI in progress")
def test_011_create_and_delete_iisfarm_service(self):
def test_012_create_and_delete_iisfarm_service(self):
"""
Test check ability to create and delete IIS Farm service
@@ -277,22 +301,22 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_iisfarm_service('IISFarmService')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'IISFarmService'))
self.delete_service('IISFarmService')
self.delete_component('IISFarmService')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'IISFarmService'))
@testtools.skip("New UI in progress")
def test_012_create_and_delete_aspfarm_service(self):
def test_013_create_and_delete_aspfarm_service(self):
"""
Test check ability to create and delete ASP.Net Farm service
@@ -305,22 +329,22 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_aspfarm_service('ASPFarmService')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'ASPFarmService'))
self.delete_service('ASPFarmService')
self.delete_component('ASPFarmService')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'ASPFarmService'))
@testtools.skip("New UI in progress")
def test_013_create_and_delete_mssql_service(self):
def test_014_create_and_delete_mssql_service(self):
"""
Test check ability to create and delete MSSQL service
@@ -333,22 +357,22 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_mssql_service('MSSQLService')
self.go_to_submenu('Environments')
self.env_to_service('test')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'MSSQLService'))
self.delete_service('MSSQLService')
self.delete_component('MSSQLService')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'MSSQLService'))
@testtools.skip("New UI in progress")
def test_014_create_and_delete_sql_cluster_service(self):
def test_015_create_and_delete_sql_cluster_service(self):
"""
Test check ability to create and delete MSSQL cluster service
@@ -361,9 +385,9 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_ad_service('activeDirectory.mssql')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'activeDirectory.mssql'))
@@ -373,12 +397,12 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'SQLCluster'))
self.delete_service('SQLCluster')
self.delete_component('SQLCluster')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'SQLCluster'))
@testtools.skip("New UI in progress")
def test_015_create_and_delete_tomcat_service(self):
def test_016_create_and_delete_tomcat_service(self):
"""
Test check ability to create and delete tomcat service
@@ -391,9 +415,9 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.create_postgreSQL_service('posrgreSQL')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'posrgreSQL'))
@@ -403,12 +427,12 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'tomcat-serv'))
self.delete_service('tomcat-serv')
self.delete_component('tomcat-serv')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'tomcat-serv'))
@testtools.skip("New UI in progress")
def test_016_create_and_delete_postgreSQL_service(self):
def test_017_create_and_delete_postgreSQL_service(self):
"""
Test check ability to create and delete postgreSQL service
@@ -421,19 +445,19 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.create_postgreSQL_service('postgreSQL-serv')
self.driver.find_element_by_link_text('Add Component').click()
self.create_postgreSQL_service('PostgreSQL')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'postgreSQL-serv'))
'PostgreSQL'))
self.delete_service('postgreSQL-serv')
self.delete_component('PostgreSQL')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'postgreSQL-serv'))
'PostgreSQL'))
@testtools.skip("New UI in progress")
def test_017_check_regex_expression_for_ad_name(self):
def test_018_check_regex_expression_for_ad_name(self):
"""
Test check that validation of domain name field work and appropriate
error message is appeared after entering incorrect domain name
@@ -461,9 +485,9 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.driver.find_element_by_xpath(
self.elements.get('apps', 'AD')).click()
@@ -514,7 +538,7 @@ class UISanityTests(UITestCase):
'they are used to delimit the components of domain style names', 1))
@testtools.skip("New UI in progress")
def test_018_check_regex_expression_for_iis_name(self):
def test_019_check_regex_expression_for_iis_name(self):
"""
Test check that validation of iis name field work and appropriate
error message is appeared after entering incorrect name
@@ -531,9 +555,9 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.driver.find_element_by_xpath(
self.elements.get('apps', 'IIS')).click()
@@ -554,7 +578,7 @@ class UISanityTests(UITestCase):
'Just letters, numbers, underscores and hyphens are allowed.', 1))
@testtools.skip("New UI in progress")
def test_019_check_regex_expression_for_git_repo_field(self):
def test_020_check_regex_expression_for_git_repo_field(self):
"""
Test check that validation of git repository field work and appropriate
error message is appeared after entering incorrect url
@@ -567,9 +591,9 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.driver.find_element_by_xpath(
self.elements.get('apps', 'ASP')).click()
@@ -582,7 +606,7 @@ class UISanityTests(UITestCase):
'Enter correct git repository url', 4))
@testtools.skip("New UI in progress")
def test_020_check_validation_for_hostname_template_field(self):
def test_021_check_validation_for_hostname_template_field(self):
"""
Test check that validation of hostname template field work and
appropriate error message is appeared after entering incorrect name
@@ -596,9 +620,9 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Application').click()
self.driver.find_element_by_link_text('Add Component').click()
self.driver.find_element_by_xpath(
self.elements.get('apps', 'Demo')).click()
@@ -619,7 +643,7 @@ class UISanityTests(UITestCase):
by.By.ID, '1-osImage').is_displayed())
@testtools.skip("New UI in progress")
def test_021_check_bool_field_validation(self):
def test_022_check_bool_field_validation(self):
"""
Test check that validation of bool field work
@@ -632,7 +656,7 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('test')
self.env_to_service('test')
self.env_to_components_list('test')
self.driver.find_element_by_id('services__action_CreateService').click()
@@ -679,7 +703,7 @@ class UISanityTests(UITestCase):
'This field is required.', 1))
@testtools.skip("New UI in progress")
def test_022_positive_scenario_1_for_the_MS_SQL_Cluster_Form(self):
def test_023_positive_scenario_1_for_the_MS_SQL_Cluster_Form(self):
"""
Test check one possible scenario of creation mssql cluster
@@ -691,7 +715,7 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('scenario_1')
self.env_to_service('scenario_1')
self.env_to_components_list('scenario_1')
self.create_ad_service('activeDirectory.mssql')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
@@ -725,7 +749,7 @@ class UISanityTests(UITestCase):
by.By.ID, 'id_msSqlClusterServer-1-clusterIp'))
@testtools.skip("New UI in progress")
def test_023_positive_scenario_2_for_the_MS_SQL_Cluster_Form(self):
def test_024_positive_scenario_2_for_the_MS_SQL_Cluster_Form(self):
"""
Test check one possible scenario of creation mssql cluster
@@ -738,7 +762,7 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('scenario_2')
self.env_to_service('scenario_2')
self.env_to_components_list('scenario_2')
self.driver.find_element_by_link_text('Create Service').click()
@@ -777,7 +801,7 @@ class UISanityTests(UITestCase):
by.By.ID, 'id_msSqlClusterServer-1-clusterIp'))
@testtools.skip("New UI in progress")
def test_024_positive_scenario_3_for_the_MS_SQL_Cluster_Form(self):
def test_025_positive_scenario_3_for_the_MS_SQL_Cluster_Form(self):
"""
Test check one possible scenario of creation mssql cluster
@@ -789,7 +813,7 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Environments')
self.create_environment('scenario_3')
self.env_to_service('scenario_3')
self.env_to_components_list('scenario_3')
self.driver.find_element_by_link_text('Create Service').click()
@@ -830,8 +854,7 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_element_on_page(
by.By.ID, 'id_msSqlClusterServer-1-clusterIp'))
@testtools.skip("There are no default packages in Murano")
def test_025_modify_package_name(self):
def test_026_modify_package_name(self):
"""
Test check ability to change name of the package
@@ -842,26 +865,25 @@ class UISanityTests(UITestCase):
"""
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
self.select_action_for_package('NAME',
self.select_action_for_package('PostgreSQL',
'modify_package')
self.fill_field(by.By.ID, 'id_name', 'NAME-modified')
self.fill_field(by.By.ID, 'id_name', 'PostgreSQL-modified')
self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click()
self.assertTrue(self.check_element_on_page(
by.By.XPATH, './/*[@data-display="NAME-modified"]'))
by.By.XPATH, './/*[@data-display="PostgreSQL-modified"]'))
self.select_action_for_package('NAME-modified',
self.select_action_for_package('PostgreSQL-modified',
'modify_package')
self.fill_field(by.By.ID, 'id_name', 'NAME')
self.fill_field(by.By.ID, 'id_name', 'PostgreSQL')
self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click()
self.assertTrue(self.check_element_on_page(
by.By.XPATH, './/*[@data-display="NAME"]'))
by.By.XPATH, './/*[@data-display="PostgreSQL"]'))
@testtools.skip("There are no default packages in Murano")
def test_026_modify_description(self):
def test_027_modify_description(self):
"""
Test check ability to change description of the package
@@ -872,7 +894,7 @@ class UISanityTests(UITestCase):
"""
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
self.select_action_for_package('NAME',
self.select_action_for_package('PostgreSQL',
'modify_package')
self.fill_field(by.By.ID, 'id_description', 'New Description')
@@ -883,11 +905,10 @@ class UISanityTests(UITestCase):
self.go_to_submenu('Applications')
self.check_element_on_page(
"XPATH_OF_NAME",
".//*[@class='app-description']",
'New Description')
@testtools.skip("There are no default packages in Murano")
def test_027_modify_package_add_tag(self):
def test_028_modify_package_add_tag(self):
"""
Test check ability to add file in composed service
@@ -898,39 +919,38 @@ class UISanityTests(UITestCase):
"""
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
self.select_action_for_package('NAME',
self.select_action_for_package('PostgreSQL',
'modify_package')
self.fill_field(by.By.ID, 'id_tags', 'TEST_TAG')
self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click()
app_id = self.get_element_id('NAME')
app_id = self.get_element_id('PostgreSQL')
self.navigate_to('Application_Catalog')
self.go_to_submenu('Applications')
self.select_and_click_action_for_app('details', app_id)
self.check_element_on_page(
'XPATH_OF_AREA',
".//*[@id='content_body']/div[2]/div/div/div[2]/div[2]/ul/li[6]",
'TEST_TAG')
@testtools.skip("There are no default packages in Murano")
def test_028_download_package(self):
def test_029_download_package(self):
"""
Test check ability to download service from repository
Test check ability to download package from repository
Scenario:
1. Navigate to 'Package Definitions' page
2. Select Demo service and click on "More>Download"
2. Select PostgreSQL package and click on "More>Download Package"
"""
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
self.select_action_for_package('demoService', 'more')
self.select_action_for_package('demoService', 'download_service')
self.select_action_for_package('PostgreSQL', 'more')
self.select_action_for_package('PostgreSQL', 'download_package')
@testtools.skip("There are no default packages in Murano")
def test_029_upload_package_add_to_env(self):
@testtools.skip("Work in progress")
def test_030_upload_package_add_to_env(self):
"""
Test check ability to upload package to repository
@@ -943,16 +963,15 @@ class UISanityTests(UITestCase):
self.go_to_submenu('Package Definitions')
self.click_on_package_action('upload_package')
self.choose_and_upload_files('PACKAGE.zip')
self.select_from_list('categories', 'CATEGORY')
self.choose_and_upload_files('AppForUploadTest.zip')
self.select_from_list('categories', 'Web')
self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click()
self.assertTrue(self.check_element_on_page(
by.By.XPATH, './/*[@data-display="PACKAGE_NAME"]'))
by.By.XPATH, './/*[@data-display="AppForUploadTest"]'))
@testtools.skip("There are no default packages in Murano")
def test_030_check_opportunity_to_toggle_service(self):
def test_031_check_opportunity_to_toggle_package(self):
"""
Test check ability to make package active or inactive
@@ -966,18 +985,19 @@ class UISanityTests(UITestCase):
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
self.select_action_for_package('NAME', 'more')
self.select_action_for_package('NAME', 'toggle_enabled')
self.select_action_for_package('PostgreSQL', 'more')
self.select_action_for_package('PostgreSQL', 'toggle_enabled')
self.assertTrue(self.check_package_parameter('NAME', '3', 'False'))
self.assertTrue(self.check_package_parameter(
'PostgreSQL', '3', 'False'))
self.select_action_for_package('NAME', 'more')
self.select_action_for_package('NAME', 'toggle_enabled')
self.select_action_for_package('PostgreSQL', 'more')
self.select_action_for_package('PostgreSQL', 'toggle_enabled')
self.assertTrue(self.check_package_parameter('NAME', '3', 'True'))
self.assertTrue(self.check_package_parameter(
'PostgreSQL', '3', 'True'))
@testtools.skip("There are no default packages in Murano")
def test_031_check_opportunity_to_delete_package(self):
def test_032_check_opportunity_to_delete_package(self):
"""
Test check ability to delete package from database
@@ -989,15 +1009,15 @@ class UISanityTests(UITestCase):
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
package = self.get_element_id('NAME')
package = self.get_element_id('PostgreSQL')
self.select_and_click_element(package)
self.click_on_package_action('delete_package')
self.confirm_deletion()
self.assertFalse(self.check_element_on_page(
by.By.XPATH, './/*[@data-display="NAME"]'))
by.By.XPATH, './/*[@data-display="PostgreSQL"]'))
def test_032_check_application_catalog_panel(self):
def test_033_check_application_catalog_panel(self):
"""
Test checks that 'Applications' panel is operable
@@ -1007,10 +1027,10 @@ class UISanityTests(UITestCase):
"""
self.go_to_submenu('Applications')
self.assertTrue(self.check_element_on_page(
by.By.XPATH, ".//*[@id='content_body']/div[2]/h3[1]"))
by.By.XPATH, ".//*[@id='content_body']/div[1]/h2"))
@testtools.skip("There are no default apps in Murano")
def test_033_env_creation_form_app_catalog_page(self):
def test_034_env_creation_form_app_catalog_page(self):
"""
Test checks that app's option 'Add to environment' is operable
when there is no previously created env. In this case creation of the
@@ -1035,8 +1055,7 @@ class UISanityTests(UITestCase):
self.assertTrue(
self.driver.find_element_by_id('services__action_AddApplication'))
@testtools.skip("There are no default apps in Murano")
def test_034_check_info_about_app(self):
def test_035_check_info_about_app(self):
"""
Test checks that information about app is available and truly.
@@ -1046,13 +1065,13 @@ class UISanityTests(UITestCase):
3. Verify info about application
"""
self.go_to_submenu('Applications')
self.select_and_click_action_for_app('details', 'NAME')
self.select_and_click_action_for_app('details', 'PostgreSQL')
self.assertIn('DESCRIPTION', self.driver.page_source)
self.assertIn('PostgreSQL is a powerful', self.driver.page_source)
self.driver.find_element_by_link_text('Requirements').click()
self.driver.find_element_by_link_text('License').click()
def test_035_check_search_option(self):
def test_036_check_search_option(self):
"""
Test checks that 'Search' option is operable.
@@ -1069,7 +1088,7 @@ class UISanityTests(UITestCase):
".//*[@id='MuranoSearchPanel']/form/button").click()
@testtools.skip("There are no default apps in Murano")
def test_036_filter_by_category(self):
def test_037_filter_by_category(self):
"""
Test checks ability to filter applications by category
in Application Catalog page
@@ -1103,7 +1122,7 @@ class UISanityTests(UITestCase):
format(package_category2)))
@testtools.skip("There are no default apps in Murano")
def test_037_check_option_switch_env(self):
def test_038_check_option_switch_env(self):
"""
Test checks ability to switch environment and to add app in other env
@@ -1121,15 +1140,26 @@ class UISanityTests(UITestCase):
self.go_to_submenu('Environments')
self.create_environment('env1')
self.create_environment('env2')
self.navigate_to('Application_Catalog')
self.go_to_submenu('Applications')
self.driver.find_element_by_link_text('Environment').click()
self.driver.find_element_by_link_text('env2').click()
self.select_and_click_action_for_app('add', 'NAME')
self.select_and_click_action_for_app('add', 'PostgreSQL')
self.create_iis_service('IISService')
self.go_to_submenu('Environments')
self.env_to_service('env2')
self.env_to_components_list('env2')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'IISService'))
'PostgreSQL'))
@testtools.skip("Wait for https://review.openstack.org/#/c/90249/")
def test_039_check_statistics_panel(self):
"""
Test checks that 'Statictics' panel is operable
Scenario:
1. Navigate to 'Application Catalog > Statistics' panel
"""
self.go_to_submenu('Statistics')
self.driver.find_element_by_link_text('Murano Engine Servers').click()
self.driver.find_element_by_link_text('Murano API Servers').click()