- Merge #968: Replace the obsolescent fgrep with grep -F in tests.

This commit is contained in:
Yorgos Thessalonikefs 2023-11-27 16:43:59 +01:00
commit a2f0186427
11 changed files with 28 additions and 25 deletions

View file

@ -1,3 +1,6 @@
27 November 2023: Yorgos
- Merge #968: Replace the obsolescent fgrep with grep -F in tests.
27 November 2023: Wouter 27 November 2023: Wouter
- Fix #964: config.h.in~ backup file in release tar balls. - Fix #964: config.h.in~ backup file in release tar balls.

View file

@ -24,21 +24,21 @@ fi
(cd $PRE; find . -name "*.h" -print) >hlist (cd $PRE; find . -name "*.h" -print) >hlist
(cd $PRE; find . -name "*.c" -print) >>hlist (cd $PRE; find . -name "*.c" -print) >>hlist
# filter out config.h # filter out config.h
fgrep -v -e "config.h" hlist > ilist; mv ilist hlist grep -F -v -e "config.h" hlist > ilist; mv ilist hlist
fgrep -v -e "util/configparser" hlist > ilist; mv ilist hlist grep -F -v -e "util/configparser" hlist > ilist; mv ilist hlist
fgrep -v -e "util/configlexer" hlist > ilist; mv ilist hlist grep -F -v -e "util/configlexer" hlist > ilist; mv ilist hlist
fgrep -v -e "util/configyyrename" hlist > ilist; mv ilist hlist grep -F -v -e "util/configyyrename" hlist > ilist; mv ilist hlist
fgrep -v -e "util/locks.h" hlist > ilist; mv ilist hlist grep -F -v -e "util/locks.h" hlist > ilist; mv ilist hlist
fgrep -v -e "util/storage/lookup3.c" hlist > ilist; mv ilist hlist grep -F -v -e "util/storage/lookup3.c" hlist > ilist; mv ilist hlist
fgrep -v -e "ldns-src/" hlist > ilist; mv ilist hlist grep -F -v -e "ldns-src/" hlist > ilist; mv ilist hlist
fgrep -v -e "libunbound/python/libunbound_wrap.c" hlist > ilist; mv ilist hlist grep -F -v -e "libunbound/python/libunbound_wrap.c" hlist > ilist; mv ilist hlist
fgrep -v -e "pythonmod/interface.h" hlist > ilist; mv ilist hlist grep -F -v -e "pythonmod/interface.h" hlist > ilist; mv ilist hlist
fgrep -v -e "dnstap" hlist > ilist; mv ilist hlist grep -F -v -e "dnstap" hlist > ilist; mv ilist hlist
fgrep -v -e "util/siphash.c" hlist > ilist; mv ilist hlist grep -F -v -e "util/siphash.c" hlist > ilist; mv ilist hlist
# filter out compat # filter out compat
fgrep -v -e "compat/" hlist > ilist; mv ilist hlist grep -F -v -e "compat/" hlist > ilist; mv ilist hlist
for h in `cat hlist`; do for h in `cat hlist`; do
if fgrep "`basename $h`" $PRE/doc/html/files.html >/dev/null; then if grep -F "`basename $h`" $PRE/doc/html/files.html >/dev/null; then
: # ok : # ok
else else
echo "Warning: $h has no documentation." echo "Warning: $h has no documentation."

6
testdata/common.sh vendored
View file

@ -169,7 +169,7 @@ wait_server_up () {
local WAIT_THRES=30 local WAIT_THRES=30
local try local try
for (( try=0 ; try <= $MAX_UP_TRY ; try++ )) ; do for (( try=0 ; try <= $MAX_UP_TRY ; try++ )) ; do
if test -f $1 && fgrep "$2" $1 >/dev/null; then if test -f $1 && grep -F "$2" $1 >/dev/null; then
#echo "done on try $try" #echo "done on try $try"
break; break;
fi fi
@ -220,11 +220,11 @@ wait_server_up_or_fail () {
local WAIT_THRES=30 local WAIT_THRES=30
local try local try
for (( try=0 ; try <= $MAX_UP_TRY ; try++ )) ; do for (( try=0 ; try <= $MAX_UP_TRY ; try++ )) ; do
if test -f $1 && fgrep "$2" $1 >/dev/null; then if test -f $1 && grep -F "$2" $1 >/dev/null; then
echo "done on try $try" echo "done on try $try"
break; break;
fi fi
if test -f $1 && fgrep "$3" $1 >/dev/null; then if test -f $1 && grep -F "$3" $1 >/dev/null; then
echo "failed on try $try" echo "failed on try $try"
break; break;
fi fi

View file

@ -7,10 +7,10 @@
# do your teardown here # do your teardown here
. ../common.sh . ../common.sh
kill_pid $FWD_PID kill_pid $FWD_PID
if fgrep "service stopped" unbound.log; then if grep -F "service stopped" unbound.log; then
exit 0 exit 0
fi fi
if fgrep "disable interface-automatic" unbound.log; then if grep -F "disable interface-automatic" unbound.log; then
echo "skip test" echo "skip test"
exit 0 exit 0
fi fi

View file

@ -36,7 +36,7 @@ wait_ldns_testns_up fwd.log
# wait for unbound to come up # wait for unbound to come up
# string 'Start of service' in log. # string 'Start of service' in log.
wait_server_up_or_fail unbound.log "start of service" "disable interface-automatic" wait_server_up_or_fail unbound.log "start of service" "disable interface-automatic"
if fgrep "disable interface-automatic" unbound.log; then if grep -F "disable interface-automatic" unbound.log; then
skip_test "skip test" skip_test "skip test"
fi fi

View file

@ -7,7 +7,7 @@
PRE="../.." PRE="../.."
. ../common.sh . ../common.sh
if fgrep "disable interface-automatic" unbound.log; then if grep -F "disable interface-automatic" unbound.log; then
echo "skip test" echo "skip test"
exit 0 exit 0
fi fi

View file

@ -9,7 +9,7 @@
kill_pid $FWD_PID kill_pid $FWD_PID
# find all extra forked testns and kill them. # find all extra forked testns and kill them.
pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'` pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do for p in $pidlist; do
kill_pid $p kill_pid $p
done done

View file

@ -11,7 +11,7 @@
kill_pid $FWD_PID kill_pid $FWD_PID
# find all extra forked testns and kill them. # find all extra forked testns and kill them.
pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'` pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do for p in $pidlist; do
kill_pid $p kill_pid $p
done done

View file

@ -11,7 +11,7 @@
kill_pid $FWD_PID kill_pid $FWD_PID
# find all extra forked testns and kill them. # find all extra forked testns and kill them.
pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'` pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do for p in $pidlist; do
kill_pid $p kill_pid $p
done done

View file

@ -10,7 +10,7 @@
kill_pid $FWD_PID kill_pid $FWD_PID
# find all extra forked testns and kill them. # find all extra forked testns and kill them.
pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'` pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do for p in $pidlist; do
kill_pid $p kill_pid $p
done done

View file

@ -11,7 +11,7 @@
kill_pid $FWD_PID kill_pid $FWD_PID
# find all extra forked testns and kill them. # find all extra forked testns and kill them.
pidlist=`fgrep "forked pid:" fwd.log | sed -e 's/forked pid: //'` pidlist=`grep -F "forked pid:" fwd.log | sed -e 's/forked pid: //'`
for p in $pidlist; do for p in $pidlist; do
kill_pid $p kill_pid $p
done done