1 diff --git a/shells/bash_test.go b/shells/bash_test.go
2 index 9ed9e65ff..02b6e6d5f 100644
3 --- a/shells/bash_test.go
4 +++ b/shells/bash_test.go
5 @@ -4,11 +4,9 @@ package shells
12 "github.com/stretchr/testify/assert"
13 - "github.com/stretchr/testify/require"
14 "gitlab.com/gitlab-org/gitlab-runner/common"
17 @@ -90,65 +88,6 @@ func TestBash_CheckForErrors(t *testing.T) {
21 -func TestBash_GetConfiguration(t *testing.T) {
22 - tests := map[string]struct {
23 - info common.ShellScriptInfo
29 - info: common.ShellScriptInfo{Shell: "bash", Type: common.NormalShell},
33 - info: common.ShellScriptInfo{Shell: "bash", Type: common.LoginShell},
35 - args: []string{"-l"},
37 - `su -s /bin/bash foobar -c bash`: {
38 - info: common.ShellScriptInfo{Shell: "bash", User: "foobar", Type: common.NormalShell},
40 - args: []string{"-s", "/bin/bash", "foobar", "-c", "bash"},
43 - `su -s /bin/bash foobar -c $'bash -l'`: {
44 - info: common.ShellScriptInfo{Shell: "bash", User: "foobar", Type: common.LoginShell},
46 - args: []string{"-s", "/bin/bash", "foobar", "-c", "bash -l"},
49 - `su -s /bin/sh foobar -c $'sh -l'`: {
50 - info: common.ShellScriptInfo{Shell: "sh", User: "foobar", Type: common.LoginShell},
52 - args: []string{"-s", "/bin/sh", "foobar", "-c", "sh -l"},
55 - `su foobar -c $'bash -l'`: {
56 - info: common.ShellScriptInfo{Shell: "bash", User: "foobar", Type: common.LoginShell},
58 - args: []string{"foobar", "-c", "bash -l"},
63 - for tn, tc := range tests {
64 - t.Run(tn, func(t *testing.T) {
65 - if tc.os != "" && tc.os != runtime.GOOS {
66 - t.Skipf("test only runs on %s", tc.os)
69 - sh := BashShell{Shell: tc.info.Shell}
70 - config, err := sh.GetConfiguration(tc.info)
71 - require.NoError(t, err)
73 - assert.Equal(t, tc.cmd, config.Command)
74 - assert.Equal(t, tc.args, config.Arguments)
75 - assert.Equal(t, tn, config.CmdLine)
80 func Test_BashWriter_isTmpFile(t *testing.T) {
82 bw := BashWriter{TemporaryPath: tmpDir}