diff --git a/coccinelle/run-coccinelle.sh b/coccinelle/run-coccinelle.sh index de23546f19..f463f5eed5 100755 --- a/coccinelle/run-coccinelle.sh +++ b/coccinelle/run-coccinelle.sh @@ -1,10 +1,9 @@ #!/bin/bash -e for SCRIPT in ${@-*.cocci} ; do - echo "--x-- Processing: spatch --sp-file $SCRIPT --dir $(pwd)/.. --x--" + echo "--x-- Processing $SCRIPT --x--" TMPFILE=`mktemp` - spatch --sp-file $SCRIPT --dir $(pwd)/.. 2> "$TMPFILE" || cat "$TMPFILE" + ( set -x ; spatch --sp-file $SCRIPT --dir $PWD/.. 2> "$TMPFILE" || cat "$TMPFILE" ) rm "$TMPFILE" - echo "--x-- Processed: spatch --sp-file $SCRIPT --dir $(pwd)/.. --x--" - echo "" + echo -e "--x-- Processed $SCRIPT --x--\n" done diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 3689f6e983..67705947aa 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -254,7 +254,8 @@ int fd_is_network_ns(int fd) { if (r <= 0) return r; - if (ioctl(fd, NS_GET_NSTYPE) < 0) + r = ioctl(fd, NS_GET_NSTYPE); + if (r < 0) return -errno; return r == CLONE_NEWNET; diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 1794290ebe..b56b7ac963 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -821,7 +821,7 @@ static int fd_set_perms(Item *i, int fd, const struct stat *st) { if (m == (st->st_mode & 07777)) log_debug("\"%s\" has correct mode %o already.", path, st->st_mode); else { - char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; + char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; log_debug("Changing \"%s\" to mode %o.", path, m); @@ -920,7 +920,7 @@ static int parse_xattrs_from_arg(Item *i) { } static int fd_set_xattrs(Item *i, int fd, const struct stat *st) { - char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; + char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; _cleanup_free_ char *path = NULL; char **name, **value; int r; @@ -1024,7 +1024,7 @@ static int path_set_acl(const char *path, const char *pretty, acl_type_t type, a static int fd_set_acls(Item *item, int fd, const struct stat *st) { int r = 0; #if HAVE_ACL - char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; + char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; _cleanup_free_ char *path = NULL; assert(item); @@ -1186,7 +1186,7 @@ static int parse_attribute_from_arg(Item *item) { } static int fd_set_attribute(Item *item, int fd, const struct stat *st) { - char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; + char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; _cleanup_close_ int procfs_fd = -1; _cleanup_free_ char *path = NULL; unsigned f; diff --git a/test/TEST-06-SELINUX/test.sh b/test/TEST-06-SELINUX/test.sh index e0c4c10e1c..18856c2459 100755 --- a/test/TEST-06-SELINUX/test.sh +++ b/test/TEST-06-SELINUX/test.sh @@ -10,6 +10,9 @@ TEST_NO_NSPAWN=1 # selinux-policy-targeted # selinux-policy-devel +# Check if selinux-policy-devel is installed, and if it isn't bail out early instead of failing +test -d /usr/share/selinux/devel || exit 0 + . $TEST_BASE_DIR/test-functions SETUP_SELINUX=yes KERNEL_APPEND="$KERNEL_APPEND selinux=1 security=selinux" diff --git a/test/run-integration-tests.sh b/test/run-integration-tests.sh index 7d70be3fea..94df346c28 100755 --- a/test/run-integration-tests.sh +++ b/test/run-integration-tests.sh @@ -11,14 +11,16 @@ ninja -C "$BUILD_DIR" declare -A results -RESULT=0 +COUNT=0 FAILURES=0 cd "$(dirname "$0")" for TEST in TEST-??-* ; do - echo -e "\n--x-- Starting $TEST --x--" + COUNT=$(($COUNT+1)) + + echo -e "\n--x-- Running $TEST --x--" set +e - make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args + ( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args ) RESULT=$? set -e echo "--x-- Result of $TEST: $RESULT --x--" @@ -40,9 +42,9 @@ for TEST in ${!results[@]}; do done | sort if [ "$FAILURES" -eq 0 ] ; then - echo -e "\nALL PASSED" + echo -e "\nALL $COUNT TESTS PASSED" else - echo -e "\nTOTAL FAILURES: $FAILURES" + echo -e "\nTOTAL FAILURES: $FAILURES OF $COUNT" fi exit "$FAILURES"