Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions tool/tsh/app_azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ func makeUserWithAzureRole(t *testing.T) (types.User, types.Role) {
}

func Test_getAzureIdentityFromFlags(t *testing.T) {
t.Parallel()

tests := []struct {
name string
requestedIdentity string
Expand Down Expand Up @@ -441,6 +443,8 @@ func Test_getMSISecret(t *testing.T) {
}

func Test_formatAzureIdentities(t *testing.T) {
t.Parallel()

tests := []struct {
name string
identities []string
Expand Down
2 changes: 2 additions & 0 deletions tool/tsh/app_cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
)

func Test_filterApps(t *testing.T) {
t.Parallel()

tests := []struct {
name string
matchRouteToApp func(tlsca.RouteToApp) bool
Expand Down
4 changes: 4 additions & 0 deletions tool/tsh/app_gcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
)

func Test_getGCPServiceAccountFromFlags(t *testing.T) {
t.Parallel()

tests := []struct {
name string
requestedServiceAccount string
Expand Down Expand Up @@ -139,6 +141,8 @@ func Test_getGCPServiceAccountFromFlags(t *testing.T) {
}

func Test_formatGCPServiceAccounts(t *testing.T) {
t.Parallel()

tests := []struct {
name string
accounts []string
Expand Down
6 changes: 6 additions & 0 deletions tool/tsh/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ func TestListDatabase(t *testing.T) {
}

func TestFormatDatabaseListCommand(t *testing.T) {
t.Parallel()

t.Run("default", func(t *testing.T) {
require.Equal(t, "tsh db ls", formatDatabaseListCommand(""))
})
Expand All @@ -395,6 +397,8 @@ func TestFormatDatabaseListCommand(t *testing.T) {
}

func TestFormatConfigCommand(t *testing.T) {
t.Parallel()

db := tlsca.RouteToDatabase{
ServiceName: "example-db",
}
Expand All @@ -409,6 +413,8 @@ func TestFormatConfigCommand(t *testing.T) {
}

func TestDBInfoHasChanged(t *testing.T) {
t.Parallel()

tests := []struct {
name string
databaseUserName string
Expand Down
14 changes: 12 additions & 2 deletions tool/tsh/recording_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func init() {
}

func TestWriteMovieCanBeCanceled(t *testing.T) {
t.Parallel()

events := []apievents.AuditEvent{
&apievents.WindowsDesktopSessionStart{},
}
Expand All @@ -53,18 +55,20 @@ func TestWriteMovieCanBeCanceled(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()

frames, err := writeMovie(ctx, fs, session.ID("test"), "test.avi")
frames, err := writeMovie(ctx, fs, "test", "test.avi")
require.Equal(t, context.Canceled, err)
require.Equal(t, 0, frames)
}

func TestWriteMovieDoesNotSupportSSH(t *testing.T) {
t.Parallel()

events := []apievents.AuditEvent{
&apievents.SessionStart{},
}
fs := eventstest.NewFakeStreamer(events, 0)

frames, err := writeMovie(context.Background(), fs, session.ID("test"), "test.avi")
frames, err := writeMovie(context.Background(), fs, "test", "test.avi")
require.True(t, trace.IsBadParameter(err), "expected bad paramater error, got %v", err)
require.Equal(t, 0, frames)
}
Expand All @@ -75,6 +79,8 @@ func TestWriteMovieDoesNotSupportSSH(t *testing.T) {
// At the time of this implementation, desktop access does not support resizing during the
// screen during a session. This test exists to prevent regressions should that behavior change.
func TestWriteMovieMultipleScreenSpecs(t *testing.T) {
t.Parallel()

events := []apievents.AuditEvent{
tdpEvent(t, tdp.ClientScreenSpec{Width: 1920, Height: 1080}),
tdpEvent(t, tdp.ClientScreenSpec{Width: 1920, Height: 1080}),
Expand All @@ -88,6 +94,8 @@ func TestWriteMovieMultipleScreenSpecs(t *testing.T) {
}

func TestWriteMovieWritesOneFrame(t *testing.T) {
t.Parallel()

oneFrame := frameDelayMillis
// need a PNG that will actually decode
events := []apievents.AuditEvent{
Expand All @@ -103,6 +111,8 @@ func TestWriteMovieWritesOneFrame(t *testing.T) {
}

func TestWriteMovieWritesManyFrames(t *testing.T) {
t.Parallel()

events := []apievents.AuditEvent{
tdpEventMillis(t, tdp.ClientScreenSpec{Width: 128, Height: 128}, 0),
tdpEventMillis(t, tdp.PNG2Frame(pngFrame), 0),
Expand Down
6 changes: 6 additions & 0 deletions tool/tsh/tshconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ func TestLoadAllConfigs(t *testing.T) {
}

func TestTshConfigMerge(t *testing.T) {
t.Parallel()

sampleConfig := TshConfig{
ExtraHeaders: []ExtraProxyHeaders{{
Proxy: "foo",
Expand Down Expand Up @@ -254,6 +256,8 @@ func TestTshConfigMerge(t *testing.T) {

// TestProxyTemplatesApply verifies proxy templates matching functionality.
func TestProxyTemplatesApply(t *testing.T) {
t.Parallel()

tshConfig := TshConfig{
ProxyTemplates: ProxyTemplates{
{
Expand Down Expand Up @@ -331,6 +335,8 @@ func TestProxyTemplatesApply(t *testing.T) {

// TestProxyTemplates verifies proxy templates apply properly to client config.
func TestProxyTemplatesMakeClient(t *testing.T) {
t.Parallel()

tshConfig := TshConfig{
ProxyTemplates: ProxyTemplates{
{
Expand Down