2014-06-25 15:39:31 +04:00
..
Copyright 2014 2014 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.
==================================
2015-05-26 18:27:40 -04:00
Murano automated tests description
2014-06-25 15:39:31 +04:00
==================================
2014-09-09 15:18:11 +04:00
This page describes automated tests for a Murano project:
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
* where tests are located
* how they are run
* how execute tests on a local machine
2015-09-04 22:58:51 +05:30
* how to find the root of problems with FAILed tests
2014-09-09 15:18:11 +04:00
2015-05-26 18:27:40 -04:00
Murano continuous integration service
2014-06-25 15:39:31 +04:00
=====================================
2014-09-09 15:18:11 +04:00
Murano project has separate CI server, which runs tests for all commits and verifies that new code does not break anything.
2014-06-25 15:39:31 +04:00
Murano CI uses OpenStack QA cloud for testing infrastructure.
2014-09-09 15:18:11 +04:00
Murano CI url: https://murano-ci.mirantis.com/jenkins/ Anyone can login to that server, using launchpad credentials.
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
There you can find each job for each repository: one for the **murano** and another one for **murano-dashboard** .
2014-06-25 15:39:31 +04:00
2016-08-16 19:02:05 +03:00
* "gate-murano-dashboard-ubuntu\*" verifies each commit to murano-dashboard
repository
* "gate-murano-ubuntu\*" verifies each commit to murano repository
2014-06-25 15:39:31 +04:00
2016-02-03 21:27:45 +05:30
Other jobs allow to build and test Murano documentation and perform another useful work to support Murano CI infrastructure.
2015-09-04 22:58:51 +05:30
All jobs are run on fresh installation of operating system and all components are installed on each run.
2014-06-25 15:39:31 +04:00
2015-05-26 18:27:40 -04:00
Murano automated tests: UI tests
2014-06-25 15:39:31 +04:00
================================
2015-05-26 18:27:40 -04:00
The murano project has a web user interface and all possible user scenarios should be tested.
2015-04-18 10:57:11 +03:00
All UI tests are located at the https://git.openstack.org/cgit/openstack/murano-dashboard/tree/muranodashboard/tests/functional
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
Automated tests for Murano Web UI are written in Python using special Selenium library. This library is used to automate web browser interaction from Python.
For more information please visit https://selenium-python.readthedocs.org/
2014-06-25 15:39:31 +04:00
Prerequisites:
++++++++++++++
2016-08-16 19:02:05 +03:00
* Install the Python module called nose by performing **easy_install nose**
or **pip install nose** . This will install the nose libraries, as well as
the nosetests script, which you can use to automatically discover and run tests.
* Install external Python libraries, which are required for Murano Web UI
tests: **testtools** and **selenium** .
* Verify that you have one of the following web browsers installed:
* Mozilla Firefox 46.0
.. note ::
If you do not have firefox package out of the box,
install and remove it. Otherwise, you will need to install
dependant libraries manually. To downgrade Firefox:
.. code-block :: console
apt-get remove firefox
wget https://ftp.mozilla.org/pub/firefox/releases/46.0/linux-x86_64/en-US/firefox-46.0.tar.bz2
tar -xjf firefox-46.0.tar.bz2
rm -rf /opt/firefox
mv firefox /opt/firefox46
ln -s /opt/firefox46/firefox /usr/bin/firefox
* Google Chrome
* To run the tests on a remote server, configure the remote X server. Use VNC Software to see the test results in real-time.
#. Specify the display environment variable:
.. code-block :: console
$DISPLAY=: <value>
#. Configure remote X server and VNC Software by typing:
.. code-block :: console
apt-get install xvfb xfonts-100dpi xfonts-75dpi xfonts-cyrillic xorg dbus-x11
"Xvfb -fp "/usr/share/fonts/X11/misc/" :$DISPLAY -screen 0 "1280x1024x16" &"
apt-get install --yes x11vnc
x11vnc -bg -forever -nopw -display :$DISPLAY -ncache 10
sudo iptables -I INPUT 1 -p tcp --dport 5900 -j ACCEPT
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
Download and run tests:
2014-06-25 15:39:31 +04:00
+++++++++++++++++++++++
First of all make sure that all additional components are installed.
* Clone murano-dashboard git repository:
2015-04-18 10:57:11 +03:00
* git clone git://git.openstack.org/openstack/murano-dashboard*
2014-09-09 15:18:11 +04:00
2016-08-16 19:02:05 +03:00
* To change the default settings:
#. Specify the Murano Repository URL variable for Horizon local settings in `` murano_dashboard/muranodashboard/local/local_settings.d/_50_murano.py `` :
.. code-block :: console
MURANO_REPO_URL = 'http://localhost:8099'
#. Copy `` muranodashboard/tests/functional/config/config.conf.sample `` to`` config.conf `` .
#. Set appropriate urls and credentials for your OpenStack lab. Only admin users are appropriate.
2014-06-25 15:39:31 +04:00
::
2014-09-09 15:18:11 +04:00
[murano]
2016-08-16 19:02:05 +03:00
horizon_url = http://localhost/dashboard
2014-06-25 15:39:31 +04:00
murano_url = http://localhost:8082
user = ***
password = ***
tenant = ***
2016-08-16 19:02:05 +03:00
keystone_url = http://localhost:5000/v3
2014-06-25 15:39:31 +04:00
2016-05-17 10:25:33 +03:00
All tests are kept in *sanity_check.py* and divided into 10 test suites:
2014-09-09 15:18:11 +04:00
* TestSuiteSmoke - verification of Murano panels; check, that could be open without errors.
* TestSuiteEnvironment - verification of all operations with environment are finished successfully.
* TestSuiteImage - verification of operations with images.
* TestSuiteFields - verification of custom fields validators.
* TestSuitePackages - verification of operations with Murano packages.
* TestSuiteApplications - verification of Application Catalog page and of application creation process.
2014-06-25 15:39:31 +04:00
2016-05-17 10:25:33 +03:00
* TestSuiteAppsPagination - verification of apps pagination in case of many applications installed.
* TestSuiteRepository - verification of importing packages and bundles.
* TestSuitePackageCategory - verification of main operations with categories.
* TestSuiteCategoriesPagination - verification of categories pagination in case of many categories created.
2016-06-22 19:57:36 +03:00
* TestSuiteMultipleEnvironments - verification of ability to apply action to multiple environments.
2016-05-17 10:25:33 +03:00
2014-09-09 15:18:11 +04:00
To specify which tests/suite to run, pass test/suite names on the command line:
2014-06-25 15:39:31 +04:00
2016-05-23 12:19:19 +03:00
* to run all tests: `` nosetests sanity_check.py ``
2014-09-09 15:18:11 +04:00
* to run a single suite: `` nosetests sanity_check.py:<test suite name> ``
* to run a single test: `` nosetests sanity_check.py:<test suite name>.<test name> ``
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
In case of SUCCESS execution, you should see something like this:
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
::
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
.........................
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
Ran 34 tests in 1.440s
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
OK
In case of FAILURE, folder with screenshots of the last operation of tests that finished with errors would be created.
It's located in *muranodashboard/tests/functional* folder.
There are also a number of command line options that can be used to control the test execution and generated outputs. For more details about *nosetests* , try:
::
2015-08-11 15:14:23 +03:00
nosetests -h
2014-06-25 15:39:31 +04:00
Murano Automated Tests: Tempest Tests
=====================================
2015-05-26 18:27:40 -04:00
All Murano services have tempest-based automated tests, which allow to verify API interfaces and deployment scenarios.
2014-06-25 15:39:31 +04:00
2015-04-18 10:57:11 +03:00
Tempest tests for Murano are located at the: https://git.openstack.org/cgit/openstack/murano/tree/murano/tests/functional
2014-06-25 15:39:31 +04:00
2015-09-04 22:58:51 +05:30
The following Python files contains basic tests suites for different Murano components.
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
API Tests
+++++++++
2014-06-25 15:39:31 +04:00
2015-04-18 10:57:11 +03:00
Murano API tests are run on devstack gate and located at https://git.openstack.org/cgit/openstack/murano/tree/murano/tests/functional/api
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
* *test_murano_envs.py* contains test suite with actions on murano's environments(create, delete, get and etc.)
* *test_murano_sessions.py* contains test suite with actions on murano's sessions(create, delete, get and etc.)
* *test_murano_services.py* contains test suite with actions on murano's services(create, delete, get and etc.)
* *test_murano_repository.py* contains test suite with actions on murano's package repository
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
Engine Tests
+++++++++++++++++++
2015-04-18 10:57:11 +03:00
Murano Engine Tests are run on murano-ci : https://git.openstack.org/cgit/openstack/murano/tree/murano/tests/functional/engine
2014-09-09 15:18:11 +04:00
* *base.py* contains base test class and tests with actions on deploy Murano services such as 'Telnet' and 'Apache'.
Command Line Tests
+++++++++++++++++++++++++
Murano CLI tests case are currently in the middle of creation. The current scope is read only operations on a cloud that are hard to test via unit tests.
2014-06-25 15:39:31 +04:00
2014-09-09 15:18:11 +04:00
All tests have description and execution steps in there docstrings.