Skip to content

Commit

Permalink
Improve tailscale e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Buil <[email protected]>
  • Loading branch information
manuelbuil committed Mar 6, 2024
1 parent 82cfacb commit 1fe0371
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions tests/e2e/tailscale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,14 @@ Tailscale requires three steps before running the test:
```

3 - In `Settings` > `Keys`, generate an auth key which is Reusable and Ephemeral. That key should be the value of a new env variable `E2E_TAILSCALE_KEY`

# Typical problems

### The cluster does not start correctly

Please verify that the tailscale key was correctly passed to the config. To verify this, check the config in the server/agent in the file /etc/rancher/k3s/config.yaml


### The verification on the routing fails

Please verify that you filled the autoApprovers section and that the config applies to your key. If you access the tailscale UI and see that the machine has "Subnets" that require manual approval, the test will not work
1 change: 1 addition & 0 deletions tests/e2e/tailscale/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def provision(vm, roles, role_num, node_num)
k3s.config = <<~YAML
cluster-init: true
token: vagrant
tls-san: #{node_ip4}
vpn-auth: "name=tailscale,joinKey=#{TAILSCALE_KEY}"
YAML
k3s.env = ["K3S_KUBECONFIG_MODE=0644", install_type]
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tailscale/tailscale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var _ = Describe("Verify Tailscale Configuration", Ordered, func() {
for _, node := range nodes {
g.Expect(node.Status).Should(Equal("Ready"))
}
}, "620s", "5s").Should(Succeed())
}, "300s", "5s").Should(Succeed())
_, err := e2e.ParseNodes(kubeConfigFile, true)
Expect(err).NotTo(HaveOccurred())
})
Expand All @@ -85,7 +85,7 @@ var _ = Describe("Verify Tailscale Configuration", Ordered, func() {
for _, node := range nodes {
g.Expect(node.Status).Should(Equal("Ready"))
}
}, "620s", "5s").Should(Succeed())
}, "300s", "5s").Should(Succeed())
_, err := e2e.ParseNodes(kubeConfigFile, true)
Expect(err).NotTo(HaveOccurred())
})
Expand Down

0 comments on commit 1fe0371

Please sign in to comment.