mirror of
https://github.com/containers/buildah.git
synced 2026-02-05 09:45:38 +01:00
If the logging level is at least "trace", log the final error we print, if there is one, using %+v as the verb, or %v (changed from %s) otherwise. If the error was wrapped using github.com/pkg/errors, this will provide a backtrace. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
30 lines
906 B
Bash
30 lines
906 B
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
@test "info" {
|
|
run_buildah info
|
|
expect_output --substring "host"
|
|
|
|
run_buildah info --format='{{.store}}'
|
|
# All of the following keys must be present in results. Order
|
|
# isn't guaranteed, nor is their value, but they must all exist.
|
|
for key in ContainerStore GraphDriverName GraphRoot RunRoot;do
|
|
expect_output --substring "map.*$key:"
|
|
done
|
|
}
|
|
|
|
@test "logging levels" {
|
|
# check that these logging levels are recognized
|
|
run_buildah --log-level=trace info
|
|
run_buildah --log-level=debug info
|
|
run_buildah --log-level=warn info
|
|
run_buildah --log-level=info info
|
|
run_buildah --log-level=error info
|
|
run_buildah --log-level=fatal info
|
|
run_buildah --log-level=panic info
|
|
# check that we reject bogus logging levels
|
|
run_buildah 125 --log-level=telepathic info
|
|
expect_output --substring "unable to parse log level: not a valid logrus Level"
|
|
}
|