File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ summary: Executing sysctl inside nested container running on top of QM
2
+ test: /bin/bash ./test.sh
3
+ duration: 20m
4
+ tag: ffi
5
+ framework: shell
6
+ id: f615d356-9bf9-4de2-a007-7a99eca2bc48
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -euvx
2
+
3
+ # shellcheck disable=SC1091
4
+
5
+ . ../common/prepare.sh
6
+
7
+ export QM_HOST_REGISTRY_DIR=" /var/qm/lib/containers/registry"
8
+ export QM_REGISTRY_DIR=" /var/lib/containers/registry"
9
+
10
+ disk_cleanup
11
+ prepare_test
12
+ reload_config
13
+
14
+ exec_cmd " podman run -d --rm --replace -d --name ffi-asil \
15
+ quay.io/centos-sig-automotive/ffi-tools:latest > /dev/null"
16
+
17
+ image_id=$( podman images | grep quay.io/centos-sig-automotive/ffi-tools | awk -F " " ' {print $3}' )
18
+
19
+ if [ -z $image_id ]; then
20
+ if_error_exit " NO ffi-tools IMAGE!!!"
21
+ exit 1
22
+ fi
23
+
24
+ if [ ! -d " ${QM_HOST_REGISTRY_DIR} " ]; then
25
+ exec_cmd " mkdir -p ${QM_HOST_REGISTRY_DIR} "
26
+ exec_cmd " podman push ${image_id} dir:${QM_HOST_REGISTRY_DIR} /ffi-tools:latest"
27
+ fi
28
+
29
+ sysctl_num=$( podman exec qm /bin/bash -c \
30
+ " podman run --replace --name ffi-qm dir:${QM_REGISTRY_DIR} /ffi-tools:latest \
31
+ ./setsysctl 2>&1" | grep -c " sysctl: permission denied on key" )
32
+
33
+ if [ $sysctl_num -ge 5 ]; then
34
+ info_message " Attempt to change OS level are denied successfully inside QM container."
35
+ exit 0
36
+ fi
You can’t perform that action at this time.
0 commit comments