Eliminate separate `nfdc create` step
refs #2906
Change-Id: I68b3a1af7d011006c473878c5946b8e68a754940
diff --git a/test_broadcast/broadcast-test.sh b/test_broadcast/broadcast-test.sh
index ebb1292..40e50ca 100755
--- a/test_broadcast/broadcast-test.sh
+++ b/test_broadcast/broadcast-test.sh
@@ -33,15 +33,12 @@
# set up forwarding on A
echo "setting up forwarding on A..."
nfdc set-strategy ndn:/test-bcast ndn:/localhost/nfd/strategy/broadcast
-faceid=$(nfdc create udp4://$IP4_B1 | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-nfdc add-nexthop -c 10 ndn:/test-bcast $faceid
-faceid=$(nfdc create udp4://$IP4_C1 | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-nfdc add-nexthop -c 20 ndn:/test-bcast $faceid
+nfdc add-nexthop -c 10 ndn:/test-bcast udp4://$IP4_B1
+nfdc add-nexthop -c 20 ndn:/test-bcast udp4://$IP4_C1
# set up forwarding on D
echo "setting up forwarding on D..."
-faceid=$(ssh $CTRL_D "nfdc create udp4://$IP4_A2" | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-ssh $CTRL_D "nfdc add-nexthop ndn:/test-bcast $faceid"
+ssh $CTRL_D "nfdc add-nexthop ndn:/test-bcast udp4://$IP4_A2"
# run ndn-traffic client on D
echo "running ndn-traffic client on D..."
diff --git a/test_interest_loop/add-nexthop.sh b/test_interest_loop/add-nexthop.sh
index c7bab48..363e84b 100755
--- a/test_interest_loop/add-nexthop.sh
+++ b/test_interest_loop/add-nexthop.sh
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
ipaddr=$1
strategy=$2
-faceid=$(nfdc create udp4://$ipaddr | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-nfdc add-nexthop ndn:/test-loop $faceid
+nfdc add-nexthop ndn:/test-loop udp4://$ipaddr
nfdc set-strategy ndn:/test-loop $strategy
diff --git a/test_localhop/hostB.sh b/test_localhop/hostB.sh
index 0244efe..4402d67 100755
--- a/test_localhop/hostB.sh
+++ b/test_localhop/hostB.sh
@@ -3,5 +3,4 @@
c_ipaddr=$2
sudo nfd &> $workdir/logs/nfd.log &
sleep 3
-faceid=$(nfdc create udp4://$c_ipaddr | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-nfdc add-nexthop ndn:/localhop $faceid
+nfdc add-nexthop ndn:/localhop udp4://$c_ipaddr
diff --git a/test_localhop/localhop-test.sh b/test_localhop/localhop-test.sh
index 61374d9..4c6d3d3 100755
--- a/test_localhop/localhop-test.sh
+++ b/test_localhop/localhop-test.sh
@@ -30,8 +30,7 @@
echo "starting nfd and adding nexthop of ndn:/localhop to B on host A..."
sudo nfd > logs/nfd.log 2>&1 &
sleep 3
-faceid=$(nfdc create udp4://$b_ipaddr | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-nfdc add-nexthop ndn:/localhop $faceid
+nfdc add-nexthop ndn:/localhop udp4://$b_ipaddr
if [[ $? -ne 0 ]]
then
echo "Fail to add nexthop of ndn:/localhop"
diff --git a/test_localhost_scope/out-B.sh b/test_localhost_scope/out-B.sh
index df0bf29..d0ec56a 100755
--- a/test_localhost_scope/out-B.sh
+++ b/test_localhost_scope/out-B.sh
@@ -1,18 +1,10 @@
#!/bin/bash
FACEURI=$1
-if ! CREATE=$(nfdc create $FACEURI)
-then
- return 1
-fi
-sleep 1
-
-FACEID=$(echo $CREATE | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-
-if ! output=$(nfdc add-nexthop ndn:/ $FACEID)
+if ! output=$(nfdc add-nexthop ndn:/ $FACEURI)
then
return 2
fi
-output=$(nfdc add-nexthop ndn:/localhost/test-out $FACEID 2>&1)
+output=$(nfdc add-nexthop ndn:/localhost/test-out $FACEURI 2>&1)
return 0
diff --git a/test_tcp_udp_tunnel/tcp-udp-tunnel-test.sh b/test_tcp_udp_tunnel/tcp-udp-tunnel-test.sh
index f565335..6b38177 100755
--- a/test_tcp_udp_tunnel/tcp-udp-tunnel-test.sh
+++ b/test_tcp_udp_tunnel/tcp-udp-tunnel-test.sh
@@ -38,14 +38,7 @@
# open a tunnel from host A to host D and set nexthop of ndn:/tunnel-test to D
echo "preparing tunnel..."
-faceid=$(nfdc create $1://$ipaddr | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//')
-if [[ -z $faceid ]]
-then
- echo "Fail to create face"
- clean_up
- exit 1
-fi
-nfdc add-nexthop ndn:/tunnel-test $faceid
+nfdc add-nexthop ndn:/tunnel-test $1://$ipaddr
# run ndn-traffic client
echo "running ndn-traffic client..."