Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions integration/proxy/teleterm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func testGatewayCertRenewal(t *testing.T, pack *dbhelpers.DatabasePack, creds *h
require.NoError(t, err)

tshdEventsClient := &mockTSHDEventsClient{
t: t,
tc: tc,
pack: pack,
callCounts: make(map[string]int),
Expand Down Expand Up @@ -145,7 +144,8 @@ func testGatewayCertRenewal(t *testing.T, pack *dbhelpers.DatabasePack, creds *h
TTL: -time.Hour,
})
require.NoError(t, err)
helpers.SetupUserCreds(tc, pack.Root.Cluster.Config.Proxy.SSHAddr.Addr, *expiredCreds)
err = helpers.SetupUserCreds(tc, pack.Root.Cluster.Config.Proxy.SSHAddr.Addr, *expiredCreds)
require.NoError(t, err)

// Open a new connection.
// This should trigger the relogin flow. The middleware will notice that the db cert has expired
Expand All @@ -172,7 +172,6 @@ func testGatewayCertRenewal(t *testing.T, pack *dbhelpers.DatabasePack, creds *h
}

type mockTSHDEventsClient struct {
t *testing.T
tc *libclient.TeleportClient
pack *dbhelpers.DatabasePack
callCounts map[string]int
Expand All @@ -186,8 +185,13 @@ func (c *mockTSHDEventsClient) Relogin(context.Context, *api.ReloginRequest, ...
Process: c.pack.Root.Cluster.Process,
Username: c.pack.Root.User.GetName(),
})
require.NoError(c.t, err)
helpers.SetupUserCreds(c.tc, c.pack.Root.Cluster.Config.Proxy.SSHAddr.Addr, *creds)
if err != nil {
return nil, trace.Wrap(err)
}
err = helpers.SetupUserCreds(c.tc, c.pack.Root.Cluster.Config.Proxy.SSHAddr.Addr, *creds)
if err != nil {
return nil, trace.Wrap(err)
}

return &api.ReloginResponse{}, nil
}
Expand Down