blob: 62a0445862903af2a6aaca1904698d3a6a6e8ebe [file] [log] [blame]
#!/usr/bin/env bash
source ../multi-host.conf
workdir=$(pwd)
mkdir -p $workdir/logs
testCase=$1
testLog=$workdir/logs/hub_discovery.log
# clean up - kill nfd
clean_up() {
r=$(sudo killall nfd 2>&1)
sleep 2
}
echo "TEST STARTED" > $testLog
# start nfd on localhost
sudo nfd &> $workdir/logs/nfd.log &
sleep 2
ndn-autoconfig-server udp4://10.63.18.1 &
# set record for _ndn._udp.autoconfig-test.named-data.net => 10.63.18.2
# set record for _ndn._udp.autoconfig-test.tmp._homehub._autoconf.named-data.net => 10.63.18.3
sudo cp autoconfig-test.named-data.net.db /etc/bind/
sudo cp named-data.net.db /etc/bind
# configure local dns server
sudo cp named.conf.local /etc/bind
sudo service bind9 restart
sleep 2
ssh $CTRL_B "$workdir/test-B-stage1.sh $workdir"
if [[ $? -ne 0 ]]; then
echo "Stage 1: multicast discovery failed on node B" >> $testLog
clean_up
exit 1
fi
ssh $CTRL_D "$workdir/test-D-stage2.sh $workdir"
if [[ $? -ne 0 ]]; then
echo "Stage 2: DNS query with default suffix failed on node D" >> $testLog
clean_up
exit 1
fi
ssh $CTRL_D "$workdir/test-D-stage3.sh $workdir"
if [[ $? -ne 0 ]]; then
echo "Stage 3: find home router failed on node D" >> $testLog
clean_up
exit 1
fi
clean_up
exit 0