mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
Replace fgrep and egrep with grep -F/-E
GNU Grep 3.8 reports the following warnings:
egrep: warning: egrep is obsolescent; using grep -E
fgrep: warning: fgrep is obsolescent; using grep -F
(cherry picked from commit 212c4de043
)
This commit is contained in:
committed by
Ondřej Surý
parent
55a866355b
commit
a7e2cc5dec
@@ -1047,7 +1047,7 @@ END
|
|||||||
for i in 0 1 2 3 4 5 6 7 8 9; do
|
for i in 0 1 2 3 4 5 6 7 8 9; do
|
||||||
ret=0
|
ret=0
|
||||||
$DIG $DIGOPTS axfr secure-to-insecure.example @10.53.0.3 > dig.out.ns3.test$n || ret=1
|
$DIG $DIGOPTS axfr secure-to-insecure.example @10.53.0.3 > dig.out.ns3.test$n || ret=1
|
||||||
egrep '(RRSIG|DNSKEY|NSEC)' dig.out.ns3.test$n > /dev/null && ret=1
|
grep -E '(RRSIG|DNSKEY|NSEC)' dig.out.ns3.test$n > /dev/null && ret=1
|
||||||
[ $ret -eq 0 ] && break
|
[ $ret -eq 0 ] && break
|
||||||
echo_i "waiting ... ($i)"
|
echo_i "waiting ... ($i)"
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -1066,7 +1066,7 @@ $SETTIME -I now -D now $file > settime.out.test$n.2 || ret=1
|
|||||||
for i in 0 1 2 3 4 5 6 7 8 9; do
|
for i in 0 1 2 3 4 5 6 7 8 9; do
|
||||||
ret=0
|
ret=0
|
||||||
$DIG $DIGOPTS axfr secure-to-insecure2.example @10.53.0.3 > dig.out.ns3.test$n || ret=1
|
$DIG $DIGOPTS axfr secure-to-insecure2.example @10.53.0.3 > dig.out.ns3.test$n || ret=1
|
||||||
egrep '(RRSIG|DNSKEY|NSEC3)' dig.out.ns3.test$n > /dev/null && ret=1
|
grep -E '(RRSIG|DNSKEY|NSEC3)' dig.out.ns3.test$n > /dev/null && ret=1
|
||||||
[ $ret -eq 0 ] && break
|
[ $ret -eq 0 ] && break
|
||||||
echo_i "waiting ... ($i)"
|
echo_i "waiting ... ($i)"
|
||||||
sleep 2
|
sleep 2
|
||||||
|
@@ -166,14 +166,14 @@ n=`expr $n + 1`
|
|||||||
ret=0
|
ret=0
|
||||||
echo_i "Checking that default version works for rndc ($n)"
|
echo_i "Checking that default version works for rndc ($n)"
|
||||||
$RNDCCMD 10.53.0.1 status > rndc.status.ns1.$n 2>&1
|
$RNDCCMD 10.53.0.1 status > rndc.status.ns1.$n 2>&1
|
||||||
fgrep "version: $BIND_VERSION_STRING" rndc.status.ns1.$n > /dev/null || ret=1
|
grep -F "version: $BIND_VERSION_STRING" rndc.status.ns1.$n > /dev/null || ret=1
|
||||||
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
|
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
|
||||||
|
|
||||||
n=`expr $n + 1`
|
n=`expr $n + 1`
|
||||||
ret=0
|
ret=0
|
||||||
echo_i "Checking that custom version works for rndc ($n)"
|
echo_i "Checking that custom version works for rndc ($n)"
|
||||||
$RNDCCMD 10.53.0.3 status > rndc.status.ns3.$n 2>&1
|
$RNDCCMD 10.53.0.3 status > rndc.status.ns3.$n 2>&1
|
||||||
fgrep "version: $BIND_VERSION_STRING (this is a test of version)" rndc.status.ns3.$n > /dev/null || ret=1
|
grep -F "version: $BIND_VERSION_STRING (this is a test of version)" rndc.status.ns3.$n > /dev/null || ret=1
|
||||||
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
|
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
|
||||||
|
|
||||||
n=`expr $n + 1`
|
n=`expr $n + 1`
|
||||||
|
@@ -108,7 +108,7 @@ echo_i "reset and check that records are correctly cached initially ($n)"
|
|||||||
ret=0
|
ret=0
|
||||||
load_cache
|
load_cache
|
||||||
dump_cache
|
dump_cache
|
||||||
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | egrep '(TXT|ANY)' | wc -l`
|
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -E '(TXT|ANY)' | wc -l`
|
||||||
[ $nrecords -eq 18 ] || { ret=1; echo_i "found $nrecords records expected 18"; }
|
[ $nrecords -eq 18 ] || { ret=1; echo_i "found $nrecords records expected 18"; }
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
@@ -202,7 +202,7 @@ n=`expr $n + 1`
|
|||||||
echo_i "check the number of cached records remaining ($n)"
|
echo_i "check the number of cached records remaining ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
dump_cache
|
dump_cache
|
||||||
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -v '^;' | egrep '(TXT|ANY)' | wc -l`
|
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -v '^;' | grep -E '(TXT|ANY)' | wc -l`
|
||||||
[ $nrecords -eq 17 ] || { ret=1; echo_i "found $nrecords records expected 17"; }
|
[ $nrecords -eq 17 ] || { ret=1; echo_i "found $nrecords records expected 17"; }
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
@@ -220,7 +220,7 @@ n=`expr $n + 1`
|
|||||||
echo_i "check the number of cached records remaining ($n)"
|
echo_i "check the number of cached records remaining ($n)"
|
||||||
ret=0
|
ret=0
|
||||||
dump_cache
|
dump_cache
|
||||||
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | egrep '(TXT|ANY)' | wc -l`
|
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -E '(TXT|ANY)' | wc -l`
|
||||||
[ $nrecords -eq 1 ] || { ret=1; echo_i "found $nrecords records expected 1"; }
|
[ $nrecords -eq 1 ] || { ret=1; echo_i "found $nrecords records expected 1"; }
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
|
@@ -42,7 +42,7 @@ testcase() {
|
|||||||
|
|
||||||
check_stderr() {
|
check_stderr() {
|
||||||
if [ -n "${err:=}" ]; then
|
if [ -n "${err:=}" ]; then
|
||||||
egrep "$err" err.$n >/dev/null && return 0
|
grep -E "$err" err.$n >/dev/null && return 0
|
||||||
echo_d "stderr did not match '$err'"
|
echo_d "stderr did not match '$err'"
|
||||||
else
|
else
|
||||||
[ -s err.$n ] || return 0
|
[ -s err.$n ] || return 0
|
||||||
|
@@ -500,7 +500,7 @@ _search_log() (
|
|||||||
nextpart "$file" | grep -F -e "$msg" > /dev/null
|
nextpart "$file" | grep -F -e "$msg" > /dev/null
|
||||||
)
|
)
|
||||||
|
|
||||||
# _search_log_re: same as _search_log but the message is an egrep regex
|
# _search_log_re: same as _search_log but the message is an grep -E regex
|
||||||
_search_log_re() (
|
_search_log_re() (
|
||||||
msg="$1"
|
msg="$1"
|
||||||
file="$2"
|
file="$2"
|
||||||
@@ -528,7 +528,7 @@ wait_for_log() (
|
|||||||
return 1
|
return 1
|
||||||
)
|
)
|
||||||
|
|
||||||
# wait_for_log_re: same as wait_for_log, but the message is an egrep regex
|
# wait_for_log_re: same as wait_for_log, but the message is an grep -E regex
|
||||||
wait_for_log_re() (
|
wait_for_log_re() (
|
||||||
timeout="$1"
|
timeout="$1"
|
||||||
msg="$2"
|
msg="$2"
|
||||||
|
@@ -45,7 +45,7 @@ EOF
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
out=`$DIG $DIGOPTS -t $type -q $host | egrep "^$host"`
|
out=`$DIG $DIGOPTS -t $type -q $host | grep -E "^$host"`
|
||||||
lines=`echo "$out" | grep "$digout" | wc -l`
|
lines=`echo "$out" | grep "$digout" | wc -l`
|
||||||
[ $lines -eq 1 ] || {
|
[ $lines -eq 1 ] || {
|
||||||
[ "$should_fail" ] || \
|
[ "$should_fail" ] || \
|
||||||
|
@@ -1194,7 +1194,7 @@ wait_until_raw_zone_update_is_processed() {
|
|||||||
zone="$1"
|
zone="$1"
|
||||||
for i in 1 2 3 4 5 6 7 8 9 10
|
for i in 1 2 3 4 5 6 7 8 9 10
|
||||||
do
|
do
|
||||||
if nextpart ns3/named.run | egrep "zone ${zone}.*(sending notifies|receive_secure_serial)" > /dev/null; then
|
if nextpart ns3/named.run | grep -E "zone ${zone}.*(sending notifies|receive_secure_serial)" > /dev/null; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
|
@@ -91,7 +91,7 @@ echo_i "checking that standby KSK did not sign but is delegated ($n)"
|
|||||||
ret=0
|
ret=0
|
||||||
grep " $rolling"'$' sigs > /dev/null && ret=1
|
grep " $rolling"'$' sigs > /dev/null && ret=1
|
||||||
grep " $rolling"'$' keys > /dev/null || ret=1
|
grep " $rolling"'$' keys > /dev/null || ret=1
|
||||||
egrep "DS[ ]*$rolling[ ]" ${pfile}.signed > /dev/null || ret=1
|
grep -E "DS[ ]*$rolling[ ]" ${pfile}.signed > /dev/null || ret=1
|
||||||
n=$((n + 1))
|
n=$((n + 1))
|
||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status + ret))
|
status=$((status + ret))
|
||||||
|
@@ -43,7 +43,7 @@ copy_setports ns7/named.conf.in ns7/named.conf
|
|||||||
make_key () {
|
make_key () {
|
||||||
$RNDCCONFGEN -k key$1 -A $3 -s 10.53.0.4 -p $2 \
|
$RNDCCONFGEN -k key$1 -A $3 -s 10.53.0.4 -p $2 \
|
||||||
> ns4/key${1}.conf 2> /dev/null
|
> ns4/key${1}.conf 2> /dev/null
|
||||||
egrep -v '(^# Start|^# End|^# Use|^[^#])' ns4/key$1.conf | cut -c3- | \
|
grep -E -v '(^# Start|^# End|^# Use|^[^#])' ns4/key$1.conf | cut -c3- | \
|
||||||
sed 's/allow { 10.53.0.4/allow { any/' >> ns4/named.conf
|
sed 's/allow { 10.53.0.4/allow { any/' >> ns4/named.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -829,10 +829,10 @@ EOF
|
|||||||
|
|
||||||
# look for complaints from lib/dns/rpz.c and bin/name/query.c
|
# look for complaints from lib/dns/rpz.c and bin/name/query.c
|
||||||
for runfile in ns*/named.run; do
|
for runfile in ns*/named.run; do
|
||||||
EMSGS=`nextpart $runfile | egrep -l 'invalid rpz|rpz.*failed'`
|
EMSGS=`nextpart $runfile | grep -E -l 'invalid rpz|rpz.*failed'`
|
||||||
if test -n "$EMSGS"; then
|
if test -n "$EMSGS"; then
|
||||||
setret "error messages in $runfile starting with:"
|
setret "error messages in $runfile starting with:"
|
||||||
egrep 'invalid rpz|rpz.*failed' ns*/named.run | \
|
grep -E 'invalid rpz|rpz.*failed' ns*/named.run | \
|
||||||
sed -e '10,$d' -e 's/^//' | cat_i
|
sed -e '10,$d' -e 's/^//' | cat_i
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@@ -108,14 +108,14 @@ ck_result() {
|
|||||||
# wait to the background mdig calls to complete.
|
# wait to the background mdig calls to complete.
|
||||||
wait
|
wait
|
||||||
BAD=no
|
BAD=no
|
||||||
ADDRS=`egrep "^$2$" mdig.out-$1 2>/dev/null | wc -l`
|
ADDRS=`grep -E "^$2$" mdig.out-$1 2>/dev/null | wc -l`
|
||||||
# count simple truncated and truncated NXDOMAIN as TC
|
# count simple truncated and truncated NXDOMAIN as TC
|
||||||
TC=`egrep "^TC|NXDOMAINTC$" mdig.out-$1 2>/dev/null | wc -l`
|
TC=`grep -E "^TC|NXDOMAINTC$" mdig.out-$1 2>/dev/null | wc -l`
|
||||||
DROP=`egrep "^drop$" mdig.out-$1 2>/dev/null | wc -l`
|
DROP=`grep -E "^drop$" mdig.out-$1 2>/dev/null | wc -l`
|
||||||
# count NXDOMAIN and truncated NXDOMAIN as NXDOMAIN
|
# count NXDOMAIN and truncated NXDOMAIN as NXDOMAIN
|
||||||
NXDOMAIN=`egrep "^NXDOMAIN|NXDOMAINTC$" mdig.out-$1 2>/dev/null | wc -l`
|
NXDOMAIN=`grep -E "^NXDOMAIN|NXDOMAINTC$" mdig.out-$1 2>/dev/null | wc -l`
|
||||||
SERVFAIL=`egrep "^SERVFAIL$" mdig.out-$1 2>/dev/null | wc -l`
|
SERVFAIL=`grep -E "^SERVFAIL$" mdig.out-$1 2>/dev/null | wc -l`
|
||||||
NOERROR=`egrep "^NOERROR$" mdig.out-$1 2>/dev/null | wc -l`
|
NOERROR=`grep -E "^NOERROR$" mdig.out-$1 2>/dev/null | wc -l`
|
||||||
|
|
||||||
range $ADDRS "$3" 1 ||
|
range $ADDRS "$3" 1 ||
|
||||||
setret "$ADDRS instead of $3 '$2' responses for $1" &&
|
setret "$ADDRS instead of $3 '$2' responses for $1" &&
|
||||||
|
@@ -38,13 +38,13 @@ b.example. 300 IN A 10.53.0.$n
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.2 | sed 1q | \
|
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.2 | sed 1q | \
|
||||||
egrep '10.53.0.(2|3)$' > test2.out &&
|
grep -E '10.53.0.(2|3)$' > test2.out &&
|
||||||
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.3 | sed 1q | \
|
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.3 | sed 1q | \
|
||||||
egrep '10.53.0.(2|3)$' >> test2.out &&
|
grep -E '10.53.0.(2|3)$' >> test2.out &&
|
||||||
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.4 | sed 1q | \
|
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.4 | sed 1q | \
|
||||||
egrep '10.53.0.4$' >> test2.out &&
|
grep -E '10.53.0.4$' >> test2.out &&
|
||||||
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.5 | sed 1q | \
|
$DIG $DIGOPTS b.example. @10.53.0.1 -b 10.53.0.5 | sed 1q | \
|
||||||
egrep '10.53.0.5$' >> test2.out || status=1
|
grep -E '10.53.0.5$' >> test2.out || status=1
|
||||||
|
|
||||||
echo_i "exit status: $status"
|
echo_i "exit status: $status"
|
||||||
[ $status -eq 0 ] || exit 1
|
[ $status -eq 0 ] || exit 1
|
||||||
|
@@ -54,7 +54,7 @@ EOF
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
out=`$DIG $DIGOPTS -t $type -q $host | egrep "^${host}"`
|
out=`$DIG $DIGOPTS -t $type -q $host | grep -E "^${host}"`
|
||||||
lines=`echo "$out" | grep "$digout" | wc -l`
|
lines=`echo "$out" | grep "$digout" | wc -l`
|
||||||
[ $lines -eq 1 ] || {
|
[ $lines -eq 1 ] || {
|
||||||
echo_i "dig output incorrect for $host $type $cmd: $out"
|
echo_i "dig output incorrect for $host $type $cmd: $out"
|
||||||
|
Reference in New Issue
Block a user