Skip to content

Commit

Permalink
FOR DEBUGING ONLINE, DO NOT MERGE!
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen-Webb committed Jul 31, 2019
1 parent 6a12b26 commit f4e62e4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/Tests/LDAP/UseCase/ldap-test-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 ))
11 changes: 10 additions & 1 deletion src/Tests/LDAP/UseCase/ldap-test-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 ))
10 changes: 9 additions & 1 deletion src/Tests/LDAP/UseCase/ldap-test-3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 ))
10 changes: 9 additions & 1 deletion src/Tests/LDAP/UseCase/ldap-test-4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/Tests/LDAP/UseCase/ldap-test-5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 ))

0 comments on commit f4e62e4

Please sign in to comment.