podman

Форк
0
/
037-runlabel.bats 
32 строки · 2.0 Кб
1
#!/usr/bin/env bats
2

3
load helpers
4

5
@test "podman container runlabel test" {
6
    skip_if_remote "container runlabel is not supported for remote"
7
    tmpdir=$PODMAN_TMPDIR/runlabel-test
8
    mkdir -p $tmpdir
9
    containerfile=$tmpdir/Containerfile
10
    rand1=$(random_string 30)
11
    rand2=$(random_string 30)
12
    rand3=$(random_string 30)
13
    cat >$containerfile <<EOF
14
FROM $IMAGE
15
LABEL  INSTALL  podman  run  -t  -i  --rm  \\\${OPT1}  --privileged  -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=\\\${NAME} -e IMAGE=\\\${IMAGE} -e CONFDIR=/etc/\\\${NAME} -e LOGDIR=/var/log/\\\${NAME} -e DATADIR=/var/lib/\\\${NAME} \\\${IMAGE} \\\${OPT2} /bin/install.sh \\\${OPT3}
16
EOF
17

18
    run_podman build -t runlabel_image $tmpdir
19

20
    run_podman container runlabel --opt1=${rand1} --opt2=${rand2} --opt3=${rand3} --name test1 --display  install runlabel_image
21
    is "$output"   "command: ${PODMAN} run -t -i --rm ${rand1} --privileged -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=test1 -e IMAGE=localhost/runlabel_image:latest -e CONFDIR=/etc/test1 -e LOGDIR=/var/log/test1 -e DATADIR=/var/lib/test1 localhost/runlabel_image:latest ${rand2} /bin/install.sh ${rand3}"   "generating runlabel install command"
22

23
    run_podman container runlabel --opt3=${rand3} --display  install runlabel_image
24
    is "$output"   "command: ${PODMAN} run -t -i --rm --privileged -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=runlabel_image -e IMAGE=localhost/runlabel_image:latest -e CONFDIR=/etc/runlabel_image -e LOGDIR=/var/log/runlabel_image -e DATADIR=/var/lib/runlabel_image localhost/runlabel_image:latest /bin/install.sh ${rand3}" "generating runlabel without name and --opt1, --opt2"
25

26
    run_podman 125 container runlabel --opt1=${rand1} --opt2=${rand2} --opt3=${rand3} --name test1 --display  run runlabel_image
27
    is "$output"   "Error: cannot find the value of label: run in image: runlabel_image"   "generating runlabel run command"
28

29
    run_podman rmi -f runlabel_image
30
}
31

32
# vim: filetype=sh
33

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

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

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

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