tests, radius-group: fix unstable tests

- print outfile instead of new command; this will help debug when an
  issue occurs, to know what was the original output
- also add some time between tests to avoid race; this was failing on
  "could not find group information"

  Established DTLS connection (using GnuTLS). Ciphersuite (DTLS1.2)-(PSK)-(AES-256-GCM).
      inet 192.168.93.190/32 scope global tun0
  PING 192.168.93.1 (192.168.93.1) 56(84) bytes of data.
  64 bytes from 192.168.93.1: icmp_seq=1 ttl=64 time=0.217 ms
  64 bytes from 192.168.93.1: icmp_seq=2 ttl=64 time=0.246 ms
  64 bytes from 192.168.93.1: icmp_seq=3 ttl=64 time=0.235 ms

  --- 192.168.93.1 ping statistics ---
  3 packets transmitted, 3 received, 0% packet loss, time 2052ms
  rtt min/avg/max/mdev = 0.217/0.232/0.246/0.011 ms

  could not find group information

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
This commit is contained in:
William Dauchy
2020-09-16 22:02:27 +02:00
committed by Nikos Mavrogiannopoulos
parent 80babceacf
commit 3ba9ebdab0

View File

@@ -106,7 +106,7 @@ if test $? != 0;then
exit 1
fi
sleep 3
sleep 6
${CMDNS1} ${IP} addr show|grep $(echo ${VPNADDR}|cut -d '.' -f 1-3)
if test $? != 0;then
@@ -125,7 +125,7 @@ MATCH="Groupname: group2"
${OCCTL} -s ${OCCTL_SOCKET} show user ${USERNAME} >${OUTFILE} 2>&1
grep "${MATCH}" ${OUTFILE}
if test $? != 0;then
${OCCTL} -s ${OCCTL_SOCKET} show user ${USERNAME}
cat ${OUTFILE}
echo "could not find group information"
exit 1
fi
@@ -143,7 +143,7 @@ if test $? != 0;then
exit 1
fi
sleep 3
sleep 6
${CMDNS1} ${IP} addr show|grep $(echo ${VPNADDR}|cut -d '.' -f 1-3)
if test $? != 0;then
@@ -156,7 +156,7 @@ MATCH="Groupname: group1"
${OCCTL} -s ${OCCTL_SOCKET} show user ${USERNAME} >${OUTFILE} 2>&1
grep "${MATCH}" ${OUTFILE}
if test $? != 0;then
${OCCTL} -s ${OCCTL_SOCKET} show user ${USERNAME}
cat ${OUTFILE}
echo "could not find group information"
exit 1
fi