1
#!/usr/bin/env bats -*- bats -*-
8
@test "podman compose - smoke tests" {
9
fake_compose_bin="$PODMAN_TMPDIR/fake_compose"
10
cat >$fake_compose_bin <<EOF
12
if [[ "\$@" == "fail" ]]; then
15
if [[ "\$@" == "env" ]]; then
16
printenv DOCKER_HOST DOCKER_BUILDKIT DOCKER_CONFIG
22
compose_conf="$PODMAN_TMPDIR/compose.conf"
23
cat >$compose_conf <<EOF
25
compose_providers = ["$fake_compose_bin"]
26
compose_warning_logs = false
29
random_data="--foo=bar --random=$(random_string 15) -f /path/to/file ignore me"
32
PODMAN_COMPOSE_PROVIDER=$fake_compose_bin run_podman 125 compose --help
33
is "$output" ".*executing $fake_compose_bin --help: .*: permission denied"
36
chmod +x $fake_compose_bin
37
PODMAN_COMPOSE_PROVIDER=$fake_compose_bin run_podman compose --help
38
is "$output" "Run compose workloads via an external provider .*arguments: --help"
41
PODMAN_COMPOSE_PROVIDER=$fake_compose_bin run_podman compose
42
is "$output" "Run compose workloads via an external provider .*arguments: "
46
CONTAINERS_CONF_OVERRIDE=$compose_conf run_podman compose --help
47
is "$output" "Run compose workloads via an external provider .*arguments: --help"
48
assert "$output" !~ ".*Executing external compose provider.*"
51
CONTAINERS_CONF_OVERRIDE=$compose_conf run_podman compose $random_data
52
is "$output" "arguments: $random_data"
55
CONTAINERS_CONF_OVERRIDE=$compose_conf run_podman 42 compose fail
61
if [[ "$PODMAN" =~ "--url" ]]; then
63
url="${PODMAN##*--url }"
68
CONTAINERS_CONF_OVERRIDE=$compose_conf run_podman compose env
69
assert "${lines[0]}" $op "$url" "line 1 of 3 (DOCKER_HOST)"
70
assert "${lines[1]}" = "0" "line 2 of 3 (DOCKER_BUILDKIT)"
71
assert "${lines[2]}" = "" "line 3 of 3 (DOCKER_CONFIG)"
73
DOCKER_HOST="$random_data" DOCKER_CONFIG="$random_data" CONTAINERS_CONF_OVERRIDE=$compose_conf run_podman compose env
74
is "${lines[0]}" "$random_data"
76
is "${lines[2]}" "$random_data"