Skip to content

Commit 4fc3385

Browse files
committed
FOR DEBUGING ONLINE, DO NOT MERGE!
1 parent 6a12b26 commit 4fc3385

File tree

5 files changed

+46
-5
lines changed

5 files changed

+46
-5
lines changed

src/Tests/LDAP/UseCase/ldap-test-1.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ ${LDAP_UTIL} delete && true
9494
${LDAP_UTIL} setup
9595
${LDAP_UTIL} policy "${TMPDIR}/policy.ldif"
9696

97-
sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
97+
sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \
98+
${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log &
99+
sleep 1
98100
RC=$?
99101
echo "RC == $RC"
100102

@@ -130,6 +132,12 @@ then
130132
sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf"
131133
fi
132134

135+
# Get stderr, signals, and exits from usbguard-daemon.
136+
if [ "${GREP1}" -ne "0" ]
137+
then
138+
grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log"
139+
fi
140+
133141
nss_restore
134142

135143
exit $(( $RC + $GREP + $KILLRC ))

src/Tests/LDAP/UseCase/ldap-test-2.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ ${LDAP_UTIL} delete && true
9494
${LDAP_UTIL} setup
9595
# ${LDAP_UTIL} policy "${TMPDIR}/policy.ldif"
9696

97-
sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
97+
98+
sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \
99+
${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
100+
sleep 1
98101
RC=$?
99102
echo "RC == $RC"
100103

@@ -130,6 +133,12 @@ then
130133
sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf"
131134
fi
132135

136+
# Get stderr, signals, and exits from usbguard-daemon.
137+
if [ "${GREP1}" -ne "0" ]
138+
then
139+
grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log"
140+
fi
141+
133142
nss_restore
134143

135144
exit $(( $RC + $GREP + $KILLRC ))

src/Tests/LDAP/UseCase/ldap-test-3.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ ${LDAP_UTIL} delete && true
9494
# ${LDAP_UTIL} setup
9595
# ${LDAP_UTIL} policy "${TMPDIR}/policy.ldif"
9696

97-
sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
97+
sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \
98+
${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
99+
sleep 1
98100
RC=$?
99101
echo "RC == $RC"
100102

@@ -149,6 +151,12 @@ then
149151
sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf"
150152
fi
151153

154+
# Get stderr, signals, and exits from usbguard-daemon.
155+
if [ "${GREP1}" -ne "0" ]
156+
then
157+
grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log"
158+
fi
159+
152160
nss_restore
153161

154162
exit $(( $RC + $GREP1 + $GREP2 + $KILLRC ))

src/Tests/LDAP/UseCase/ldap-test-4.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ sudo -n service slapd stop
9898

9999
service slapd status
100100

101-
sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
101+
sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \
102+
${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
103+
sleep 1
102104
RC=$?
103105
echo "RC == $RC"
104106

@@ -151,6 +153,12 @@ then
151153
sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf"
152154
fi
153155

156+
# Get stderr, signals, and exits from usbguard-daemon.
157+
if [ "${GREP1}" -ne "0" ]
158+
then
159+
grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log"
160+
fi
161+
154162
nss_restore
155163

156164
sudo -n service slapd start

src/Tests/LDAP/UseCase/ldap-test-5.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ ${LDAP_UTIL} delete && true
145145
${LDAP_UTIL} setup
146146
${LDAP_UTIL} policy "${TMPDIR}/policy.ldif"
147147

148-
sudo -n ${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
148+
sudo -n strace -f -o "${TMPDIR}/debug.log" -s256 -e trace=write \
149+
${USBGUARD_DAEMON} -Pd -f -c $config_path 2> $TMPDIR/usbguard.log
150+
sleep 1
149151
RC=$?
150152
echo "RC == $RC"
151153

@@ -195,6 +197,12 @@ then
195197
sudo -n sh -c "cp ${TMPDIR}/usbguard-ldap.conf.back /etc/usbguard/usbguard-ldap.conf"
196198
fi
197199

200+
# Get stderr, signals, and exits from usbguard-daemon.
201+
if [ "${GREP1}" -ne "0" ]
202+
then
203+
grep 'write(2,\|SIG\|exit' "$TMPDIR/debug.log"
204+
fi
205+
198206
nss_restore
199207

200208
exit $(( $RC + $GREP + $KILLRC + $WC + $DIFF ))

0 commit comments

Comments
 (0)