Bren Santos | 40966f3 | 2022-03-09 18:36:01 -0800 | [diff] [blame] | 1 | System Testing |
| 2 | ============== |
| 3 | |
| 4 | The Aether system is tested using Robot Framework. |
| 5 | The tests are located inside the aether-system-tests repository and they are run nightly using a Jenkins job. |
| 6 | |
| 7 | Test Structure |
| 8 | -------------- |
| 9 | |
| 10 | At a high level, functional tests are ran by: |
| 11 | |
| 12 | - Configuring ROC with various slices required for tests using pre-defined input data. |
| 13 | - ROC updates using pre-defined input data with patch updates built with the test framework. |
| 14 | - Control plane and data plane validated using NG40. |
| 15 | |
| 16 | 5G |
| 17 | --- |
| 18 | Functional testing includes multiple slice creations, enable/disable of device groups, |
| 19 | QoS validations, rate limiting tests (at UE, slice, application), application filtering tests, container restart tests. |
| 20 | |
| 21 | 4G |
| 22 | --- |
| 23 | Functional testing includes multiple slice creations, enable/disable of device groups, |
| 24 | QoS validations, rate limiting tests (at UE, slice, application), application filtering tests, container restart tests. |
| 25 | |
| 26 | Development Prerequisites |
| 27 | ------------------------- |
| 28 | |
| 29 | Deploying each component is done with the use of Helm. |
| 30 | Instructions can be found on `this page <https://docs.onosproject.org/onos-docs/docs/content/developers/deploy_with_helm/>`_. |
| 31 | |
| 32 | The following steps are needed to deploy the Aether system: |
| 33 | |
| 34 | - If applicable, remove ROC, CRDs, and other resources. Fetch Kubernetes config. |
| 35 | - Deploy SD-Core components |
| 36 | - Deploy SD-Fabric components |
| 37 | - Deploy ROC |
| 38 | - Wait for pods to be up |
| 39 | - Sync with SD-Core adapter |
| 40 | |
| 41 | Running Tests |
| 42 | ------------- |
| 43 | |
| 44 | System tests are executed in the following Jenkins views: |
| 45 | |
| 46 | `Automated Test Jobs (Nightly) <https://jenkins.aetherproject.org/view/Aether%20System%20Tests/>`_ |
| 47 | |
| 48 | Tests are executed in the following order after deployment: |
| 49 | |
| 50 | - Functional |
| 51 | - Failure/Restart |
| 52 | - Cleanup |
| 53 | |
| 54 | Test Setup |
| 55 | ---------- |
| 56 | |
| 57 | .. code-block:: shell |
| 58 | |
| 59 | # Set up virtual environment |
| 60 | cd aether-system-tests/ |
| 61 | make ast-venv |
| 62 | source ast-venv/bin/activate; set -u; |
| 63 | |
| 64 | Running Tests (4G) |
| 65 | ------------------ |
| 66 | |
| 67 | Functional, Failure/Restart, and Cleanup are executed similarly. |
| 68 | Replace `${TEST_FILE}` with the test file to execute. |
| 69 | This runs all tests in the suite. Add `-i ${TEST_TAG}` to robot arguments to run a specific test case. |
| 70 | |
| 71 | .. code-block:: shell |
| 72 | |
| 73 | cd ${WORKSPACE_DIR} |
| 74 | robot -d ${WORKSPACE_DIR}/${TEST_TYPE}/robotlogs \ |
| 75 | --debugfile ${WORKSPACE_DIR}/functionality/robotlogs/${TEST_FILE}_debug \ |
| 76 | -o ${log_xml} \ |
| 77 | -l ${log_html} \ |
| 78 | -r ${report_html} \ |
| 79 | -e notready \ |
| 80 | -v ACC_CONTEXT:${accContext} \ |
| 81 | -v AMP_CONTEXT:${rocContext} \ |
| 82 | -v ACE_CONTEXT:${aceContext} \ |
| 83 | -v UPF_NAMESPACE:${upfNamespace} \ |
| 84 | -v UPF_NAMESPACE2:${upfNamespace2} \ |
| 85 | -v UPF_NAMESPACE3:${upfNamespace3} \ |
| 86 | -v PFCP_NAMESPACE:${pfcpNamespace} \ |
| 87 | -v CORE_TYPE:${coreType} \ |
| 88 | -v UPF_TYPE:${upfType} \ |
| 89 | -v UPF_TYPE_NAME:${upfTypeName}\ |
| 90 | -v NG40_HOST:${ng40Host} \ |
| 91 | -v NG40_USER:${ng40User} \ |
| 92 | -v NG40RAN_DIR:${ng40RanDir} \ |
| 93 | -v NG40TEST_DIR:${ng40TestDir} \ |
| 94 | -v CSV_DIR:${ng40CsvDir} \ |
| 95 | -v PCAP_DIR:${WORKSPACE_DIR}/functionality/${pcapDir} \ |
| 96 | -v NG40_LOG_DIR:${WORKSPACE_DIR}/functionality/${ng40LogDir} \ |
| 97 | -v CDR_LOG_DIR:${WORKSPACE_DIR}/functionality/${cdrLogDir} \ |
| 98 | -v CONTAINER_LOG_DIR:${WORKSPACE_DIR}/functionality/${containerLogDir} \ |
| 99 | -v POD_NAME:${pod} \ |
| 100 | aether-system-tests/system-tests/tests/4G/functional/${TEST_FILE}.robot || true |
| 101 | |
| 102 | Variables |
| 103 | --------- |
| 104 | |
| 105 | | `${WORKSPACE_DIR}` - Current workspace directory for Aether System Tests. Used for output logs and PCAPs. |
| 106 | | `${TEST_TYPE}` - Directories for logs for each test type Ex: functional, failure, cleanup. |
| 107 | | `${accContext}` - SD-Core context. |
| 108 | | `${rocContext}` - ROC context. |
| 109 | | `${aceContext}` - SD-Fabric and UPF context. |
| 110 | | `${upfNamespace}` - UPF namespace used in tests. Ex: `aether-sdcore-upf1`. |
| 111 | | `${pfcpNamespace}` - PFCP namespace used in tests. Ex: `tost`. |
| 112 | | `${coreType}` - 4G or 5G. |
| 113 | | `${upfType}` - UPF type used in tests. Ex: `bess`. Can also be `${None}` or empty. |
| 114 | | `${upfTypeName}` - UPF type name used in tests. |
| 115 | This affects which input files are used. Ex: `p4`. |
| 116 | Can also be `${None}` or empty. |
| 117 | | `${ng40Host}` - IP address for NG40 host. |
| 118 | | `${ng40User}` - NG40 User. |
| 119 | | `${ng40RanDir}` - NG40. RAN directory. |
| 120 | | `${ng40CsvDir}` - NG40 CSV directory. |
| 121 | | `${ng40TestDir}` - NG40 tests directory. |
| 122 | | `${pcapDir}` - Saved PCAP directory. |
| 123 | | `${cdrLogDir}` - NG40 CDR directory. |
| 124 | | `${containerLogDir}` - Log directory for each deployed component. |
| 125 | | `${pod}` - Pod name used in tests. This affects which input files are used. Ex: `qa`, `qa2`. |
| 126 | |
| 127 | Running Tests (5G) |
| 128 | ------------------ |
| 129 | 5G tests are executed similar to 4G, except using the tests located in the 5G directory. |
| 130 | |
| 131 | .. code-block:: shell |
| 132 | |
| 133 | cd ${WORKSPACE_DIR} |
| 134 | robot -d ${WORKSPACE_DIR}/${TEST_TYPE}/robotlogs \ |
| 135 | --debugfile ${WORKSPACE_DIR}/functionality/robotlogs/${TEST_FILE}_debug \ |
| 136 | -o ${log_xml} \ |
| 137 | -l ${log_html} \ |
| 138 | -r ${report_html} \ |
| 139 | -e notready \ |
| 140 | -v ACC_CONTEXT:${accContext} \ |
| 141 | -v AMP_CONTEXT:${rocContext} \ |
| 142 | -v ACE_CONTEXT:${aceContext} \ |
| 143 | -v UPF_NAMESPACE:${upfNamespace} \ |
| 144 | -v UPF_NAMESPACE2:${upfNamespace2} \ |
| 145 | -v UPF_NAMESPACE3:${upfNamespace3} \ |
| 146 | -v PFCP_NAMESPACE:${pfcpNamespace} \ |
| 147 | -v CORE_TYPE:${coreType} \ |
| 148 | -v UPF_TYPE:${upfType} \ |
| 149 | -v UPF_TYPE_NAME:${upfTypeName}\ |
| 150 | -v NG40_HOST:${ng40Host} \ |
| 151 | -v NG40_USER:${ng40User} \ |
| 152 | -v NG40RAN_DIR:${ng40RanDir} \ |
| 153 | -v NG40TEST_DIR:${ng40TestDir} \ |
| 154 | -v CSV_DIR:${ng40CsvDir} \ |
| 155 | -v PCAP_DIR:${WORKSPACE_DIR}/functionality/${pcapDir} \ |
| 156 | -v NG40_LOG_DIR:${WORKSPACE_DIR}/functionality/${ng40LogDir} \ |
| 157 | -v CDR_LOG_DIR:${WORKSPACE_DIR}/functionality/${cdrLogDir} \ |
| 158 | -v CONTAINER_LOG_DIR:${WORKSPACE_DIR}/functionality/${containerLogDir} \ |
| 159 | -v POD_NAME:${pod} \ |
| 160 | aether-system-tests/system-tests/tests/5G/functional/${TEST_FILE}.robot || true |
| 161 | |