From 0ffb49dba041087931427f4b6eddbfded2aa7d7d Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 22 Sep 2022 17:37:50 -0700 Subject: [PATCH 1/3] tests/int: suppress bogus error The situation when /sys/fs/cgroup/unified is not present normal and should not result in anything on stderr. Suppress it. Fixes: cc15b887a00069b Signed-off-by: Kir Kolyshkin --- tests/integration/helpers.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index e61096c24..70a4f93ca 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -126,7 +126,7 @@ function init_cgroup_paths() { CGROUP_SUBSYSTEMS+=" freezer" fi else - if stat -f -c %t /sys/fs/cgroup/unified | grep -qFw 63677270; then + if stat -f -c %t /sys/fs/cgroup/unified 2>/dev/null | grep -qFw 63677270; then CGROUP_HYBRID=yes fi CGROUP_V1=yes From 4e65118d02b19963d49a6e0b12326123dd21c956 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 22 Sep 2022 18:36:15 -0700 Subject: [PATCH 2/3] tests/int/helpers: gawk -> awk We use awk in other 9 or so places, and here it's gawk. Since this is on Linux, most probably awk is gawk. So s/gawk/awk/. Signed-off-by: Kir Kolyshkin --- tests/integration/helpers.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/helpers.bash b/tests/integration/helpers.bash index 70a4f93ca..ee93c42b4 100644 --- a/tests/integration/helpers.bash +++ b/tests/integration/helpers.bash @@ -133,7 +133,7 @@ function init_cgroup_paths() { CGROUP_SUBSYSTEMS=$(awk '!/^#/ {print $1}' /proc/cgroups) local g base_path for g in ${CGROUP_SUBSYSTEMS}; do - base_path=$(gawk '$(NF-2) == "cgroup" && $NF ~ /\<'"${g}"'\>/ { print $5; exit }' /proc/self/mountinfo) + base_path=$(awk '$(NF-2) == "cgroup" && $NF ~ /\<'"${g}"'\>/ { print $5; exit }' /proc/self/mountinfo) test -z "$base_path" && continue eval CGROUP_"${g^^}"_BASE_PATH="${base_path}" done From 491713e841bac493bb9e83627e1e6433ff59e2f8 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 27 Sep 2022 20:43:32 -0700 Subject: [PATCH 3/3] cirrus-ci: enable EPEL for CentOS 7 It used to be enabled by default, but not as of last few weeks. While at it, add rpm -q command to make sure all required RPMS were in fact installed (at least CentOS 7 yum exits with 0 when some packages requested are not available). Signed-off-by: Kir Kolyshkin --- .cirrus.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index e2e7a3dc4..34baf5f11 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -72,6 +72,7 @@ task: CIRRUS_WORKING_DIR: /home/runc GO_VERSION: "1.18" BATS_VERSION: "v1.3.0" + RPMS: gcc git iptables jq glibc-static libseccomp-devel make criu fuse-sshfs # yamllint disable rule:key-duplicates matrix: DISTRO: centos-7 @@ -91,6 +92,8 @@ task: case $DISTRO in centos-7) (cd /etc/yum.repos.d && curl -O https://copr.fedorainfracloud.org/coprs/adrian/criu-el7/repo/epel-7/adrian-criu-el7-epel-7.repo) + # EPEL is needed for jq and fuse-sshfs. + rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # sysctl echo "user.max_user_namespaces=15076" > /etc/sysctl.d/userns.conf sysctl --system @@ -106,9 +109,14 @@ task: # Work around dnf mirror failures by retrying a few times. for i in $(seq 0 2); do sleep $i - yum install -y -q gcc git iptables jq glibc-static libseccomp-devel make criu fuse-sshfs && break + yum install -y $RPMS && break done [ $? -eq 0 ] # fail if yum failed + + # Double check that all rpms were installed (yum from CentOS 7 + # does not exit with an error if some packages were not found). + # Use --whatprovides since some packages are renamed. + rpm -q --whatprovides $RPMS # install Go curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local # install bats