Skip to content

Commit a42f390

Browse files
committed
Updated e2e README with details of makefile change and new credential secret format. Removed redundant int64 cast. Clarified error message if wrong number of zones for a name found.
1 parent b995039 commit a42f390

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

test/e2e/README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,26 @@ The first step to running the e2e tests is setting up the required environment v
3333
| `CLOUDSTACK_TEMPLATE_NAME` | The machine template for both control plane and worke node VM instances | `kube-v1.20.10/ubuntu-2004` |
3434
| `CLOUDSTACK_SSH_KEY_NAME` | The name of SSH key added to the VM instances | `CAPCKeyPair6` |
3535

36-
You also have to export `CLOUDSTACK_B64ENCODED_SECRET` environment variable using this command `export CLOUDSTACK_B64ENCODED_SECRET=$(base64 -i cloud-config)` after creating `cloud-config` file with the following format.
36+
Default values for these variables are defined in *config/cloudstack.yaml*. This cloudstack.yaml can be completely overridden
37+
by providing make with the *fully qualified* path of another cloudstack.yaml via environment variable `E2E_CONFIG`
38+
39+
You will also have to define a k8s secret in a *cloud-config.yaml* file in the project root, containing a pointer to and
40+
credentials for the CloudStack backend that will be used for the test:
3741

3842
```
39-
[Global]
40-
api-key = XXXXX
41-
secret-key = XXXXX
42-
api-url = http://192.168.1.96:8080/client/api
43-
verify-ssl = true or false
43+
apiVersion: v1
44+
kind: Secret
45+
metadata:
46+
name: secret1
47+
namespace: default
48+
type: Opaque
49+
stringData:
50+
api-key: XXXX
51+
secret-key: XXXX
52+
api-url: http://1.2.3.4:8080/client/api
53+
verify-ssl: "false"
4454
```
45-
55+
This will be applied to the kind cluster that hosts CAPI/CAPC for the test, allowing CAPC to access the cluster.
4656
The api-key and secret-key can be found or generated at Home > Accounts > admin > Users > admin of the ACS management UI. `verify-ssl` is an optional flag and its default value is true. CAPC skips verifying the host SSL certificates when the flag is set to false.
4757

4858
### Running the e2e tests

test/e2e/affinity_group.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func executeTest(ctx context.Context, input CommonSpecInput, namespace *corev1.N
102102
Namespace: namespace.Name,
103103
ClusterName: fmt.Sprintf("%s-%s", specName, util.RandomString(6)),
104104
KubernetesVersion: input.E2EConfig.GetVariable(KubernetesVersion),
105-
ControlPlaneMachineCount: pointer.Int64Ptr(int64(machineCount)),
105+
ControlPlaneMachineCount: pointer.Int64Ptr(machineCount),
106106
WorkerMachineCount: pointer.Int64Ptr(machineCount),
107107
},
108108
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),

test/e2e/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ func GetHostCount(client *cloudstack.CloudStackClient, zoneName string) int {
292292
pz.SetName(zoneName)
293293
listZonesResponse, err := client.Zone.ListZones(pz)
294294
Expect(err).To(BeNil(), "error listing zones")
295-
Expect(listZonesResponse.Count).To(Equal(1), "multiple zones resolve to zone name %s", zoneName)
295+
Expect(listZonesResponse.Count).To(Equal(1), "no zones, or more than one zone resolve to zone name %s", zoneName)
296296
zoneId := listZonesResponse.Zones[0].Id
297297

298298
ph := client.Host.NewListHostsParams()

0 commit comments

Comments
 (0)