Test: expecteof_netconf use fix string grep, fix err funciton call-by-value

This commit is contained in:
Olof hagsand 2022-09-19 14:39:06 +02:00
parent 51d1a2d41c
commit 3b58d010a3

View file

@ -420,6 +420,8 @@ fi
# Assumes: $dir and $expect are set # Assumes: $dir and $expect are set
# see err1 # see err1
function err(){ function err(){
expect=$1
ret=$2
echo -e "\e[31m\nError in Test$testnr [$testname]:" echo -e "\e[31m\nError in Test$testnr [$testname]:"
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
echo "Expected: $1" echo "Expected: $1"
@ -891,7 +893,10 @@ EOF
else else
while read i while read i
do do
r=$(echo "$ret" | grep --null -Go "$i") # -F fixed strings
# -G basic regexp
# r=$(echo "$ret" | grep --null -Go "$i")
r=$(echo "$ret" | grep --null -Fo "$i")
match=$? match=$?
if [ $match -ne 0 ]; then if [ $match -ne 0 ]; then
err "$expectenc" "$ret" err "$expectenc" "$ret"