aboutsummaryrefslogtreecommitdiffstats
path: root/autoscan/tests/test_autoscan.sh
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-07-22 03:23:01 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-07-22 03:23:01 +0200
commitc16a1c3b6f1fdacf2ad365ff2a35252d7eb73c4e (patch)
tree557b3b788a8597859dee143e2fcae94a967463d2 /autoscan/tests/test_autoscan.sh
parentautoscan - automatic fingerprint of visited networks (diff)
downloadlaurent-tools-c16a1c3b6f1fdacf2ad365ff2a35252d7eb73c4e.tar.xz
laurent-tools-c16a1c3b6f1fdacf2ad365ff2a35252d7eb73c4e.zip
autoscan: some code and add tests
Diffstat (limited to 'autoscan/tests/test_autoscan.sh')
-rwxr-xr-xautoscan/tests/test_autoscan.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/autoscan/tests/test_autoscan.sh b/autoscan/tests/test_autoscan.sh
new file mode 100755
index 0000000..bea2c34
--- /dev/null
+++ b/autoscan/tests/test_autoscan.sh
@@ -0,0 +1,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"