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

CI: test and confirm DESIRED_DATABASE #17822

Merged
merged 1 commit into from
Mar 17, 2023
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
15 changes: 15 additions & 0 deletions test/e2e/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,19 @@ var _ = Describe("Podman Info", func() {
Expect(session).To(Exit(0))
Expect(session.OutputToString()).To(Equal(want))
})

It("Podman info: check desired database backend", func() {
// defined in .cirrus.yml
want := os.Getenv("CI_DESIRED_DATABASE")
if want == "" {
if os.Getenv("CIRRUS_CI") == "" {
Skip("CI_DESIRED_DATABASE is not set--this is OK because we're not running under Cirrus")
}
Fail("CIRRUS_CI is set, but CI_DESIRED_DATABASE is not! See #16389")
}
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.DatabaseBackend}}"})
session.WaitWithDefaultTimeout()
Expect(session).To(Exit(0))
Expect(session.OutputToString()).To(Equal(want))
})
})
1 change: 1 addition & 0 deletions test/system/001-basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function setup() {
'Logdriver:{{.Host.LogDriver}}'
'Cgroups:{{.Host.CgroupsVersion}}+{{.Host.CgroupManager}}'
'Net:{{.Host.NetworkBackend}}'
'DB:{{.Host.DatabaseBackend}}'
)
run_podman info --format "$(IFS='/' echo ${want[@]})"
echo "# $output" >&3
Expand Down
20 changes: 20 additions & 0 deletions test/system/005-info.bats
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ host.slirp4netns.executable | $expr_path
is "$output" "$CI_DESIRED_NETWORK" "CI_DESIRED_NETWORK (from .cirrus.yml)"
}

@test "podman info - confirm desired database" {
skip "FIXME: no way yet (2023-03-16) to override DB in system tests"
if [[ -z "$CI_DESIRED_DATABASE" ]]; then
# When running in Cirrus, CI_DESIRED_DATABASE *must* be defined
# in .cirrus.yml so we can double-check that all CI VMs are
# using netavark or cni as desired.
if [[ -n "$CIRRUS_CI" ]]; then
die "CIRRUS_CI is set, but CI_DESIRED_DATABASE is not! See #16389"
fi

# Not running under Cirrus (e.g., gating tests, or dev laptop).
# Totally OK to skip this test.
skip "CI_DESIRED_DATABASE is unset--OK, because we're not in Cirrus"
fi

run_podman info --format '{{.Host.DatabaseBackend}}'
is "$output" "$CI_DESIRED_DATABASE" "CI_DESIRED_DATABASE (from .cirrus.yml)"
}


# 2021-04-06 discussed in watercooler: RHEL must never use crun, even if
# using cgroups v2.
@test "podman info - RHEL8 must use runc" {
Expand Down