From 573cfb6b043bad44fc1bd41a44de727b3b59a1db Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Tue, 31 Mar 2015 02:46:45 -0700 Subject: [PATCH] fix two issues for older releases The following patch addresses two issues on older releases: 1) In trunk commit 2911, the line 'undefine VERBOSE' was added to parser/tst/Makefile so that the equality tests would not generate verbose output when $VERBOSE != 1. Unfortunately, the 'undefine' keyword was not introduced in GNU Make until version 3.82. On distro releases like Ubuntu 12.04 LTS that include versions of Make older than that, make check and make clean abort when VERBOSE is not set to 1. The patch fixes that by setting VERBOSE to a zero length string if does not already equal 1. 2) In trunk commit 2923, a workaround for systemd as init was added to the pivot_root regression test. The workaround included a call to ps(1) to determine if systemd is pid 1. Unfortunately, in older versions of the procps package (such as the version in Ubuntu 12.04 LTS), 'ps -hp1' emits the warning Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html The patch below converts the ps call to 'ps hp1' which does not generate the warning. Signed-off-by: Steve Beattie Acked-by: John Johansen --- parser/tst/Makefile | 2 +- tests/regression/apparmor/pivot_root.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parser/tst/Makefile b/parser/tst/Makefile index 76609d23e..ad0e79183 100644 --- a/parser/tst/Makefile +++ b/parser/tst/Makefile @@ -10,7 +10,7 @@ ifeq ($(VERBOSE),1) PROVE_ARG+=-v PYTEST_ARG = -v else - undefine VERBOSE + VERBOSE= endif all: tests diff --git a/tests/regression/apparmor/pivot_root.sh b/tests/regression/apparmor/pivot_root.sh index b46839e8b..35004fc9b 100755 --- a/tests/regression/apparmor/pivot_root.sh +++ b/tests/regression/apparmor/pivot_root.sh @@ -53,7 +53,7 @@ if [ -x "${FINDMNT}" ] && ${FINDMNT} -no PROPAGATION / > /dev/null 2>&1 ; then if [ "$(${FINDMNT} -no PROPAGATION /)" == "shared" ] ; then root_was_shared="yes" fi -elif [ "$(ps -hp1 -ocomm)" = "systemd" ] ; then +elif [ "$(ps hp1 -ocomm)" = "systemd" ] ; then # no findmnt or findmnt doesn't know the PROPAGATION column, # but init is systemd so assume rootfs is shared root_was_shared="yes"