From: Wouter Wijngaards Date: Tue, 24 Jun 2014 10:26:02 +0000 (+0000) Subject: Fixup testsetup for VM tests (testcode/run_vm.sh). X-Git-Tag: release-1.5.0rc1~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43f3b0623f9208248476a01fbbcc3c33d651d303;p=thirdparty%2Funbound.git Fixup testsetup for VM tests (testcode/run_vm.sh). git-svn-id: file:///svn/unbound/trunk@3147 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 20ca8e7a0..b19d233b2 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 24 June 2014: Wouter - Fix caps-for-id fallback, and added fallback attempt when servers drop 0x20 perturbed queries. + - Fixup testsetup for VM tests (testcode/run_vm.sh). 17 June 2014: Wouter - iana portlist updated. diff --git a/testcode/run_vm.sh b/testcode/run_vm.sh new file mode 100644 index 000000000..78649f07a --- /dev/null +++ b/testcode/run_vm.sh @@ -0,0 +1,78 @@ +#!/usr/local/bin/bash +# run tpkg tests from within a VM. Looks for loopback addr. +# if run not from within a VM, runs the tests as usual. +# with one argument: run that tpkg, otherwise, run all tpkgs. + +get_lo0_ip4() { + if test -x /sbin/ifconfig + then + 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'` + if ( echo $LO0_IP4 | grep '^127\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' > /dev/null ) + then + return + fi + fi + LO0_IP4=127.0.0.1 +} +get_lo0_ip4 +export LO0_IP4 +if test "x$LO0_IP4" = "x127.0.0.1" +then + ALT_LOOPBACK=false +else + ALT_LOOPBACK=true +fi +cd testdata +TPKG=../testcode/mini_tpkg.sh +#RUNLIST=`(ls -1 *.tpkg|grep -v '^0[016]')` +RUNLIST=`(ls -1 *.tpkg)` +if test "$#" = "1"; then RUNLIST="$1"; fi + +# fix up tpkg that was edited on keyboard interrupt. +cleanup() { + echo cleanup + if test -f "$t.bak"; then mv "$t.bak" "$t"; fi + exit 0 +} +trap cleanup SIGINT + +for t in $RUNLIST +do + if ! $ALT_LOOPBACK + then + $TPKG exe $t + continue + fi + # We have alternative 127.0.0.1 number + if ( echo $t | grep '6\.tpkg$' ) # skip IPv6 tests + then + continue + elif test "$t" = "edns_cache.tpkg" # This one is IPv6 too! + then + continue + fi + cp -p "$t" "$t.bak" + tar xzf $t + find "${t%.tpkg}.dir" -type f \ + -exec grep -q -e '127\.0\.0\.1' -e '@localhost' {} \; -print | { + while read f + do + sed "s/127\.0\.0\.1/${LO0_IP4}/g" "$f" > "$f._" + mv "$f._" "$f" + sed "s/@localhost/@${LO0_IP4}/g" "$f" > "$f._" + mv "$f._" "$f" + done + } + find "${t%.tpkg}.dir" -type d -name "127.0.0.1" -print | { + while read d + do + mv -v "$d" "${d%127.0.0.1}${LO0_IP4}" + done + } + tar czf $t "${t%.tpkg}.dir" + rm -fr "${t%.tpkg}.dir" + $TPKG exe $t + mv "$t.bak" "$t" +done +# get out of testdata/ +cd .. diff --git a/testdata/09-unbound-control.tpkg b/testdata/09-unbound-control.tpkg index d7a9ceb26..62b2097bd 100644 Binary files a/testdata/09-unbound-control.tpkg and b/testdata/09-unbound-control.tpkg differ diff --git a/testdata/ctrl_itr.tpkg b/testdata/ctrl_itr.tpkg index 8134b651f..dadf0a307 100644 Binary files a/testdata/ctrl_itr.tpkg and b/testdata/ctrl_itr.tpkg differ diff --git a/testdata/edns_lame.tpkg b/testdata/edns_lame.tpkg index a11a47508..643fe0c61 100644 Binary files a/testdata/edns_lame.tpkg and b/testdata/edns_lame.tpkg differ diff --git a/testdata/fwd_bogus.tpkg b/testdata/fwd_bogus.tpkg index e060f5f9c..9f4d655dc 100644 Binary files a/testdata/fwd_bogus.tpkg and b/testdata/fwd_bogus.tpkg differ diff --git a/testdata/fwd_capsid.tpkg b/testdata/fwd_capsid.tpkg index c468a2edc..3f50639cb 100644 Binary files a/testdata/fwd_capsid.tpkg and b/testdata/fwd_capsid.tpkg differ diff --git a/testdata/fwd_capsid_fallback.tpkg b/testdata/fwd_capsid_fallback.tpkg index c6fd4cdf8..fed74134c 100644 Binary files a/testdata/fwd_capsid_fallback.tpkg and b/testdata/fwd_capsid_fallback.tpkg differ diff --git a/testdata/fwd_compress_c00c.tpkg b/testdata/fwd_compress_c00c.tpkg index 6b06a8608..c48fbbc00 100644 Binary files a/testdata/fwd_compress_c00c.tpkg and b/testdata/fwd_compress_c00c.tpkg differ diff --git a/testdata/fwd_edns_bksec.tpkg b/testdata/fwd_edns_bksec.tpkg index 5869ffa9e..ad63224d1 100644 Binary files a/testdata/fwd_edns_bksec.tpkg and b/testdata/fwd_edns_bksec.tpkg differ diff --git a/testdata/fwd_edns_probe.tpkg b/testdata/fwd_edns_probe.tpkg index 853b4ab00..c92689797 100644 Binary files a/testdata/fwd_edns_probe.tpkg and b/testdata/fwd_edns_probe.tpkg differ diff --git a/testdata/fwd_no_edns.tpkg b/testdata/fwd_no_edns.tpkg index 1629cba01..9de545d16 100644 Binary files a/testdata/fwd_no_edns.tpkg and b/testdata/fwd_no_edns.tpkg differ diff --git a/testdata/fwd_oneport.tpkg b/testdata/fwd_oneport.tpkg index d752f852c..02f5182d3 100644 Binary files a/testdata/fwd_oneport.tpkg and b/testdata/fwd_oneport.tpkg differ diff --git a/testdata/fwd_tcp.tpkg b/testdata/fwd_tcp.tpkg index f26a4e60c..e85b93b90 100644 Binary files a/testdata/fwd_tcp.tpkg and b/testdata/fwd_tcp.tpkg differ diff --git a/testdata/fwd_tcp_tc.tpkg b/testdata/fwd_tcp_tc.tpkg index a51258eb4..3f2c42338 100644 Binary files a/testdata/fwd_tcp_tc.tpkg and b/testdata/fwd_tcp_tc.tpkg differ diff --git a/testdata/fwd_three.tpkg b/testdata/fwd_three.tpkg index afb05167f..24771698d 100644 Binary files a/testdata/fwd_three.tpkg and b/testdata/fwd_three.tpkg differ diff --git a/testdata/fwd_three_service.tpkg b/testdata/fwd_three_service.tpkg index 8660e1de9..949cdcefa 100644 Binary files a/testdata/fwd_three_service.tpkg and b/testdata/fwd_three_service.tpkg differ diff --git a/testdata/fwd_ttlexpire.tpkg b/testdata/fwd_ttlexpire.tpkg index 5b124348e..1111d8e52 100644 Binary files a/testdata/fwd_ttlexpire.tpkg and b/testdata/fwd_ttlexpire.tpkg differ diff --git a/testdata/fwd_udp.tpkg b/testdata/fwd_udp.tpkg index b515d8317..4fd674699 100644 Binary files a/testdata/fwd_udp.tpkg and b/testdata/fwd_udp.tpkg differ diff --git a/testdata/fwd_udptmout.tpkg b/testdata/fwd_udptmout.tpkg index ca1527a71..0c4763200 100644 Binary files a/testdata/fwd_udptmout.tpkg and b/testdata/fwd_udptmout.tpkg differ diff --git a/testdata/fwd_waitudp.tpkg b/testdata/fwd_waitudp.tpkg index 975da2160..db3cd8ea6 100644 Binary files a/testdata/fwd_waitudp.tpkg and b/testdata/fwd_waitudp.tpkg differ diff --git a/testdata/fwd_zero.tpkg b/testdata/fwd_zero.tpkg index adadef133..bff17baa9 100644 Binary files a/testdata/fwd_zero.tpkg and b/testdata/fwd_zero.tpkg differ diff --git a/testdata/local_nodefault.tpkg b/testdata/local_nodefault.tpkg index f23f50dd1..5f9dc441a 100644 Binary files a/testdata/local_nodefault.tpkg and b/testdata/local_nodefault.tpkg differ diff --git a/testdata/local_norec.tpkg b/testdata/local_norec.tpkg index c2ceb22ea..2258695d8 100644 Binary files a/testdata/local_norec.tpkg and b/testdata/local_norec.tpkg differ diff --git a/testdata/local_nosnoop.tpkg b/testdata/local_nosnoop.tpkg index 3bb16c265..23765b298 100644 Binary files a/testdata/local_nosnoop.tpkg and b/testdata/local_nosnoop.tpkg differ diff --git a/testdata/remote-threaded.tpkg b/testdata/remote-threaded.tpkg index 8dfdd6b71..0e614d87a 100644 Binary files a/testdata/remote-threaded.tpkg and b/testdata/remote-threaded.tpkg differ diff --git a/testdata/speed_cache.tpkg b/testdata/speed_cache.tpkg index cdba5e3f9..bade5288b 100644 Binary files a/testdata/speed_cache.tpkg and b/testdata/speed_cache.tpkg differ diff --git a/testdata/speed_local.tpkg b/testdata/speed_local.tpkg index e7d7c5d5e..572f60cf1 100644 Binary files a/testdata/speed_local.tpkg and b/testdata/speed_local.tpkg differ diff --git a/testdata/stat_timer.tpkg b/testdata/stat_timer.tpkg index 1f11591a7..982e69882 100644 Binary files a/testdata/stat_timer.tpkg and b/testdata/stat_timer.tpkg differ diff --git a/testdata/stream_ssl.tpkg b/testdata/stream_ssl.tpkg index 724e4af6c..cf734d4d7 100644 Binary files a/testdata/stream_ssl.tpkg and b/testdata/stream_ssl.tpkg differ diff --git a/testdata/stream_tcp.tpkg b/testdata/stream_tcp.tpkg index 37cb249b1..9cc58912e 100644 Binary files a/testdata/stream_tcp.tpkg and b/testdata/stream_tcp.tpkg differ diff --git a/testdata/stub_udp.tpkg b/testdata/stub_udp.tpkg index 2743a6cf1..9a4757d60 100644 Binary files a/testdata/stub_udp.tpkg and b/testdata/stub_udp.tpkg differ diff --git a/testdata/tcp_sigpipe.tpkg b/testdata/tcp_sigpipe.tpkg index 2f6e3e7a6..4d6dee4d4 100644 Binary files a/testdata/tcp_sigpipe.tpkg and b/testdata/tcp_sigpipe.tpkg differ