diff --git a/test/config.bats b/test/config.bats index ba899fd4f91..69d5c48674b 100644 --- a/test/config.bats +++ b/test/config.bats @@ -20,7 +20,7 @@ function teardown() { # when start_crio_no_setup - run ${CRIO_STATUS_BINARY_PATH} --socket=${CRIO_SOCKET} config + run "${CRIO_STATUS_BINARY_PATH}" --socket="${CRIO_SOCKET}" config echo "$output" # then @@ -30,15 +30,15 @@ function teardown() { @test "config dir should fail with invalid option" { # given - printf "[crio.runtime]\nlog_level = info\n" > "$CRIO_CONFIG" - printf "[crio.runtime]\nlog_level = wrong\n" > "$CRIO_CONFIG_DIR"/00-default + printf '[crio.runtime]\nlog_level = "info"\n' > "$CRIO_CONFIG" + printf '[crio.runtime]\nlog_level = "wrong-level"\n' > "$CRIO_CONFIG_DIR"/00-default # when - "$CRIO_BINARY_PATH" -c "$CRIO_CONFIG" -d "$CRIO_CONFIG_DIR" &> >(tee "$CRIO_LOG") || true - RES=$(cat "$CRIO_LOG") + run "$CRIO_BINARY_PATH" -c "$CRIO_CONFIG" -d "$CRIO_CONFIG_DIR" # then - [[ "$RES" == *"unable to decode configuration"* ]] + [ "$status" -ne 0 ] + [[ "$output" == *"not a valid logrus"*"wrong-level"* ]] } @test "replace default runtime should succeed" {