Test tools allow you to test some operations with your application. This document explains how to run a test based on the pytest framework.
In this document:
The platform you use for testing your integration package must meet the Prerequisites stated in the deployment phase.
The OSS management node is installed on a RHEL or CenOS operating system that allow installing
packages through the
yum package manager. On a test system, you should add the
python-setuptools package and then use the
easy_install Python package manager
to install the
The following steps make your platform ready for testing.
# yum install python-setuptools
# easy_install pytest
Once you have done it, the management node is ready to run your application test.
On the OSS management node, run the predefined script to test your APS package as follows.
Create a folder and place the following two files into it:
test_app.py- an auto-test script
If you do not have your own APS package, use the
to study the auto-test script.
Enter inside the folder and run the auto-test script:
# pytest -vv -x test_app.py
test_app.py script will discover the package with the
app.zip extension and apply its tests to it.
If all tests passed, you will see the following print-out:
=============================== test session starts ======================================= platform linux2 -- Python 2.7.5, pytest-3.0.7, py-1.4.33, pluggy-0.4.0 -- /usr/bin/python2 cachedir: .cache rootdir: /root/autotest, inifile: collected 6 items test_app.py::TestApp::test_01_import PASSED test_app.py::TestApp::test_02_instance PASSED test_app.py::TestApp::test_03_st PASSED test_app.py::TestApp::test_04_subscription PASSED test_app.py::TestApp::test_05_hold PASSED test_app.py::TestApp::test_06_terminate PASSED ================================ 6 passed in 17.75 seconds ================================
If one of the tests fails, the script stops at this test and print out the description of the issue in details.
The auto-test script contains the following sequence of tests that you can extend if necessary:
test_01_importimports the APS package from the current folder.
test_02_instanceinstalls an APS connector and initiates an APS application instance on the end-point host using the Docker image you have created earlier in the deployment phase.
test_03_stcreates a service template with two main resource types (APS application instance and management context) as defined in the dictionary
test_04_subscriptioncreates a subscription from the new service template.
test_05_holddisables and then enables the subscription.
test_06_terminateterminates the subscription.
If you edit this auto-test script or create your own, pay attention to the
It defines the product components to be created in the platform using a syntax similar to one explained
in the Product Initialization document.
In the provider control panel, you will find the consequences of the tests you have executed.
test_03_sttest completes successfully, a new set of resource types appears even if their names were not changed in the
Products > Service Templatesshows a list of service templates. Each time the
test_03_sttest completes successfully, a new service template appears even if its name was not changed in the
You can use the test results by creating additional resource types, including them into one of the remained service templates, and then creating subscriptions from the modified service template.