aboutsummaryrefslogtreecommitdiffstats
path: root/autoscan/tests/test_autoscan.sh
blob: bea2c3472cd023fb8478b21c533c285b040276f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

err() {
	echo "ERROR: $1"
	exit 1
}

export PATH="./spoofbin/:$PATH"

../autoscan.py -f -o test_output/ -r eth0 ||err "autoscan execution failed"

# XXX test output dirs
dir="test_output/$(ls -1 test_output |tail -n1)"
[[ $(cat $dir/route/gw) = "10.137.2.1" ]] ||err "route/gw"
[[ $(cat $dir/ifconfig/ip4) = "10.137.2.9" ]] ||err "ifconfig/ip4"
[[ $(cat $dir/ifconfig/ip6) = "fe80::216:3eff:fe5e:6c07" ]] ||err "ifconfig/ip6"
[[ $(cat $dir/pubip_ping/code) = "0" ]] ||err "pubip_ping/code"

echo "TEST OK"