Skip to content

Commit

Permalink
ofproto-dpif.at: Stop using not portable 'read -d'.
Browse files Browse the repository at this point in the history
'read -d' is a bash extention. Replace it with simple 'cat'.
This fixes 'select group' tests on FreeBSD.

CC: Jan Scheurich <jan.scheurich@ericsson.com>
Fixes: 06db81c ("ofproto-dpif: Use dp_hash as default selection method")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
igsilya authored and blp committed Dec 18, 2018
1 parent 75d7f41 commit 0304c43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ofproto-dpif.at
Expand Up @@ -410,7 +410,7 @@ AT_SETUP([ofproto-dpif - select group])
check_dpflow_stats () {
min_flows=$1
min_buckets=$2
read -d '' dpflows
dpflows=`cat`
hash_flow=`echo "$dpflows" | grep "actions:hash"`
n_flows=`echo "$dpflows" | grep -c dp_hash`
n_buckets=`echo "$dpflows" | grep dp_hash | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
Expand Down Expand Up @@ -480,7 +480,7 @@ AT_SETUP([ofproto-dpif - select group with weights])
check_dpflow_stats () {
min_flows=$1
min_buckets=$2
read -d '' dpflows
dpflows=`cat`
hash_flow=`echo "$dpflows" | grep "actions:hash"`
n_flows=`echo "$dpflows" | grep -c dp_hash`
n_buckets=`echo "$dpflows" | grep dp_hash | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
Expand Down Expand Up @@ -606,7 +606,7 @@ AT_SETUP([ofproto-dpif - select group with legacy hash selection method])
check_dpflow_stats () {
min_flows=$1
min_buckets=$2
read -d '' dpflows
dpflows=`cat`
n_flows=`echo "$dpflows" | wc -l`
n_buckets=`echo "$dpflows" | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
if [[ $n_flows -ge $min_flows ]]; then flows=ok; else flows=nok; fi
Expand Down Expand Up @@ -650,7 +650,7 @@ AT_SETUP([ofproto-dpif - select group with custom hash selection method])
check_dpflow_stats () {
min_flows=$1
min_buckets=$2
read -d '' dpflows
dpflows=`cat`
n_flows=`echo "$dpflows" | wc -l`
n_buckets=`echo "$dpflows" | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
if [[ $n_flows -ge $min_flows ]]; then flows=ok; else flows=nok; fi
Expand Down

0 comments on commit 0304c43

Please sign in to comment.