mirror of
https://repo.or.cz/socat.git
synced 2024-12-22 23:42:34 +00:00
Prevent the TIMESTAMP tests from sporadically failing due do seconds overflow
This commit is contained in:
parent
196d74752d
commit
dc7afeb0f5
2 changed files with 21 additions and 1 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
Testing:
|
||||||
|
Prevent the TIMESTAMP tests from sporadically failing due do seconds
|
||||||
|
overflow
|
||||||
|
|
||||||
####################### V 1.7.4.1:
|
####################### V 1.7.4.1:
|
||||||
|
|
||||||
Corrections:
|
Corrections:
|
||||||
|
|
18
test.sh
18
test.sh
|
@ -10361,7 +10361,15 @@ CMD0="$TRACE $SOCAT $opts -d -d -d -u $KEYW-RECV:$tra,reuseaddr,$SCM_RECV -"
|
||||||
CMD1="$TRACE $SOCAT $opts -u - $KEYW-SENDTO:$tsa,$SCM_ENABLE"
|
CMD1="$TRACE $SOCAT $opts -u - $KEYW-SENDTO:$tsa,$SCM_ENABLE"
|
||||||
printf "test $F_n $TEST... " $N
|
printf "test $F_n $TEST... " $N
|
||||||
# is this option supported?
|
# is this option supported?
|
||||||
if $TRACE $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then
|
if $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then
|
||||||
|
if [ "$SCM_VALUE" = "timestamp" ]; then
|
||||||
|
secs="$(date '+%S')"
|
||||||
|
if [ "$secs" -ge 58 -a "$secs" -le 59 ]; then
|
||||||
|
dsecs=$((60-secs))
|
||||||
|
#echo "Sleeping $dsecs seconds to avoid minute change in timestamp" >/dev/tty
|
||||||
|
sleep $dsecs
|
||||||
|
fi
|
||||||
|
fi
|
||||||
$CMD0 >"$tf" 2>"${te}0" &
|
$CMD0 >"$tf" 2>"${te}0" &
|
||||||
pid0="$!"
|
pid0="$!"
|
||||||
wait${proto}port $tra 1
|
wait${proto}port $tra 1
|
||||||
|
@ -10615,6 +10623,14 @@ CMD1="$TRACE $SOCAT $opts -u - $KEYW-SENDTO:$tsa,$SCM_ENABLE"
|
||||||
printf "test $F_n $TEST... " $N
|
printf "test $F_n $TEST... " $N
|
||||||
# is this option supported?
|
# is this option supported?
|
||||||
if $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then
|
if $SOCAT -hhh |grep "[[:space:]]$SCM_RECV[[:space:]]" >/dev/null; then
|
||||||
|
if [ "$SCM_VALUE" = "timestamp" ]; then
|
||||||
|
secs="$(date '+%S')"
|
||||||
|
if [ "$secs" -ge 58 -a "$secs" -le 59 ]; then
|
||||||
|
dsecs=$((60-secs))
|
||||||
|
#echo "Sleeping $dsecs seconds to avoid minute change in timestamp" >/dev/tty
|
||||||
|
sleep $dsecs
|
||||||
|
fi
|
||||||
|
fi
|
||||||
eval "$CMD0 >\"$tf\" 2>\"${te}0\" &"
|
eval "$CMD0 >\"$tf\" 2>\"${te}0\" &"
|
||||||
pid0="$!"
|
pid0="$!"
|
||||||
wait${proto}port $tra 1
|
wait${proto}port $tra 1
|
||||||
|
|
Loading…
Reference in a new issue