blob: 5d500700ef6b12568ba83d45af03eab3a5d54061 [file] [log] [blame]
Hila Ben Abraham4c850f82014-06-22 20:24:34 -05001#!/usr/bin/env bash
2source ../multi-host.conf
3workdir=$(pwd)
4mkdir -p $workdir/logs
5testCase=$1
6testLog=$workdir/logs/hub_discovery.log
7
8# clean up - kill nfd
9clean_up() {
10 r=$(sudo killall nfd 2>&1)
11 sleep 2
12
13}
14
15echo "TEST STARTED" > $testLog
16
17# start nfd on localhost
18sudo nfd &> $workdir/logs/nfd.log &
19sleep 2
20
21# start nrd on localhost
22nrd &> $workdir/logs/nrd.log &
23sleep 2
24
25ndn-autoconfig-server udp4://10.63.18.1 &
26
27# set record for _ndn._udp.autoconfig-test.named-data.net => 10.63.18.2
28# set record for _ndn._udp.autoconfig-test.tmp._homehub._autoconf.named-data.net => 10.63.18.3
29sudo cp autoconfig-test.named-data.net.db /etc/bind/
30sudo cp named-data.net.db /etc/bind
31
32# configure local dns server
33sudo cp named.conf.local /etc/bind
34sudo service bind9 restart
35
36sleep 2
37
38ssh $IP4_B1 "$workdir/test-B-stage1.sh $workdir"
39if [[ $? -ne 0 ]]; then
40 echo "Stage 1: multicast discovery failed on node B" >> $testLog
41 clean_up
42 exit 1
43fi
44
45ssh $IP4_D1 "$workdir/test-D-stage2.sh $workdir"
46if [[ $? -ne 0 ]]; then
47 echo "Stage 2: DNS query with default suffix failed on node D" >> $testLog
48 clean_up
49exit 1
50fi
51
52ssh $IP4_D1 "$workdir/test-D-stage3.sh $workdir"
53if [[ $? -ne 0 ]]; then
54 echo "Stage 3: find home router failed on node D" >> $testLog
55 clean_up
56exit 1
57fi
58
59clean_up
60exit 0