Elena Stoeva | 3d3d854 | 2021-04-09 14:37:04 -0400 | [diff] [blame] | 1 | ========================================== |
| 2 | Instructions For Running The ROC API Tests |
| 3 | ========================================== |
| 4 | |
| 5 | The REST API of the Aether ROC is tested utilizing the Robot Framework. |
| 6 | The tests are located inside the aether-system-tests repository and they are run nightly using |
| 7 | Jenkins job. |
| 8 | |
| 9 | Development Prerequisites |
| 10 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 11 | To access the ROC API from a local system, it is necessary to deploy the components of ยตONOS. |
| 12 | This can be done with the use of Helm (see instructions on |
| 13 | `this page <https://docs.onosproject.org/onos-docs/docs/content/developers/deploy_with_helm/>`_). |
| 14 | |
| 15 | | Additionally, it is necessary to add the sdran chart repo with the following command: |
| 16 | | ``helm repo add sdran --username USER --password PASSWORD https://sdrancharts.onosproject.org`` |
| 17 | | , where USER and PASSWORD can be obtained from the Aether Login Information file, which is |
| 18 | | accessibble to the ``onfstaff`` group. |
| 19 | |
| 20 | Access the ROC API |
| 21 | ^^^^^^^^^^^^^^^^^^ |
| 22 | Follow the steps below to access the ROC API: |
| 23 | |
| 24 | | 1. Deploy the aether-roc-umbrella chart from the sdran repo with the following command: |
| 25 | | ``helm -n micro-onos install aether-roc-umbrella sdran/aether-roc-umbrella`` |
| 26 | | 2. Check if all pods are in a Running state with the command ``kubectl -n micro-onos get pods`` |
| 27 | | This should give a list like: |
| 28 | |
| 29 | |
| 30 | +---------------------------------+-------+---------+----------+-----+ |
| 31 | | NAME | READY | STATUS | RESTARTS | AGE | |
| 32 | +---------------------------------+-------+---------+----------+-----+ |
| 33 | | aether-roc-api-56f54d69d4-b4mkk | 1/1 | Running | 0 | 46s | |
| 34 | +---------------------------------+-------+---------+----------+-----+ |
| 35 | | aether-roc-gui-75d6bf95d7-998bg | 1/1 | Running | 0 | 47s | |
| 36 | +---------------------------------+-------+---------+----------+-----+ |
| 37 | | onos-cli-77d589f9c7-7jzcl | 1/1 | Running | 0 | 46s | |
| 38 | +---------------------------------+-------+---------+----------+-----+ |
| 39 | | onos-config-6646dcb964-kslbs | 2/2 | Running | 0 | 46s | |
| 40 | +---------------------------------+-------+---------+----------+-----+ |
| 41 | | onos-consensus-db-1-0 | 1/1 | Running | 0 | 46s | |
| 42 | +---------------------------------+-------+---------+----------+-----+ |
| 43 | | onos-gui-dfd58b788-bkj6l | 2/2 | Running | 0 | 46s | |
| 44 | +---------------------------------+-------+---------+----------+-----+ |
| 45 | | onos-topo-6948484f46-6m6fg | 1/1 | Running | 0 | 46s | |
| 46 | +---------------------------------+-------+---------+----------+-----+ |
| 47 | | sdcore-adapter-69bff5fc45-79pld | 1/1 | Running | 0 | 47s | |
| 48 | +---------------------------------+-------+---------+----------+-----+ |
| 49 | |
| 50 | | 3. Once all pods are in a Running state, port-forward to port 8181 with the following command: |
| 51 | | ``kubectl -n micro-onos port-forward $(kubectl -n micro-onos get pods -l type=api -o name) 8181`` |
| 52 | |
| 53 | Running the tests |
| 54 | ^^^^^^^^^^^^^^^^^ |
| 55 | | 1. Checkout the aether-system-tests repo: |
| 56 | | ``git clone "ssh://$GIT_USER@gerrit.opencord.org:29418/aether-system-tests"`` |
| 57 | | 2. Go to the repo directory: |
| 58 | | ``cd aether-system-tests`` |
| 59 | | 3. Install the requirements: |
| 60 | | ``make ast-venv`` |
| 61 | | 4. The ROC API test files are located inside the ``tests/roc/api`` directory. There is a test file |
| 62 | | for each of the API end points. For example, we can run the test file for ``access-profile`` with |
| 63 | | the following command: |
| 64 | | ``robot tests/roc/api/access-profile.robot`` |
| 65 | | This will generate test reports and logs in the current directory. |