mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-25 06:52:13 +00:00
ci: cri-containerd: Always use sudo to call crictl
Otherwise we may get the following error: ``` time="2023-07-15T21:12:13Z" level=fatal msg="validate service connection: validate CRI v1 runtime API for endpoint \"unix:///run/containerd/containerd.sock\": rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied\"" ``` Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
99ba86a1b2
commit
a84773652c
@ -247,7 +247,7 @@ function TestContainerMemoryUpdate() {
|
|||||||
|
|
||||||
testContainerStart
|
testContainerStart
|
||||||
|
|
||||||
vm_size=$(($(crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
vm_size=$(($(sudo crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
||||||
if [ $vm_size -gt $((2*1024*1024*1024)) ] || [ $vm_size -lt $((2*1024*1024*1024-128*1024*1024)) ]; then
|
if [ $vm_size -gt $((2*1024*1024*1024)) ] || [ $vm_size -lt $((2*1024*1024*1024-128*1024*1024)) ]; then
|
||||||
testContainerStop
|
testContainerStop
|
||||||
die "The VM memory size $vm_size before update is not right"
|
die "The VM memory size $vm_size before update is not right"
|
||||||
@ -256,7 +256,7 @@ function TestContainerMemoryUpdate() {
|
|||||||
sudo crictl update --memory $((2*1024*1024*1024)) $cid
|
sudo crictl update --memory $((2*1024*1024*1024)) $cid
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
vm_size=$(($(crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
vm_size=$(($(sudo crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
||||||
if [ $vm_size -gt $((4*1024*1024*1024)) ] || [ $vm_size -lt $((4*1024*1024*1024-128*1024*1024)) ]; then
|
if [ $vm_size -gt $((4*1024*1024*1024)) ] || [ $vm_size -lt $((4*1024*1024*1024-128*1024*1024)) ]; then
|
||||||
testContainerStop
|
testContainerStop
|
||||||
die "The VM memory size $vm_size after increase is not right"
|
die "The VM memory size $vm_size after increase is not right"
|
||||||
@ -266,7 +266,7 @@ function TestContainerMemoryUpdate() {
|
|||||||
sudo crictl update --memory $((1*1024*1024*1024)) $cid
|
sudo crictl update --memory $((1*1024*1024*1024)) $cid
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
vm_size=$(($(crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
vm_size=$(($(sudo crictl exec $cid cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')*1024))
|
||||||
if [ $vm_size -gt $((3*1024*1024*1024)) ] || [ $vm_size -lt $((3*1024*1024*1024-128*1024*1024)) ]; then
|
if [ $vm_size -gt $((3*1024*1024*1024)) ] || [ $vm_size -lt $((3*1024*1024*1024-128*1024*1024)) ]; then
|
||||||
testContainerStop
|
testContainerStop
|
||||||
die "The VM memory size $vm_size after decrease is not right"
|
die "The VM memory size $vm_size after decrease is not right"
|
||||||
@ -277,10 +277,10 @@ function TestContainerMemoryUpdate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getContainerSwapInfo() {
|
function getContainerSwapInfo() {
|
||||||
swap_size=$(($(crictl exec $cid cat /proc/meminfo | grep "SwapTotal:" | awk '{print $2}')*1024))
|
swap_size=$(($(sudo crictl exec $cid cat /proc/meminfo | grep "SwapTotal:" | awk '{print $2}')*1024))
|
||||||
# NOTE: these below two checks only works on cgroup v1
|
# NOTE: these below two checks only works on cgroup v1
|
||||||
swappiness=$(crictl exec $cid cat /sys/fs/cgroup/memory/memory.swappiness)
|
swappiness=$(sudo crictl exec $cid cat /sys/fs/cgroup/memory/memory.swappiness)
|
||||||
swap_in_bytes=$(crictl exec $cid cat /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes)
|
swap_in_bytes=$(sudo crictl exec $cid cat /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
function TestContainerSwap() {
|
function TestContainerSwap() {
|
||||||
|
Loading…
Reference in New Issue
Block a user