- Replace the obsolescent fgrep with grep -F in tests.

This commit is contained in:
Yorgos Thessalonikefs 2023-11-24 15:51:17 +01:00
parent 15a9b0f2be
commit ca88669435
10 changed files with 25 additions and 25 deletions

View File

@ -24,21 +24,21 @@ fi
(cd $PRE; find . -name "*.h" -print) >hlist
(cd $PRE; find . -name "*.c" -print) >>hlist
# filter out config.h
fgrep -v -e "config.h" hlist > ilist; mv ilist hlist
fgrep -v -e "util/configparser" hlist > ilist; mv ilist hlist
fgrep -v -e "util/configlexer" hlist > ilist; mv ilist hlist
fgrep -v -e "util/configyyrename" hlist > ilist; mv ilist hlist
fgrep -v -e "util/locks.h" hlist > ilist; mv ilist hlist
fgrep -v -e "util/storage/lookup3.c" hlist > ilist; mv ilist hlist
fgrep -v -e "ldns-src/" hlist > ilist; mv ilist hlist
fgrep -v -e "libunbound/python/libunbound_wrap.c" hlist > ilist; mv ilist hlist
fgrep -v -e "pythonmod/interface.h" hlist > ilist; mv ilist hlist
fgrep -v -e "dnstap" hlist > ilist; mv ilist hlist
fgrep -v -e "util/siphash.c" hlist > ilist; mv ilist hlist
grep -F -v -e "config.h" hlist > ilist; mv ilist hlist
grep -F -v -e "util/configparser" hlist > ilist; mv ilist hlist
grep -F -v -e "util/configlexer" hlist > ilist; mv ilist hlist
grep -F -v -e "util/configyyrename" hlist > ilist; mv ilist hlist
grep -F -v -e "util/locks.h" hlist > ilist; mv ilist hlist
grep -F -v -e "util/storage/lookup3.c" hlist > ilist; mv ilist hlist
grep -F -v -e "ldns-src/" hlist > ilist; mv ilist hlist
grep -F -v -e "libunbound/python/libunbound_wrap.c" hlist > ilist; mv ilist hlist
grep -F -v -e "pythonmod/interface.h" hlist > ilist; mv ilist hlist
grep -F -v -e "dnstap" hlist > ilist; mv ilist hlist
grep -F -v -e "util/siphash.c" hlist > ilist; mv ilist hlist
# 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
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
else
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 try
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"
break;
fi
@ -220,11 +220,11 @@ wait_server_up_or_fail () {
local WAIT_THRES=30
local try
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"
break;
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"
break;
fi

View File

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

View File

@ -36,7 +36,7 @@ wait_ldns_testns_up fwd.log
# wait for unbound to come up
# string 'Start of service' in log.
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"
fi

View File

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

View File

@ -9,7 +9,7 @@
kill_pid $FWD_PID
# 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
kill_pid $p
done

View File

@ -11,7 +11,7 @@
kill_pid $FWD_PID
# 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
kill_pid $p
done

View File

@ -11,7 +11,7 @@
kill_pid $FWD_PID
# 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
kill_pid $p
done

View File

@ -10,7 +10,7 @@
kill_pid $FWD_PID
# 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
kill_pid $p
done

View File

@ -11,7 +11,7 @@
kill_pid $FWD_PID
# 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
kill_pid $p
done