ofproto-dpif.at: Stop using not portable 'read -d'.
'read -d' is a bash extention. Replace it with simple 'cat'.
This fixes 'select group' tests on FreeBSD.
CC: Jan Scheurich
Fixes: ("ofproto-dpif: Use dp_hash as default selection method")
@@ -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`
@@ -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`
@@ -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
@@ -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
