Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System tests: remove some misleading 'run's #8061

Merged
merged 1 commit into from
Oct 20, 2020
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
20 changes: 0 additions & 20 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -460,24 +460,4 @@ json-file | f
is "$output" "$expect" "podman run with --tz=local, matches host"
}

@test "podman container exists" {
rand=$(random_string 30)
run_podman 1 container exists myctr

run_podman create --name myctr $IMAGE /bin/true
run_podman container exists myctr

# Create a container that podman does not know about
run buildah from $IMAGE
cid="$output"

# exists should fail
run_podman 1 container exists $cid

# exists should succeed
run_podman container exists --external $cid

run buildah rm $cid
}

# vim: filetype=sh
9 changes: 6 additions & 3 deletions test/system/055-rm.bats
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ load helpers
run_podman create --name $rand $IMAGE /bin/true

# Create a container that podman does not know about
run buildah from $IMAGE
cid="$output"
external_cid=$(buildah from $IMAGE)

# Plain 'exists' should fail, but should succeed with --external
run_podman 1 container exists $external_cid
run_podman container exists --external $external_cid

# rm should succeed
run_podman rm $rand $cid
run_podman rm $rand $external_cid
}

# I'm sorry! This test takes 13 seconds. There's not much I can do about it,
Expand Down
6 changes: 3 additions & 3 deletions test/system/140-diff.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ load helpers

@test "podman diff with buildah container " {
rand_file=$(random_string 10)
run buildah from --name buildahctr $IMAGE
run buildah run buildahctr sh -c "touch /$rand_file;rm /etc/services"
buildah from --name buildahctr $IMAGE
buildah run buildahctr sh -c "touch /$rand_file;rm /etc/services"

run_podman diff --format json buildahctr

Expand All @@ -51,7 +51,7 @@ load helpers
is "$result" "${expect[$field]}" "$field"
done

run buildah rm buildahctr
buildah rm buildahctr
}

# vim: filetype=sh
8 changes: 8 additions & 0 deletions test/system/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ function basic_setup() {
# Clean up all containers
run_podman rm --all --force

# ...including external (buildah) ones
run_podman ps --all --external --format '{{.ID}} {{.Names}}'
for line in "${lines[@]}"; do
set $line
echo "# setup(): removing stray external container $1 ($2)" >&3
run_podman rm $1
done

# Clean up all images except those desired
found_needed_image=
run_podman images --all --format '{{.Repository}}:{{.Tag}} {{.ID}}'
Expand Down