You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article describes how Azure Operator Service Manager (AOSM) can run tests on deployed network functions (NFs) as part install or upgrade operations. When enabled, each network function application (nfApp) will be tested after install or upgrade completion. A successful result across all nfApp tests is required for the NF operation status to complete successfully.
12
+
This article describes how Azure Operator Service Manager (AOSM) can run tests on network functions (NFs) as part of install or upgrade operations. When enabled, each network function application (nfApp) is tested after component install or upgrade completion. A successful result across all nfApp tests is required for the NF operation status to complete successfully.
13
13
14
14
## Overview
15
-
This feature's scope is to run helm tests as part of the network function install or upgrade operations.
15
+
As part of the safe upgrade program, AOSM supports the use of helm tests as a gating step during network function install or upgrade operations. The following workflow describes the logic used by AOSM when including this extra layer of validation:
16
16
* Users author their own tests and include them within the helm package during NF onboarding.
17
17
* Only where enabled, AOSM executes these helm tests on each nfApp.
18
18
* Upon test success, AOSM proceeds to the next nfApp.
19
-
* Upon test failure, AOSM honors `RollbackOnTestFail` flag to determine if the nfApp is rolled back.
19
+
* Upon test failure, AOSM honors `rollbackOnTestFail` to determine if the nfApp is rolled back.
20
20
* The parent NF operation terminates with failure if any nfApp fails a configured test.
21
21
* Upon parent failure, AOSM honors the configured method of NF failure control, either `pause-on-failure` or `rollback-on-failure`.
22
22
23
23
> [!NOTE]
24
-
> *Helm Test is only supported as part of the install or upgrade operation and can't be run separately.
24
+
> Helm test is only supported as part of the install or upgrade operation and can't be run standalone.
25
25
26
26
## Authoring helm tests
27
27
The publisher is responsible for authoring the helm tests during construction of the helm charts. The helm tests are defined in the helm chart under the folder: `<ChartName>/Templates/`. Each test includes a job definition that specifies a container environment and command to run. The container environment should exit successfully for a test to be considered a success. The job definition must include the helm test hook annotation `(helm.sh/hook: test)` to be recognized as a test by helm.
28
28
29
29
## Enable helm tests during operations
30
-
AOSM provides a set of configurable install and upgrade options for each component under an NF. These existing options are extended with a new `testOptions` parameter. This parameter gives the user the ability to specify `testOptions` per nfApp and as per the type of operation. The `testOptions`feature supports the following parameters:
30
+
AOSM provides a set of configurable install and upgrade options for each nfApp. These existing options are extended with a new `testOptions` parameter. With this parameter the user can specify `testOptions`settings per nfApp and per type of operation. The `testOptions`parameter supports the following parameters:
31
31
32
32
* enable
33
33
* Enables or disables the helm test on a nfApp after install or upgrade completes.
@@ -36,25 +36,26 @@ AOSM provides a set of configurable install and upgrade options for each compone
36
36
* Takes a value that represents the test time-out in minutes.
37
37
* Default value is 20 minutes.
38
38
* rollbackOnTestFailure
39
-
* Enables or disables component rollback on helm test failure.
39
+
* Enables or disables rollback on nfApp helm test failure.
40
40
* Default value is true.
41
41
* filter
42
-
* Allows for a method to run only a subset of chart tests. Accepts a list of strings where each string in the list represents a test name to include.
43
-
* Default value is no filter.
42
+
* Allows for a method to run only a subset of tests. Accepts a list of strings, where each string in the list represents a test to execute.
43
+
* Default value is no filter and all tests are run.
44
44
45
45
## Exposing helm test control via parameters
46
-
Users already can use the NF payload parameter `roleOverrideValues` to specify settings for `installOptions` and `upgradeOptions`. These fields are now extended to include settings for `testOptions`which can be specified for each nfApplication and each operation method. See the following example of `roleOverrideValues` usage where the NF Payload defines `installOptions` and `upgradeOptions` including `testOptions` for a component named `application1`.
46
+
AOSM already supports the NF payload parameters `installOptions` and `upgradeOptions`for each nfApp under `roleOverrideValues`. These parameters are extended to include new `testOptions`settings. Exposing these new parameter settings allows the Operator to control the upgrade behavior at run-time. See the three following examples demonstrating usage of `testOptions`.
47
47
48
-
## roleOverrideValues escaped example:
49
-
Following is an escaped example `roleOverrideValues` with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter` to execute only tests which match the string provided.
48
+
## roleOverrideValues escaped example
49
+
Following is an escaped example `roleOverrideValues` with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter`, to execute only tests which match the string provided, uses a custom time-out and enables `rollbackOnTestFailures`.
Following is an unescaped example `roleOverrideValues` NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `hellotest`. This example uses a `filter` to execute only those test which match the string provided.
56
+
## roleOverrideValues unescaped example
57
+
Following is an unescaped example `roleOverrideValues` NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `hellotest`. This example uses a `filter` to execute only tests which match the string provided, uses a custom time-out and enables `rollbackOnTestFailures`.
58
+
58
59
```
59
60
"roleOverrideValues": ["{
60
61
"name":"hellotest",
@@ -65,25 +66,25 @@ Following is an unescaped example `roleOverrideValues` NF Payload with `testOpti
65
66
"atomic":"true",
66
67
"wait":"true",
67
68
"timeout":"1"
68
-
“testOptions”: {
69
-
“enable”: “true”,
70
-
“timeout”: “10”,
71
-
“rollbackOnTestFailure”: “true”,
72
-
"filter”: [“test1”, “test2”] } },
69
+
“testOptions”: {
70
+
“enable”: “true”,
71
+
“timeout”: “10”,
72
+
“rollbackOnTestFailure”: “true”,
73
+
"filter”: [“test1”, “test2”] } },
73
74
"upgradeOptions": {
74
75
"atomic":"true",
75
76
"wait":"true",
76
77
"timeout":"2",
77
-
“testOptions”: {
78
-
“enable”: “true”,
79
-
“timeout”: “10”,
80
-
“rollbackOnTestFailure”: “true”,
81
-
"filter”: [“test1”, “test2”] } } } } } }"
78
+
“testOptions”: {
79
+
“enable”: “true”,
80
+
“timeout”: “10”,
81
+
“rollbackOnTestFailure”: “true”,
82
+
"filter”: [“test1”, “test2”] } } } } } }"
82
83
]
83
84
```
84
85
85
86
## NF payload example
86
-
Following is an example NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter` to execute only those test which match the string provided.
87
+
Following is an example NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter` to execute only tests which match the string provided, uses a custom time-out and enables `rollbackOnTestFailures`.
0 commit comments