tests: modified cwrap tests to run from different builddir

This commit is contained in:
Nikos Mavrogiannopoulos
2015-11-19 14:30:48 +01:00
parent ba44c2a6c1
commit e91a56117b
18 changed files with 80 additions and 67 deletions

View File

@@ -44,6 +44,12 @@ if ! test -x /usr/sbin/openconnect;then
exit 77
fi
update_config() {
file=$1
cp ${srcdir}/${file} "$file.tmp"
sed -i 's|@SRCDIR@|'${srcdir}'|g' "$file.tmp"
CONFIG="$file.tmp"
}
fail() {
PID=$1
@@ -66,7 +72,7 @@ launch_server() {
}
launch_sr_server() {
LD_PRELOAD=libsocket_wrapper.so:libuid_wrapper.so UID_WRAPPER=1 UID_WRAPPER_ROOT=1 $SERV $* >/dev/null 2>&1 &
LD_PRELOAD=libsocket_wrapper.so:libuid_wrapper.so UID_WRAPPER=1 UID_WRAPPER_ROOT=1 $SERV $* &#>/dev/null 2>&1 &
LOCALPID="$!";
trap "[ ! -z \"${LOCALPID}\" ] && kill ${LOCALPID};" 15
wait "${LOCALPID}"
@@ -106,6 +112,7 @@ cleanup() {
kill $PID
wait
test -n "$SOCKDIR" && rm -rf $SOCKDIR
rm -f ${CONFIG}
}
trap "fail \"Failed to launch the server, aborting test... \"" 10