Skip to content

Commit b84c643

Browse files
authored
Update documentation about running intrusive tests (#2868)
* Update documentation about running instrusive tests because the newest version of the tooling is managed by the flag and not by env * Update documentation about running intrusive tests because the newest version of the tooling is managed by the flag and not by env * Update documentation about running intrusive tests because the newest version of the tooling is managed by the flag and not by env * Change the flag non-intrusive to intrusive and update the documentation accordingly
1 parent c2013bf commit b84c643

File tree

12 files changed

+44
-46
lines changed

12 files changed

+44
-46
lines changed

.github/workflows/tnf-image.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ env:
2727
CERTSUITE_IMAGE_NAME_LEGACY: testnetworkfunction/cnf-certification-test
2828
IMAGE_TAG: latest
2929
CERTSUITE_CONTAINER_CLIENT: docker
30-
CERTSUITE_NON_INTRUSIVE_ONLY: false
3130
CERTSUITE_ALLOW_PREFLIGHT_INSECURE: false
3231
CERTSUITE_CONFIG_DIR: /tmp/tnf/config
3332
CERTSUITE_SRC_URL: 'https://github.com/${{ github.repository }}'

cmd/certsuite/run/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func NewCommand() *cobra.Command {
3434
runCmd.PersistentFlags().String("log-level", "debug", "Sets the log level")
3535
runCmd.PersistentFlags().String("offline-db", "", "Set the location of an offline DB to check the certification status of for container images, operators and helm charts")
3636
runCmd.PersistentFlags().String("preflight-dockerconfig", "", "Set the dockerconfig file to be used by the Preflight test suite")
37-
runCmd.PersistentFlags().Bool("non-intrusive", false, "Run only the test that do not disrupt the test environment")
37+
runCmd.PersistentFlags().Bool("intrusive", true, "Run intrusive tests that may disrupt the test environment")
3838
runCmd.PersistentFlags().Bool("allow-preflight-insecure", false, "Allow insecure connections in the Preflight test suite")
3939
runCmd.PersistentFlags().Bool("include-web-files", false, "Save web files in the configured output folder")
4040
runCmd.PersistentFlags().Bool("enable-data-collection", false, "Allow sending test results to an external data collector")
@@ -67,7 +67,7 @@ func initTestParamsFromFlags(cmd *cobra.Command) error {
6767
testParams.LogLevel, _ = cmd.Flags().GetString("log-level")
6868
testParams.OfflineDB, _ = cmd.Flags().GetString("offline-db")
6969
testParams.PfltDockerconfig, _ = cmd.Flags().GetString("preflight-dockerconfig")
70-
testParams.NonIntrusiveOnly, _ = cmd.Flags().GetBool("non-intrusive")
70+
testParams.Intrusive, _ = cmd.Flags().GetBool("intrusive")
7171
testParams.AllowPreflightInsecure, _ = cmd.Flags().GetBool("allow-preflight-insecure")
7272
testParams.IncludeWebFilesInOutputFolder, _ = cmd.Flags().GetBool("include-web-files")
7373
testParams.EnableDataCollection, _ = cmd.Flags().GetBool("enable-data-collection")

docs/cluster-deploy/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ But there are the three example of modifications included in [./kustomization.ya
4444

4545
1. The namespace and the prefix/suffix of each resource's name. By default, the [./certsuite.yaml](certsuite.yaml) uses the namespace "certsuite" to deploy all the reources (except the cluster role and the cluster role binding), but this can be changed uncommenting the line that starts with `namespace:`. It's highly recommended to uncomment at least one of suffixName/prefixName so unique cluster role & cluster role-bindings can be created for each CertSuite Pod. This way, you could run more than one CertSuite Pod in the same cluster!.
4646
2. The (ginkgo) labels expression, in case you want to run different test cases. Uncomment the object that starts with "patches:". The commented example changes the command to use the "preflight" label only.
47-
3. The value of the CERTSUITE_NON_INTRUSIVE_ONLY env var. Uncomment the last object that starts with "patches:". The commented example changes the CERTSUITE_NON_INTRUSIVE_ONLY to false, so all the intrusive TCs will run in case the lifecycle TCs are selected to run by the appropriate labels.
47+
3. Configuring the --intrusive Flag. Uncomment the last object that starts with "patches:". The commented example changes the --intrusive to true, so all the intrusive TCs will run in case the lifecycle TCs are selected to run by the appropriate labels.
4848

4949
In case both (1) and (2) wants to be used, just create a list of patches like this:
5050

@@ -65,6 +65,7 @@ patches:
6565
name: certsuite
6666
patch: |
6767
- op: replace
68-
path: /spec/containers/0/env/0/value
69-
value: false
68+
path: /spec/containers/0/args/1
69+
value: |
70+
./certsuite run -l 'preflight' --intrusive=true ; sleep inf
7071
```

docs/cluster-deploy/certsuite.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,13 @@ spec:
127127
args:
128128
- "-c"
129129
- |
130-
./certsuite run -l '!affiliated-certification-container-is-certified-digest && !access-control-security-context' ; sleep inf
130+
./certsuite run -l '!affiliated-certification-container-is-certified-digest && !access-control-security-context' --intrusive=false ; sleep inf
131131
volumeMounts:
132132
- name: config-volume
133133
mountPath: /usr/certsuite/config
134134
- name: preflight-dockerconfig
135135
mountPath: /usr/certsuite/config/preflight
136136
env:
137-
- name: CERTSUITE_NON_INTRUSIVE_ONLY
138-
value: "true"
139137
- name: CERTSUITE_ALLOW_PREFLIGHT_INSECURE
140138
value: "true"
141139
- name: CERTSUITE_LOG_LEVEL

docs/cluster-deploy/kustomization.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ kind: Kustomization
44

55
resources:
66
- certsuite.yaml
7-
87
# Uncomment the next line (namespace transformer) to deploy all the certsuite related
98
# resources in a different namespace.
109
# namespace: my-custom-ns-name
@@ -34,5 +33,6 @@ resources:
3433
# name: certsuite
3534
# patch: |
3635
# - op: replace
37-
# path: /spec/containers/0/env/0/value
38-
# value: false
36+
# path: /spec/containers/0/args/1
37+
# value: |
38+
# ./certsuite.sh -l '!affiliated-certification-container-is-certified-digest && !access-control-security-context' --intrusive=true ; sleep inf

docs/developers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ To test the newly added test / existing tests locally, follow the steps
1515
1616
- Also, skip intrusive tests
1717
18-
```shell
19-
export CERTSUITE_NON_INTRUSIVE_ONLY=true
20-
```
18+
```shell
19+
./certsuite run --intrusive=false
20+
```
2121

2222
- Set K8s config of the cluster where test pods are running
2323

docs/runtime-env.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,6 @@ oc label namespace/default pod-security.kubernetes.io/enforce=privileged
2020
oc label namespace/default pod-security.kubernetes.io/enforce-version=latest
2121
```
2222

23-
## Disable intrusive tests
24-
25-
To skip intrusive tests which may disrupt cluster operations, issue the
26-
following:
27-
28-
```shell
29-
export CERTSUITE_NON_INTRUSIVE_ONLY=true
30-
```
31-
32-
The intrusive test cases are:
33-
34-
- [lifecycle-deployment-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-deployment-scaling)
35-
- [lifecycle-statefulset-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-statefulset-scaling)
36-
- [lifecycle-crd-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-crd-scaling)
37-
- [lifecycle-pod-recreation](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-pod-recreation)
38-
39-
Likewise, to enable intrusive tests, set the following:
40-
41-
```shell
42-
export CERTSUITE_NON_INTRUSIVE_ONLY=false
43-
```
44-
45-
Intrusive tests are enabled by default.
46-
4723
## Preflight Integration
4824

4925
When running the `preflight` suite of tests, there are a few environment variables that

docs/test-run.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,30 @@ To view which test cases will run for a specific label or label filter use the f
4848

4949
See the [CATALOG.md](CATALOG.md) to find all test labels.
5050

51+
## Disable intrusive tests
52+
53+
To skip intrusive tests which may disrupt cluster operations, issue the
54+
following:
55+
56+
```shell
57+
./certsuite run --intrusive=false
58+
```
59+
60+
The intrusive test cases are:
61+
62+
* [lifecycle-deployment-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-deployment-scaling)
63+
* [lifecycle-statefulset-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-statefulset-scaling)
64+
* [lifecycle-crd-scaling](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-crd-scaling)
65+
* [lifecycle-pod-recreation](https://github.com/redhat-best-practices-for-k8s/certsuite/blob/main/CATALOG.md#lifecycle-pod-recreation)
66+
67+
Likewise, to enable intrusive tests, set the following:
68+
69+
```shell
70+
./certsuite run --intrusive=true
71+
```
72+
73+
Intrusive tests are enabled by default.
74+
5175
## Selected flags description
5276

5377
The following is a non-exhaustive list of the most common flags that the `certsuite run` command accepts. To see the complete list use the `-h, --help` flag.

pkg/configuration/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ type TestParameters struct {
125125
SanitizeClaim bool
126126
CertSuiteImageRepo string
127127
CertSuiteProbeImage string
128-
NonIntrusiveOnly bool
128+
Intrusive bool
129129
AllowPreflightInsecure bool
130130
IncludeWebFilesInOutputFolder bool
131131
OmitArtifactsZipFile bool

pkg/provider/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ func (env *TestEnvironment) SetNeedsRefresh() {
579579
}
580580

581581
func (env *TestEnvironment) IsIntrusive() bool {
582-
return !env.params.NonIntrusiveOnly
582+
return env.params.Intrusive
583583
}
584584

585585
func (env *TestEnvironment) IsPreflightInsecureAllowed() bool {

0 commit comments

Comments
 (0)