mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
Merge pull request #8559 from poettering/integration-test-fixes
make integration tests pass again
This commit is contained in:
commit
1b25e0351a
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user