From 4fc338588b5a80e10ff7c7489c0b5ca1b57e39ba Mon Sep 17 00:00:00 2001 From: Allen-Webb Date: Wed, 31 Jul 2019 08:41:29 -0700 Subject: [PATCH] FOR DEBUGING ONLINE, DO NOT MERGE! --- src/Tests/LDAP/UseCase/ldap-test-1.sh | 10 +++++++++- src/Tests/LDAP/UseCase/ldap-test-2.sh | 11 ++++++++++- src/Tests/LDAP/UseCase/ldap-test-3.sh | 10 +++++++++- src/Tests/LDAP/UseCase/ldap-test-4.sh | 10 +++++++++- src/Tests/LDAP/UseCase/ldap-test-5.sh | 10 +++++++++- 5 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/Tests/LDAP/UseCase/ldap-test-1.sh b/src/Tests/LDAP/UseCase/ldap-test-1.sh index 3fb82099..5c4f67e6 100755 --- a/src/Tests/LDAP/UseCase/ldap-test-1.sh +++ b/src/Tests/LDAP/UseCase/ldap-test-1.sh @@ -94,7 +94,9 @@ ${LDAP_UTIL} delete && true ${LDAP_UTIL} setup ${LDAP_UTIL} policy "${TMPDIR}/policy.ldif" -sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \ + ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log & +sleep 1 RC=$? echo "RC == $RC" @@ -130,6 +132,12 @@ then sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf" fi +# Get stderr, signals, and exits from usbguard-daemon. +if [ "${GREP1}" -ne "0" ] +then + grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log" +fi + nss_restore exit $(( $RC + $GREP + $KILLRC )) diff --git a/src/Tests/LDAP/UseCase/ldap-test-2.sh b/src/Tests/LDAP/UseCase/ldap-test-2.sh index 1a7352b9..702cc073 100755 --- a/src/Tests/LDAP/UseCase/ldap-test-2.sh +++ b/src/Tests/LDAP/UseCase/ldap-test-2.sh @@ -94,7 +94,10 @@ ${LDAP_UTIL} delete && true ${LDAP_UTIL} setup # ${LDAP_UTIL} policy "${TMPDIR}/policy.ldif" -sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log + +sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \ + ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sleep 1 RC=$? echo "RC == $RC" @@ -130,6 +133,12 @@ then sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf" fi +# Get stderr, signals, and exits from usbguard-daemon. +if [ "${GREP1}" -ne "0" ] +then + grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log" +fi + nss_restore exit $(( $RC + $GREP + $KILLRC )) diff --git a/src/Tests/LDAP/UseCase/ldap-test-3.sh b/src/Tests/LDAP/UseCase/ldap-test-3.sh index 6ce9d561..6ec37844 100755 --- a/src/Tests/LDAP/UseCase/ldap-test-3.sh +++ b/src/Tests/LDAP/UseCase/ldap-test-3.sh @@ -94,7 +94,9 @@ ${LDAP_UTIL} delete && true # ${LDAP_UTIL} setup # ${LDAP_UTIL} policy "${TMPDIR}/policy.ldif" -sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \ + ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sleep 1 RC=$? echo "RC == $RC" @@ -149,6 +151,12 @@ then sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf" fi +# Get stderr, signals, and exits from usbguard-daemon. +if [ "${GREP1}" -ne "0" ] +then + grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log" +fi + nss_restore exit $(( $RC + $GREP1 + $GREP2 + $KILLRC )) diff --git a/src/Tests/LDAP/UseCase/ldap-test-4.sh b/src/Tests/LDAP/UseCase/ldap-test-4.sh index c63f072d..5f745277 100755 --- a/src/Tests/LDAP/UseCase/ldap-test-4.sh +++ b/src/Tests/LDAP/UseCase/ldap-test-4.sh @@ -98,7 +98,9 @@ sudo -n service slapd stop service slapd status -sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \ + ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sleep 1 RC=$? echo "RC == $RC" @@ -151,6 +153,12 @@ then sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf" fi +# Get stderr, signals, and exits from usbguard-daemon. +if [ "${GREP1}" -ne "0" ] +then + grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log" +fi + nss_restore sudo -n service slapd start diff --git a/src/Tests/LDAP/UseCase/ldap-test-5.sh b/src/Tests/LDAP/UseCase/ldap-test-5.sh index 0269281b..9130d745 100755 --- a/src/Tests/LDAP/UseCase/ldap-test-5.sh +++ b/src/Tests/LDAP/UseCase/ldap-test-5.sh @@ -145,7 +145,9 @@ ${LDAP_UTIL} delete && true ${LDAP_UTIL} setup ${LDAP_UTIL} policy "${TMPDIR}/policy.ldif" -sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \ + ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log +sleep 1 RC=$? echo "RC == $RC" @@ -195,6 +197,12 @@ then sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf" fi +# Get stderr, signals, and exits from usbguard-daemon. +if [ "${GREP1}" -ne "0" ] +then + grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log" +fi + nss_restore exit $(( $RC + $GREP + $KILLRC + $WC + $DIFF ))