mirror of
https://github.com/containers/podman.git
synced 2025-05-17 06:59:07 +08:00

This will only fail if someone ever adds a system test that runs podman with "--db-backend boltdb", which nobody should ever do, but this is a cheap way to make sure it never happens. See #20563 Signed-off-by: Ed Santiago <santiago@redhat.com>
31 lines
1.0 KiB
Bash
31 lines
1.0 KiB
Bash
#!/usr/bin/env bats
|
|
#
|
|
# Final set of tests to run.
|
|
#
|
|
|
|
load helpers
|
|
|
|
# Confirm that we're still using the same database we started with.
|
|
#
|
|
# This should never fail! If it does, it means that some test somewhere
|
|
# has run podman with --db-backend, which is known to wreak havoc.
|
|
#
|
|
# See https://github.com/containers/podman/issues/20563
|
|
@test "podman database backend has not changed" {
|
|
# File is always written in 005-info.bats. It must always exist
|
|
# by the time we get here...
|
|
db_backend_file=$BATS_SUITE_TMPDIR/db-backend
|
|
|
|
if [[ ! -e "$db_backend_file" ]]; then
|
|
# ...except in a manual run like "hack/bats 999"
|
|
if [[ $BATS_SUITE_TEST_NUMBER -le 5 ]]; then
|
|
skip "$db_backend_file missing, but this is a short manual bats run, so, ok"
|
|
fi
|
|
|
|
die "Internal error: $db_backend_file does not exist! (check 005-*.bats)"
|
|
fi
|
|
|
|
run_podman info --format '{{.Host.DatabaseBackend}}'
|
|
assert "$output" = "$(<$db_backend_file)" ".Host.DatabaseBackend has changed!"
|
|
}
|