diff --git a/tests/integration/cri-containerd/integration-tests.sh b/tests/integration/cri-containerd/integration-tests.sh index 13caac55f7..58d28dcb71 100755 --- a/tests/integration/cri-containerd/integration-tests.sh +++ b/tests/integration/cri-containerd/integration-tests.sh @@ -430,6 +430,143 @@ function stop_containerd() { sudo systemctl stop containerd } +function mountLoopDevice() { + local loop_file="$1" + if [ -e "$loop_file" ]; then + sudo rm -f $loop_file + info "$loop_file was removed" + fi + + sudo dd if=/dev/zero of=$loop_file bs=100M count=2 + sudo mkfs.ext4 $loop_file + sudo losetup -fP $loop_file + local loinfo=$(sudo losetup -a | grep $loop_file) + local device=$(echo "$loinfo" | awk -F'[: ]' '{print $1}') + echo $device +} + +function startDeviceCgroupContainers() { + local pod_yaml=${REPORT_DIR}/device-cgroup-pod.yaml + local container1_yaml=${REPORT_DIR}/device-cgroup-container1.yaml + local container2_yaml=${REPORT_DIR}/device-cgroup-container2.yaml + local image="busybox:latest" + + cat > "$pod_yaml" < "$container1_yaml" < "$container2_yaml" <