podman

Форк
0
/
620-option-conflicts.bats 
53 строки · 1.8 Кб
1
#!/usr/bin/env bats   -*- bats -*-
2
#
3
# options that cannot be set together
4
#
5

6
load helpers
7

8

9
@test "options that cannot be set together" {
10
    skip_if_remote "not much point testing remote, and container-cleanup fails anyway"
11

12
    tests="
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
19
"
20

21
    # Run all tests, continue even if any fail
22
    defer-assertion-failures
23

24
    # FIXME: parse_table is what does all the work, giving us test cases.
25
    while read subcommands opt1 opt2 args; do
26
        opt1_name=${opt1%=*}
27
        opt2_name=${opt2%=*}
28

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"
34

35
            # Reverse order
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"
39
        done
40
    done < <(parse_table "$tests")
41

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"
48
        done
49
    done
50
}
51

52

53
# vim: filetype=sh
54

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.