]>
git.saurik.com Git - apple/network_cmds.git/blob - unbound/testcode/run_vm.sh
78649f07a94154fe44dd47619d4dc11f2804cb97
2 # run tpkg tests from within a VM. Looks for loopback addr.
3 # if run not from within a VM, runs the tests as usual.
4 # with one argument: run that tpkg, otherwise, run all tpkgs.
7 if test -x /sbin
/ifconfig
9 LO0_IP4
=`/sbin/ifconfig lo0 | grep '[^0-9]127\.' | sed -e 's/^[^1]*\(127\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[^0-9]*.*$/\1/g'`
10 if ( echo $LO0_IP4 | grep '^127\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' > /dev
/null
)
19 if test "x$LO0_IP4" = "x127.0.0.1"
26 TPKG
=..
/testcode
/mini_tpkg.sh
27 #RUNLIST=`(ls -1 *.tpkg|grep -v '^0[016]')`
28 RUNLIST
=`(ls -1 *.tpkg)`
29 if test "$#" = "1"; then RUNLIST
="$1"; fi
31 # fix up tpkg that was edited on keyboard interrupt.
34 if test -f "$t.bak"; then mv "$t.bak" "$t"; fi
46 # We have alternative 127.0.0.1 number
47 if ( echo $t | grep '6\.tpkg$' ) # skip IPv6 tests
50 elif test "$t" = "edns_cache.tpkg" # This one is IPv6 too!
56 find "${t%.tpkg}.dir" -type f \
57 -exec grep -q -e '127\.0\.0\.1' -e '@localhost' {} \
; -print | {
60 sed "s/127\.0\.0\.1/${LO0_IP4}/g" "$f" > "$f._"
62 sed "s/@localhost/@${LO0_IP4}/g" "$f" > "$f._"
66 find "${t%.tpkg}.dir" -type d
-name "127.0.0.1" -print | {
69 mv -v "$d" "${d%127.0.0.1}${LO0_IP4}"
72 tar czf
$t "${t%.tpkg}.dir"
73 rm -fr "${t%.tpkg}.dir"
77 # get out of testdata/