1
#!/usr/bin/env bats -*- bats -*-
3
# options that cannot be set together
9
@test "options that cannot be set together" {
10
skip_if_remote "not much point testing remote, and container-cleanup fails anyway"
13
create,run | --cpu-period=1 | --cpus=2 | $IMAGE
14
create,run | --cpu-quota=1 | --cpus=2 | $IMAGE
15
create,run | --no-hosts | --add-host=foo:1.1.1.1 | $IMAGE
16
create,run | --userns=bar | --pod=foo | $IMAGE
17
container cleanup | --all | --exec=foo
18
container cleanup | --exec=foo | --rmi | foo
21
# Run all tests, continue even if any fail
22
defer-assertion-failures
24
# FIXME: parse_table is what does all the work, giving us test cases.
25
while read subcommands opt1 opt2 args; do
29
readarray -d, -t subcommand_list <<<$subcommands
30
for subcommand in "${subcommand_list[@]}"; do
31
run_podman 125 $subcommand $opt1 $opt2 $args
32
is "$output" "Error: $opt1_name and $opt2_name cannot be set together" \
33
"podman $subcommand $opt1 $opt2"
36
run_podman 125 $subcommand $opt2 $opt1 $args
37
is "$output" "Error: $opt1_name and $opt2_name cannot be set together" \
38
"podman $subcommand $opt2 $opt1"
40
done < <(parse_table "$tests")
42
# Different error message; cannot be tested with the other ones above
43
for opt in arch os; do
44
for cmd in create pull; do
45
run_podman 125 $cmd --platform=foo --$opt=bar sdfsdf
46
is "$output" "Error: --platform option can not be specified with --arch or --os" \
47
"podman $cmd --platform + --$opt"