|
1 | 1 | ## How to run these End-to-end (e2e) tests |
2 | 2 |
|
3 | | -Install the following packages (macOS examples) |
4 | | - |
5 | | -``` |
6 | | -brew install terraform |
7 | | -brew install kubectl |
8 | | -brew install hg |
9 | | -brew install golang |
10 | | -``` |
11 | | - |
12 | | -Add the following environment variables to your shell rc |
13 | | - |
14 | | -``` |
15 | | -export LINODE_API_TOKEN=<your linode API token> |
16 | | -
|
17 | | -export GOPATH=$HOME/go |
18 | | -export PATH=$HOME/go/bin:$PATH |
19 | | -export GO111MODULE=on |
20 | | -``` |
21 | | - |
22 | | -If you need a Linode API token visit this page: |
23 | | -https://cloud.linode.com/profile/tokens |
24 | | - |
25 | | -Then, `go get` this repo |
26 | | -`go get github.com/linode/linode-cloud-controller-manager` |
27 | | - |
28 | | -That may fail, if it does, navigate to the directory that was created and run `go mod tidy`: |
29 | | - |
30 | | -``` |
31 | | -cd ~/go/src/github.com/linode/linode-cloud-controller-manager |
32 | | -go mod tidy |
33 | | -``` |
34 | | - |
35 | | -Then, use the makefile in the directory above this directory to build the CCM (this is to download goimports) |
36 | | - |
37 | | -``` |
38 | | -cd $GOPATH/src/github.com/linode/linode-cloud-controller-manager |
39 | | -make build |
40 | | -``` |
41 | | - |
42 | | -By default the tests use $HOME/.ssh/id\_rsa.pub as the public key used to provision the cluster, so it needs to be added to your agent. |
43 | | - |
44 | | -``` |
45 | | -ssh-add $HOME/.ssh/id_rsa |
46 | | -``` |
47 | | - |
48 | | -Come back here and run the tests |
49 | | - |
50 | | -``` |
51 | | -cd e2e |
52 | | -make test |
53 | | -``` |
54 | | - |
55 | | -To save time on multiple runs by allowing the cluster to remain, use `make reuse-and-test` |
56 | | - |
57 | | -### Generating a new server certificate for testing |
58 | | - |
59 | | -Some of the tests require a secret containing a TLS certificate, for use in creating or updating a NodeBalancer config using TLS. A CA certificate and server certificate can be found in the `test/certificates` directory. The server certificate, used for TLS NodeBalancer configs, has an expiry of 4 years. You can use the following command to generate a new TLS certificate, using the existing CSR: |
60 | | - |
61 | | -``` |
62 | | -openssl x509 -req -in test/certificates/server.csr -CA test/certificates/ca.crt -CAkey test/certificates/ca.key -CAcreateserial -out test/certificates/server.crt -days 1440 -sha256 -extfile <(printf "subjectAltName=DNS:linode.test,DNS:www.linode.test") |
63 | | -``` |
64 | | -Once a new cert is generated, you will need to replace the existing constants, "serverCert" and "serverKey", in test/framework/secret.go. |
| 3 | +TBD: the way we run these e2e tests has recently changed, there is currently |
| 4 | +no convenient way to run these with no pre-existing clusters. |
0 commit comments