diff --git a/script/test_Dockerfile b/script/test_Dockerfile index bbb8af45d..91641209e 100644 --- a/script/test_Dockerfile +++ b/script/test_Dockerfile @@ -6,6 +6,7 @@ RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/a RUN apt-get update && apt-get install -y \ build-essential \ curl \ + gawk \ iptables \ libaio-dev \ libcap-dev \ diff --git a/tests/integration/cgroups.bats b/tests/integration/cgroups.bats index a48024d0b..5d63b1539 100644 --- a/tests/integration/cgroups.bats +++ b/tests/integration/cgroups.bats @@ -9,8 +9,8 @@ CGROUP_MEMORY="" TEST_CGROUP_NAME="runc-cgroups-integration-test" function init_cgroup_path() { - base_path=$(grep "rw," /proc/self/mountinfo | grep -i -m 1 'MEMORY$' | cut -d ' ' -f 5) - CGROUP_MEMORY="${base_path}/${TEST_CGROUP_NAME}" + base_path=$(grep "cgroup" /proc/self/mountinfo | gawk 'toupper($NF) ~ /\/ { print $5; exit }') + CGROUP_MEMORY="${base_path}/${TEST_CGROUP_NAME}" } function teardown() { diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 036aa6080..fe1a0401f 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -11,7 +11,7 @@ CGROUP_BLKIO="" function init_cgroup_path() { for g in MEMORY CPUSET CPU BLKIO; do - base_path=$(grep "rw," /proc/self/mountinfo | grep -i -m 1 "$g\$" | cut -d ' ' -f 5) + base_path=$(grep "cgroup" /proc/self/mountinfo | gawk 'toupper($NF) ~ /\<'${g}'\>/ { print $5; exit }') eval CGROUP_${g}="${base_path}/runc-update-integration-test" done }