summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux/util-linux/run-ptest
blob: 7b6b1d1dc2a920b5ce2af9c508307c38b302f524 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh


# When udevd (from eudev) is running most eject/mount tests will fail because
# of automount. We need to stop udevd before executing util-linux's tests.
# The systemd-udevd daemon doesn't change the outcome of util-linux's tests.
UDEV_PID="`pidof "@base_sbindir@/udevd"`"
if [ "x$UDEV_PID" != "x" ]; then
    /etc/init.d/udev stop
fi

current_path=$(readlink -f $0)
export bindir=$(dirname $current_path)
export PATH=$bindir/bin:$PATH

# losetup tests will be skipped and/or fail otherwise
modprobe loop

# required for mount/fallback test to pass
# systemd does this by default, but ptest images do not use it
# see https://man7.org/linux/man-pages/man7/mount_namespaces.7.html
# for a long description of mount namespaces in Linux
mount --make-shared /

# lsfd/option-inet has races in the test script:
# https://github.com/util-linux/util-linux/issues/2399
./tests/run.sh --use-system-commands --parsable --show-diff --exclude=lsfd/option-inet | sed -u '{
      s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/                              
      s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/                
      s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/               
   }'

if [ "x$UDEV_PID" != "x" ]; then
    /etc/init.d/udev start
fi