blob: 62a0445862903af2a6aaca1904698d3a6a6e8ebe [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
Hila Ben Abraham4c850f82014-06-22 20:24:34 -050021ndn-autoconfig-server udp4://10.63.18.1 &
22
23# set record for _ndn._udp.autoconfig-test.named-data.net => 10.63.18.2
24# set record for _ndn._udp.autoconfig-test.tmp._homehub._autoconf.named-data.net => 10.63.18.3
25sudo cp autoconfig-test.named-data.net.db /etc/bind/
26sudo cp named-data.net.db /etc/bind
27
28# configure local dns server
29sudo cp named.conf.local /etc/bind
30sudo service bind9 restart
31
32sleep 2
33
Hila Ben Abrahamd5033e92015-01-15 20:30:55 -060034ssh $CTRL_B "$workdir/test-B-stage1.sh $workdir"
Hila Ben Abraham4c850f82014-06-22 20:24:34 -050035if [[ $? -ne 0 ]]; then
36 echo "Stage 1: multicast discovery failed on node B" >> $testLog
37 clean_up
38 exit 1
39fi
40
Hila Ben Abrahamd5033e92015-01-15 20:30:55 -060041ssh $CTRL_D "$workdir/test-D-stage2.sh $workdir"
Hila Ben Abraham4c850f82014-06-22 20:24:34 -050042if [[ $? -ne 0 ]]; then
43 echo "Stage 2: DNS query with default suffix failed on node D" >> $testLog
44 clean_up
45exit 1
46fi
47
Hila Ben Abrahamd5033e92015-01-15 20:30:55 -060048ssh $CTRL_D "$workdir/test-D-stage3.sh $workdir"
Hila Ben Abraham4c850f82014-06-22 20:24:34 -050049if [[ $? -ne 0 ]]; then
50 echo "Stage 3: find home router failed on node D" >> $testLog
51 clean_up
52exit 1
53fi
54
55clean_up
56exit 0