mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
test: Fix make check
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
@@ -10,6 +10,8 @@ EXTRA_DIST += test_start_stop_service/service.sh
|
||||
AM_TESTS_ENVIRONMENT = TESTS_ROOT='$(builddir)/test_root/';
|
||||
AM_TESTS_ENVIRONMENT += export TESTS_ROOT;
|
||||
AM_TESTS_ENVIRONMENT += export LD_LIBRARY_PATH;
|
||||
AM_TESTS_ENVIRONMENT += PREFIX=$(prefix);
|
||||
AM_TESTS_ENVIRONMENT += export PREFIX;
|
||||
|
||||
TESTS = checkself.sh
|
||||
TESTS += setup_root.sh
|
||||
|
||||
+2
-4
@@ -84,10 +84,8 @@ teardown() {
|
||||
|
||||
trap teardown EXIT
|
||||
|
||||
FINIT_CONF=$(grep FINIT_CONF "$TESTS_ROOT/../config.h" | cut -d' ' -f3 | cut -d'"' -f2)
|
||||
export FINIT_CONF
|
||||
FINIT_CONF_DIR="$(dirname "$FINIT_CONF")"/finit.d
|
||||
export FINIT_CONF_DIR
|
||||
# shellcheck source=/dev/null
|
||||
. "$TESTS_ROOT/../test.env"
|
||||
|
||||
log "$color_reset" 'Test start' ''
|
||||
log "$color_reset" '--' ''
|
||||
|
||||
+20
-8
@@ -3,13 +3,25 @@
|
||||
set -eu
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
"$srcdir"/../configure --prefix=/
|
||||
make
|
||||
make DESTDIR="$(pwd)/test_root/" install
|
||||
if [ ! -f "$srcdir"/../config.status ]; then
|
||||
"$srcdir"/../configure --prefix=/
|
||||
make
|
||||
make DESTDIR="$(pwd)/test_root/" install
|
||||
|
||||
mkdir -p test_root/bin
|
||||
cp "${srcdir}/test_root/bin/chrootsetup.sh" test_root/bin
|
||||
cp "${srcdir}/test_root/busybox-x86_64.md5" test_root/
|
||||
cp "${srcdir}/test_root/Makefile" test_root/
|
||||
mkdir -p test_root/bin
|
||||
cp "${srcdir}/test_root/bin/chrootsetup.sh" test_root/bin
|
||||
cp "${srcdir}/test_root/busybox-x86_64.md5" test_root/
|
||||
cp "${srcdir}/test_root/Makefile" test_root/
|
||||
make -C test_root/
|
||||
config_h='./config.h'
|
||||
echo "export PATH=/bin:/sbin" > test.env
|
||||
else
|
||||
# make
|
||||
make -C ../ DESTDIR="$(pwd)/test_root/" install
|
||||
FINITBIN=../../src/finit make -C test_root/
|
||||
config_h='../config.h'
|
||||
echo "export PATH=/bin:/sbin:$PREFIX/sbin:$PREFIX/bin" > test.env
|
||||
fi
|
||||
|
||||
make -C test_root/
|
||||
echo "export FINIT_CONF=$(grep FINIT_CONF $config_h | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
||||
echo "export FINIT_RCSD=$(grep FINIT_RCSD $config_h | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
||||
|
||||
@@ -6,3 +6,4 @@ if [ -d test_root/var/lock ]; then
|
||||
chmod +r test_root/var/lock
|
||||
fi
|
||||
make -C test_root/ clean
|
||||
rm -f test.env
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
ARCH ?= x86_64
|
||||
|
||||
FINITBIN ?= ./sbin/finit
|
||||
INITCTLBIN ?= ./sbin/initctl
|
||||
|
||||
BBVER ?= 1.31.0
|
||||
BBBIN = busybox-$(ARCH)
|
||||
|
||||
@@ -22,7 +22,7 @@ mount -t tmpfs none /etc
|
||||
# mkdir -p /dev/pts
|
||||
# mount -t devpts none /dev/pts
|
||||
|
||||
mkdir -p "$FINIT_CONF_DIR"
|
||||
mkdir -p "$FINIT_RCSD"
|
||||
|
||||
tty=/dev/$(cat /sys/class/tty/console/active)
|
||||
mkfifo "$tty"
|
||||
|
||||
@@ -16,7 +16,6 @@ TESTS_ROOT="${TESTS_ROOT:-$(pwd)/${TEST_DIR}/test_root}"
|
||||
nsenter=$(command -v nsenter)
|
||||
chroot=$(command -v chroot)
|
||||
|
||||
export PATH=/sbin:/bin
|
||||
export PS1='\w \$ '
|
||||
export PS2='> '
|
||||
export PS3='#? '
|
||||
|
||||
@@ -10,7 +10,6 @@ TESTS_ROOT="${TESTS_ROOT:-$(pwd)/${TEST_DIR}/test_root}"
|
||||
unshare=$(command -v unshare)
|
||||
chroot=$(command -v chroot)
|
||||
|
||||
export PATH=/sbin:/bin
|
||||
export PS1='\w \$ '
|
||||
export PS2='> '
|
||||
export PS3='#? '
|
||||
|
||||
Reference in New Issue
Block a user