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
Copy file name to clipboardExpand all lines: e2e/README.md
+83-14Lines changed: 83 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,26 @@ The test suite does the following:
13
13
This is currently configured as a Bash script, so it is necessary to run this on a UNIX-compatible machine.
14
14
15
15
## Requirements
16
-
- An available Command instance is running and configured as described in the [root README](../README.md#configuring-command)
17
-
- OAuth is used to communicate with Command
16
+
17
+
**Local tools:**
18
18
- Docker (>= 28.2.2)
19
-
- Minikube (>= v1.35.0)
20
19
- kubectl (>= v1.32.2)
21
20
- helm (>= v3.17.1)
22
21
- cmctl (>= v2.1.1)
22
+
- Minikube (>= v1.35.0) - only required if using `USE_MINIKUBE=true`
23
+
24
+
**Kubernetes cluster:**
25
+
- By default, tests run against your current kubeconfig context
26
+
- Set `USE_MINIKUBE=true` to use minikube instead
23
27
24
-
On the Command side:
25
-
- An enrollment pattern is created called "Test Enrollment Pattern" that is has CSR Enrollment, CSR Generation, and PFX Enrollment enabled
26
-
- A security role by the name of "InstanceOwner" exists and has the ability to perform Enrollment
28
+
**Command instance:**
29
+
- An available Command instance configured as described in the [root README](../README.md#configuring-command)
30
+
- OAuth credentials for API access
31
+
- An enrollment pattern (default: "Default Pattern") with CSR Enrollment enabled
32
+
- A security role (default: "InstanceOwner") with Enrollment permissions
27
33
28
34
## Configuring the environment variables
35
+
29
36
command-cert-manager-issuer interacts with an external Command instance. An environment variable file `.env` can be used to store the environment variables to be used to talk to the Command instance.
30
37
31
38
A `.env.example` file is available as a template for your environment variables.
@@ -35,24 +42,86 @@ A `.env.example` file is available as a template for your environment variables.
35
42
cp .env.example .env
36
43
```
37
44
38
-
Modify the fields as needed.
45
+
### Required variables
46
+
47
+
| Variable | Description |
48
+
|----------|-------------|
49
+
|`HOSTNAME`| Command instance hostname |
50
+
|`API_PATH`| API path (default: `KeyfactorAPI`) |
51
+
|`OAUTH_TOKEN_URL`| OAuth token endpoint URL |
52
+
|`OAUTH_CLIENT_ID`| OAuth client ID |
53
+
|`OAUTH_CLIENT_SECRET`| OAuth client secret |
54
+
|`CERTIFICATE_TEMPLATE`| Certificate template short name |
55
+
|`CERTIFICATE_AUTHORITY_LOGICAL_NAME`| CA logical name in Command |
56
+
57
+
### Optional variables
58
+
59
+
| Variable | Description | Default |
60
+
|----------|-------------|---------|
61
+
|`IMAGE_TAG`| Docker image version to test |`2.5.0`|
62
+
|`HELM_CHART_VERSION`| Helm chart version |`2.5.0`|
63
+
|`E2E_ENROLLMENT_PATTERN_NAME`| Enrollment pattern name |`Default Pattern`|
64
+
|`E2E_OWNER_ROLE_NAME`| Owner role name |`InstanceOwner`|
65
+
|`DISABLE_CA_CHECK`| Skip TLS CA verification |`false`|
66
+
|`USE_MINIKUBE`| Use minikube instead of current kubeconfig |`false`|
67
+
|`IMAGE_REGISTRY`| Registry to push local builds (when `IMAGE_TAG=local`) | - |
39
68
40
69
## Configuring the trusted certificate store
70
+
41
71
The issuer created in the end-to-end tests can leverage the `caSecretName` specification to determine a collection of CAs to trust in order to establish a trusted connection with the remote Keyfactor Command instance. The certificates defined in this secret will be pulled from the `certs` folder in this directory.
42
72
43
-
Please place the CA certificates for the Keyfactor Command instance you'd like to connect to (the intermediate and/or root CAs) under `certs` directory.
73
+
Place the CA certificates for the Keyfactor Command instance you'd like to connect to (the intermediate and/or root CAs) under `certs` directory.
44
74
45
75
> NOTE: This check can be disabled by setting the env variable `DISABLE_CA_CHECK=true`.
46
76
47
-
## Running the script
77
+
## Running the tests
78
+
79
+
### Using current kubeconfig context (default)
48
80
49
81
```bash
50
-
#enable the script to be executed
51
-
chmod +x ./run_tests.sh
82
+
#Configure your .env file first
83
+
source .env
52
84
53
-
# load the environment variables
85
+
# Run the tests
86
+
./run_tests.sh
87
+
```
88
+
89
+
Or from the project root:
90
+
```bash
91
+
make test-e2e
92
+
```
93
+
94
+
### Using minikube
95
+
96
+
```bash
97
+
export USE_MINIKUBE=true
54
98
source .env
99
+
./run_tests.sh
100
+
```
101
+
102
+
### Testing a specific version
103
+
104
+
```bash
105
+
export IMAGE_TAG="2.4.0"
106
+
export HELM_CHART_VERSION="2.4.0"
107
+
source .env
108
+
./run_tests.sh
109
+
```
55
110
56
-
# run the end-to-end tests
111
+
### Testing local changes
112
+
113
+
```bash
114
+
# With minikube (image built directly into minikube's docker)
115
+
export IMAGE_TAG="local"
116
+
export HELM_CHART_VERSION="local"
117
+
export USE_MINIKUBE=true
118
+
source .env
57
119
./run_tests.sh
58
-
```
120
+
121
+
# With a remote cluster (requires pushing to a registry)
0 commit comments