Fixed issue of subscription name for pnf macro
[testsuite/pythonsdk-tests.git] / README.md
1 # pythonsdk-tests
2
3 This project is a wrapper to use onapsdk toolkit to onboard and
4 instantiate services on ONAP
5
6 ## Temporary help section
7
8 A basic example is implemented in the python file
9
10 - run_basicvm_multicloud_yaml.py
11
12 The global datas defined in these files (see input_datas) shall be
13 adapted to your environment.
14
15 In addition you must define your service in directory templates/vnf-services
16 and create zip file for heat template templates/heat_files.
17
18 ### Prepare your environment and run tests
19
20 - Clone the project (using instantiation branch)
21   ```shell
22   git clone https://gerrit.onap.org/r/testsuite/pythonsdk-tests.git
23   ```
24
25 - Create a virtual environment and clone the python-onapsdk
26   ```shell
27   virtualenv my_test
28   source my_test/bin/activate
29   git clone git@gitlab.com:Orange-OpenSource/lfn/onap/python-onapsdk.
30   git -b develop
31   cd python-onapsdk
32   pip install -e .
33   cd ..
34   pip install -e .
35   ```
36
37 - Set global settings configuration files with all required input datas
38   including the dynamic forwarding port for ssh tunnel in
39   src/onaptests/configuration/settings.py. You can customize the path for your
40   logs and reporting the page. Note that the reporting page assumes that the
41   logs are put in the same directory than the html page (relative path).
42
43 - Set OpenStack configuration: there are 2 ways to provide the cloud information
44   If you got the clouds.yaml, you need to reference your cloud with the env
45   variable OS_TEST_CLOUD
46   ```shell
47   export OS_TEST_CLOUD=cloud-name-referenced-in-the-cloud-configuration
48   ```
49   If you do not have access to the cloud config, you must precise all the
50   parameters manually
51
52 - Export the setting file in a environment variable
53   ```shell
54   export ONAP_PYTHON_SDK_SETTINGS=onaptests.configuration.basic_vm_multicloud_yaml_settings
55   ```
56
57 Note each "use case" may have its own settings corresponding to the test
58 environment and configuration.
59
60 - (optional) Open ssh tunnel towards your openlab setting a dynamic
61   port forward (by default 1080):
62   ```shell
63   ssh user@onap.pod4.opnfv.fr -D 1080
64   ```
65
66 - Once the different input datas are updated in run_\*.py files and
67   that the templates files for your service are defined, start to run
68   the different steps:
69   ```shell
70   python run_basicvm_nomulticloud.py
71   ```
72
73 - By default, all the logs are stored in the file pythonsdk.debug.log.
74   The file name and location can be set in the settings.py