remove use of deprecated nfdc syntax and update output processing
change all calls to nfd-status to nfdc
(except test_nfdc)
refs #4058
Change-Id: I4205602d180f5cb5c64e9883e79d5deb518533ad
diff --git a/test_route_expiration/README.md b/test_route_expiration/README.md
index 8642bc3..0a7fd3e 100644
--- a/test_route_expiration/README.md
+++ b/test_route_expiration/README.md
@@ -11,21 +11,21 @@
ndn:/R , nexthop=hostC, expiration=10s
ndn:/S , nexthop=hostB, expiration=3600s
-3. Delay 5 seconds; run nfd-status on A to inspect RIB
+3. Delay 5 seconds; run nfdc route list on A to inspect RIB
Expected routes:
ndn:/P (hostB expires in 3-8s, hostC expires in 13-18s)
ndn:/Q (hostB expires in 13-18s)
ndn:/R (hostC expires in 3-8s)
ndn:/S (hostB expires in >3000s)
-4. Delay 10 seconds; run nfd-status on A to inspect RIB
+4. Delay 10 seconds; run nfdc route list on A to inspect RIB
Expected routes:
ndn:/P (hostC expires in 3-8s)
ndn:/Q (hostB expires in 3-8s)
ndn:/R : entry does not exist
ndn:/S (hostB expires in >3000s)
-5. Delay 8 seconds; run nfd-status on A to inspect RIB
+5. Delay 8 seconds; run nfdc route list on A to inspect RIB
Expected routes:
ndn:/P : entry does not exist
ndn:/Q : entry does not exist
diff --git a/test_route_expiration/include.sh b/test_route_expiration/include.sh
index 281e8f1..b767926 100644
--- a/test_route_expiration/include.sh
+++ b/test_route_expiration/include.sh
@@ -20,12 +20,19 @@
exit 0
}
+create_face() {
+ nextHop=$1
+
+ result=$(nfdc face create udp4://$nextHop)
+ echo $result
+}
+
register() {
name=$1
expirationPeriod=$2
nextHop=$3
- result=$(nfdc register -e $(($expirationPeriod * 1000)) $name udp4://$nextHop | grep -o 'FaceId: [0-9]*' | sed s/'FaceId: '//)
+ result=$(nfdc route add $name udp4://$nextHop expires $(($expirationPeriod * 1000)) | grep -o 'nexthop=[0-9]*' | sed s/'nexthop='//)
echo $result
}
@@ -35,7 +42,7 @@
lowerBound=$3
upperBound=$4
- expirationPeriod=$(nfd-status -r | grep -iF ''$name'' | grep -o 'faceid='$nextHop' ([a-zA-Z0-9 =]*)' |\
+ expirationPeriod=$(nfdc route list | grep -iF ''$name'' | grep 'nexthop='$nextHop'' |\
grep -o 'expires=[0-9]*' | sed 's/'expires='//')
if [[ "$expirationPeriod" -lt $lowerBound || "$expirationPeriod" -gt $upperBound ]]; then
@@ -49,7 +56,7 @@
expect_entry_does_not_exist() {
name=$1
- count=$(nfd-status -r | grep -c ' $name ')
+ count=$(nfdc route list | grep -c '$name ')
if [[ $count -gt 0 ]]; then
echo $name "exists past its expected expiration period."
@@ -61,19 +68,19 @@
expect_route_does_not_exist() {
name=$1
- faceId=$2
+ nexthop=$2
- count=$(nfd-status -r | grep -iF ''$name'' | grep -c 'faceid='$faceId'')
+ count=$(nfdc route list | grep -iF ''$name'' | grep -c 'nexthop='$nexthop'')
if [[ $count -gt 0 ]]; then
- echo "Route for $name with FaceId: $faceId exists past its expected expiration period."
+ echo "Route for $name with nexthop=$nexthop exists past its expected expiration period."
exit 2
else
- echo "Route for $name with FaceId: $faceId has expired successfully"
+ echo "Route for $name with nexthop=$nexthop has expired successfully"
fi
}
sleep_for_seconds() {
echo -e "Sleeping for $1 seconds...\n"
sleep $1
-}
\ No newline at end of file
+}
diff --git a/test_route_expiration/route-expiration-test.sh b/test_route_expiration/route-expiration-test.sh
index 42361a5..4cdd6bf 100755
--- a/test_route_expiration/route-expiration-test.sh
+++ b/test_route_expiration/route-expiration-test.sh
@@ -7,6 +7,11 @@
set_up
+echo "Creating faces..."
+
+create_face $HOST_B
+create_face $HOST_C
+
echo "Registering routes..."
P_TO_B_FACE=$(register "/P" 10 $HOST_B)