hub_discovery/nfdc: wait for fresh nfd-status output
NFD may cache StatusDataset for up to one second,
but we need fresh dataset to see changes.
refs #2501, #2502
Change-Id: I34b68ffc8d148c864c034f5fba340c8f8bc37228
diff --git a/test_nfdc/include.sh b/test_nfdc/include.sh
index 5f1c491..9ad43b5 100755
--- a/test_nfdc/include.sh
+++ b/test_nfdc/include.sh
@@ -35,6 +35,9 @@
counterType=$3
threshold=$4
+ # wait for the refreshed output of nfd-status
+ sleep 2
+
outCounter=$(nfd-status | grep -iF 'faceid='$faceId' remote='$faceUri | grep -Po $counterType={[0-9]+ | sed 's/'$counterType'={//')
@@ -58,6 +61,9 @@
faceId=$1
faceUri=$2
+ # wait for the refreshed output of nfd-status
+ sleep 2
+
# check for the existence of the face
# First, get the face line
# Second, extract the face id attached to the fetched line
@@ -97,6 +103,9 @@
exit 2
fi
+ # wait for the refreshed output of nfd-status
+ sleep 2
+
# check the existence of prefix FIB entry
fibEntry=$(nfd-status | grep $prefix)
if [[ -z "$fibEntry" ]]; then
@@ -117,4 +126,4 @@
clean_up
exit 2
fi
-}
\ No newline at end of file
+}