Skip to content

Commit

Permalink
Modify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonAM committed Jun 1, 2023
1 parent bca65b0 commit 59fba9e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tool/tsh/tsh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1942,20 +1942,8 @@ func TestKubeCredentialsLock(t *testing.T) {
"--teleport-cluster", "teleport",
"--kube-cluster", kubeClusterName,
}, setHomePath(tmpHomePath))
require.Error(t, firstErr) // First run fails because fake proxy doesn't exist
require.Error(t, firstErr) // Fails because fake proxy doesn't exist
require.NoFileExists(t, keypaths.KubeCredLockfilePath(tmpHomePath, "fake-proxy"))

// Second run should fail for the same reason, kube cred lockfile shouldn't be created
// because we failed at a stage of creating the client.
secondErr := Run(ctx, []string{
"kube",
"credentials",
"--proxy", "fake-proxy",
"--teleport-cluster", "teleport",
"--kube-cluster", kubeClusterName,
}, setHomePath(tmpHomePath))
require.Error(t, secondErr)
require.Equal(t, firstErr.Error(), secondErr.Error())
})

t.Run("kube credentials called multiple times, SSO login called only once", func(t *testing.T) {
Expand Down Expand Up @@ -2146,6 +2134,7 @@ func TestSSHHeadless(t *testing.T) {
sshHostname := "test-ssh-server"
node := makeTestSSHNode(t, authAddr, withHostname(sshHostname), withSSHLabel("access", "true"))
sshHostID := node.Config.HostUUID

hasNodes := func(hostIDs ...string) func() bool {
return func() bool {
nodes, err := rootAuth.GetAuthServer().GetNodes(ctx, apidefaults.Namespace)
Expand Down

0 comments on commit 59fba9e

Please sign in to comment.