Skip to content

Commit

Permalink
- Merge #968: Replace the obsolescent fgrep with grep -F in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gthess committed Nov 27, 2023
2 parents 58d670a + ca88669 commit a2f0186
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 25 deletions.
3 changes: 3 additions & 0 deletions doc/Changelog
@@ -1,3 +1,6 @@
27 November 2023: Yorgos
- Merge #968: Replace the obsolescent fgrep with grep -F in tests.

27 November 2023: Wouter
- Fix #964: config.h.in~ backup file in release tar balls.

Expand Down
26 changes: 13 additions & 13 deletions testdata/01-doc.tdir/01-doc.test
Expand Up @@ -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."
Expand Down
6 changes: 3 additions & 3 deletions testdata/common.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions testdata/fwd_ancil.tdir/fwd_ancil.post
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/fwd_ancil.tdir/fwd_ancil.pre
Expand Up @@ -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

2 changes: 1 addition & 1 deletion testdata/fwd_ancil.tdir/fwd_ancil.test
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/fwd_oneport.tdir/fwd_oneport.post
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/fwd_three.tdir/fwd_three.post
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/fwd_three_service.tdir/fwd_three_service.post
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/fwd_udptmout.tdir/fwd_udptmout.post
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/fwd_waitudp.tdir/fwd_waitudp.post
Expand Up @@ -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
Expand Down

0 comments on commit a2f0186

Please sign in to comment.