Skip to content

Commit 96f10e1

Browse files
committed
update test
1 parent 13c3134 commit 96f10e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

agent/agentcontainers/api_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ func TestAPI(t *testing.T) {
20402040
// Verify commands were executed through the custom shell and environment.
20412041
require.NotEmpty(t, fakeExec.commands, "commands should be executed")
20422042

2043-
// Want: /bin/custom-shell -c "docker ps --all --quiet --no-trunc"
2043+
// Want: /bin/custom-shell -c '"docker" "ps" "--all" "--quiet" "--no-trunc"'
20442044
require.Equal(t, testShell, fakeExec.commands[0][0], "custom shell should be used")
20452045
if runtime.GOOS == "windows" {
20462046
require.Equal(t, "/c", fakeExec.commands[0][1], "shell should be called with /c on Windows")
@@ -2049,6 +2049,7 @@ func TestAPI(t *testing.T) {
20492049
}
20502050
require.Len(t, fakeExec.commands[0], 3, "command should have 3 arguments")
20512051
require.GreaterOrEqual(t, strings.Count(fakeExec.commands[0][2], " "), 2, "command/script should have multiple arguments")
2052+
require.True(t, strings.HasPrefix(fakeExec.commands[0][2], `"docker" "ps" "--all" "--quiet" "--no-trunc"`), "command should start with docker ps --all --quiet --no-trunc")
20522053

20532054
// Verify the environment was set on the command.
20542055
lastCmd := fakeExec.getLastCommand()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy