Skip to content

Commit

Permalink
test: update fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed Apr 29, 2024
1 parent a057fb7 commit e660292
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 67 deletions.
36 changes: 3 additions & 33 deletions internal/test_helpers/fixtures/fetch_from_registry/failure
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo 88398
[your_program] 88398
[stage-1] Checking if the command output was echo-ed..
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: stdio
[stage-2] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo 88398
[your_program] 88398
[stage-2] Checking if the string was echo-ed to stdout..
[stage-2] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo_stderr 28626
[your_program] 28626
[stage-2] Checking if the string was echo-ed to stderr..
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: exit_code
[stage-3] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer exit 3
[stage-3] Checking the parent process's exit code..
[stage-3] Test passed.

[stage-4] Running tests for Stage #4: fs_isolation
[stage-4] Created temp dir on host: /tmp/88398
[stage-4] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer ls /tmp/88398
[stage-4] (expecting that the directory won't be accessible)
[your_program] No such file or directory
[stage-4] Test passed.

[stage-5] Running tests for Stage #5: process_isolation
[stage-5] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer mypid
[your_program] 1
[stage-5] Test passed.

[stage-6] Running tests for Stage #6: fetch_from_registry
[stage-6] Executing: ./your_docker.sh run alpine /bin/sh -c '/bin/ls /'
[your_program] Expected 'run <image> <command>' as the command! args: ["run" "alpine" "/bin/sh" "-c" "/bin/ls /"]
[your_program] # command-line-arguments
[your_program] test_helpers/stages/process_isolation/main.go:36:4: unknown field Cloneflags in struct literal of type syscall.SysProcAttr
[your_program] test_helpers/stages/process_isolation/main.go:36:24: undefined: syscall.CLONE_NEWPID
[stage-6] Expected 0 as exit code, got: 1
[stage-6] Test failed
27 changes: 4 additions & 23 deletions internal/test_helpers/fixtures/fs_isolation/failure
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo 88398
[your_program] 88398
[stage-1] Checking if the command output was echo-ed..
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: stdio
[stage-2] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo 88398
[your_program] 88398
[stage-2] Checking if the string was echo-ed to stdout..
[stage-2] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo_stderr 28626
[your_program] 28626
[stage-2] Checking if the string was echo-ed to stderr..
[stage-2] Test passed.

[stage-3] Running tests for Stage #3: exit_code
[stage-3] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer exit 3
[stage-3] Checking the parent process's exit code..
[stage-3] Test passed.

[stage-4] Running tests for Stage #4: fs_isolation
[stage-4] Created temp dir on host: /tmp/88398
[stage-4] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer ls /tmp/88398
[stage-4] Created temp dir on host: /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/88398
[stage-4] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer ls /var/folders/5l/z5y3dkwn68sgb6htzc5w7vnm0000gn/T/88398
[stage-4] (expecting that the directory won't be accessible)
[stage-4] Expected stdout to contain "No such file or directory", got: ""
[your_program] Fork Error: no such file or directory
[stage-4] Expected stdout to contain "No such file or directory", got: "Fork Error: no such file or directory"
[stage-4] Test failed
13 changes: 2 additions & 11 deletions internal/test_helpers/fixtures/stdio/failure
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
Debug = true

[stage-1] Running tests for Stage #1: init
[stage-1] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo 88398
[your_program] 88398
[stage-1] Checking if the command output was echo-ed..
[stage-1] Test passed.

[stage-2] Running tests for Stage #2: stdio
[stage-2] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo 88398
[your_program] 88398
[your_program] Fork Error: no such file or directory
[stage-2] Checking if the string was echo-ed to stdout..
[stage-2] Executing: ./your_docker.sh run <some_image> /usr/local/bin/docker-explorer echo_stderr 28626
[your_program] 28626
[stage-2] Checking if the string was echo-ed to stderr..
[stage-2] Expected "28626\n" as stderr, got: ""
[stage-2] Expected "88398\n" as stdout, got: "Fork Error: no such file or directory"
[stage-2] Test failed

0 comments on commit e660292

Please sign in to comment.