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_hub_discovery/test-B-stage1.sh b/test_hub_discovery/test-B-stage1.sh
index e88d216..476b933 100755
--- a/test_hub_discovery/test-B-stage1.sh
+++ b/test_hub_discovery/test-B-stage1.sh
@@ -13,9 +13,6 @@
sudo nfd &> $workdir/logs/nfd.log &
sleep 2
-nrd &> $workdir/logs/nrd.log &
-sleep 2
-
ndnsec-keygen /tmp/autoconfig-test | ndnsec-install-cert -
sudo cp /etc/resolv.conf resolv.conf.bak
echo "nameserver $IP4_A1" > resolv.conf
@@ -25,6 +22,7 @@
sudo cat /etc/resolv.conf >> $testLog
ndn-autoconfig
+sleep 2
# search output for 10.63.18.1, fail if not found
face=$(nfd-status -f | grep -F remote=udp4://10.63.18.1)
diff --git a/test_hub_discovery/test-D-stage2.sh b/test_hub_discovery/test-D-stage2.sh
index 2305cfc..c3d95cc 100755
--- a/test_hub_discovery/test-D-stage2.sh
+++ b/test_hub_discovery/test-D-stage2.sh
@@ -13,9 +13,6 @@
sudo nfd &> $workdir/logs/nfd.log &
sleep 2
-nrd &> $workdir/logs/nrd.log &
-sleep 2
-
####### TEST STAGE 2 #######
ndnsec-keygen /tmp/autoconfig-test | ndnsec-install-cert -
diff --git a/test_hub_discovery/test-D-stage3.sh b/test_hub_discovery/test-D-stage3.sh
index dceb171..74ffebd 100755
--- a/test_hub_discovery/test-D-stage3.sh
+++ b/test_hub_discovery/test-D-stage3.sh
@@ -13,9 +13,6 @@
sudo nfd &> $workdir/logs/nfd.log &
sleep 2
-nrd &> $workdir/logs/nrd.log &
-sleep 2
-
####### TEST STAGE 3 #######
ndnsec-keygen /tmp/autoconfig-test | ndnsec-install-cert -
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
+}
diff --git a/test_nfdc/nfdc-test.sh b/test_nfdc/nfdc-test.sh
index 24966cd..9c49198 100755
--- a/test_nfdc/nfdc-test.sh
+++ b/test_nfdc/nfdc-test.sh
@@ -139,6 +139,9 @@
# invoke nfdc to remove the nexthop for created FaceId
removeNextHop=$(nfdc remove-nexthop ndn:/test-nfdc $faceId)
+ #wait for the refreshed output of nfd-status
+ sleep 2
+
# check the existence of ndn:/test-nfdc FIB entry
fibEntry=$(nfd-status | grep /test-nfdc)
if [ ! -z "$fibEntry" ]; then
@@ -165,7 +168,7 @@
# Invoke nfdc to unregister the prefix
unregisterPrefix=$(nfdc unregister ndn:/test-nfdc $faceId)
-
+ sleep 2
# check the existence of ndn:/test-nfdc FIB entry
fibEntry=$(nfd-status | grep /test-nfdc)
if [ ! -z "$fibEntry" ]; then