From 84c2ef1a686715fc8cb34cb40a444193a365bde3 Mon Sep 17 00:00:00 2001 From: "dominique.leuenberger" Date: Thu, 24 Sep 2009 13:03:15 +0000 Subject: Some more tests for the testsuite... git-svn-id: http://libproxy.googlecode.com/svn/trunk@426 c587cffe-e639-0410-9787-d7902ae8ed56 --- test.d/libproxy_test_envvar_internal.test | 20 ++++++++++++++++++ test.d/libproxy_test_pac_file_syntaxerror.test.pac | 6 ++++++ .../libproxy_test_pacrunner_mozjs_syntaxerror.test | 24 ++++++++++++++++++++++ ...libproxy_test_pacrunner_webkit_syntaxerror.test | 24 ++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 test.d/libproxy_test_envvar_internal.test create mode 100644 test.d/libproxy_test_pac_file_syntaxerror.test.pac create mode 100755 test.d/libproxy_test_pacrunner_mozjs_syntaxerror.test create mode 100755 test.d/libproxy_test_pacrunner_webkit_syntaxerror.test diff --git a/test.d/libproxy_test_envvar_internal.test b/test.d/libproxy_test_envvar_internal.test new file mode 100644 index 0000000..ad88951 --- /dev/null +++ b/test.d/libproxy_test_envvar_internal.test @@ -0,0 +1,20 @@ +#!/bin/sh +# $Id: libproxy_test_envvar.test 386 2009-06-07 20:15:13Z dominique.leuenberger $ + +result_ok="http://proxy:1234" +testurl="http://www.google.com" +proxy_bin="$( test -x src/bin/proxy && echo src/bin/proxy || which proxy)" + +if [ -x $proxy_bin ]; then + result=$(PX_MODULE_BLACKLIST="*" PX_CONFIG_ORDER=config_envvar http_proxy="http://proxy:1234" $proxy_bin $testurl) +else + result="N/A" +fi + +echo 'name="test_envvar_internal"' +if [ "$result" = "$result_ok" ]; then + echo pass=True +else + echo pass=False + echo "reason='$proxy_bin returned $result instead of $result_ok'" +fi diff --git a/test.d/libproxy_test_pac_file_syntaxerror.test.pac b/test.d/libproxy_test_pac_file_syntaxerror.test.pac new file mode 100644 index 0000000..ae92b9a --- /dev/null +++ b/test.d/libproxy_test_pac_file_syntaxerror.test.pac @@ -0,0 +1,6 @@ +function FindProxyForURL(url, host) +{ + myIP=myNetworkAddress(); + return "PROXY " + myIP + ":80"; + +} diff --git a/test.d/libproxy_test_pacrunner_mozjs_syntaxerror.test b/test.d/libproxy_test_pacrunner_mozjs_syntaxerror.test new file mode 100755 index 0000000..e64afc6 --- /dev/null +++ b/test.d/libproxy_test_pacrunner_mozjs_syntaxerror.test @@ -0,0 +1,24 @@ +#!/bin/sh +# $Id: libproxy_test_envvar.test 298 2008-12-17 05:34:50Z dominique.leuenberger $ + +result1_ok="direct://" +result2_ok="direct://" +testurl1="http://code.google.com" +testurl2="http://www.google.com" +proxy_bin="$( test -x src/bin/proxy && echo src/bin/proxy || which proxy)" +pac_url="file://$(pwd)/test.d/libproxy_test_pac_file_syntaxerror.test.pac" + +if [ -x $proxy_bin ]; then + result1=$(PX_CONFIG_ORDER=config_envvar PX_MODULE_BLACKLIST="pacrunner_*" PX_MODULE_WHITELIST="pacrunner_mozjs" http_proxy="pac+$pac_url" $proxy_bin $testurl1) + result2=$(PX_CONFIG_ORDER=config_envvar PX_MODULE_BLACKLIST="pacrunner_*" PX_MODULE_WHITELIST="pacrunner_mozjs" http_proxy="pac+$pac_url" $proxy_bin $testurl2) +else + result="N/A" +fi + +echo 'name="test_pacrunner_mozjs_syntaxerror:"' +if [ "$result1" = "$result1_ok" -a "$result2" = "$result2_ok" ]; then + echo pass=True +else + echo pass=False + echo "reason='$proxy_bin returned $result1 and $result2 instead of $result1_ok and $result2_ok'" +fi diff --git a/test.d/libproxy_test_pacrunner_webkit_syntaxerror.test b/test.d/libproxy_test_pacrunner_webkit_syntaxerror.test new file mode 100755 index 0000000..2cecc35 --- /dev/null +++ b/test.d/libproxy_test_pacrunner_webkit_syntaxerror.test @@ -0,0 +1,24 @@ +#!/bin/sh +# $Id: libproxy_test_envvar.test 298 2008-12-17 05:34:50Z dominique.leuenberger $ + +result1_ok="direct://" +result2_ok="direct://" +testurl1="http://code.google.com" +testurl2="http://www.google.com" +proxy_bin="$( test -x src/bin/proxy && echo src/bin/proxy || which proxy)" +pac_url="file://$(pwd)/test.d/libproxy_test_pac_file_syntaxerror.test.pac" + +if [ -x $proxy_bin ]; then + result1=$(PX_CONFIG_ORDER=config_envvar PX_MODULE_BLACKLIST="pacrunner_*" PX_MODULE_WHITELIST="pacrunner_webkit" http_proxy="pac+$pac_url" $proxy_bin $testurl1) + result2=$(PX_CONFIG_ORDER=config_envvar PX_MODULE_BLACKLIST="pacrunner_*" PX_MODULE_WHITELIST="pacrunner_webkit" http_proxy="pac+$pac_url" $proxy_bin $testurl2) +else + result="N/A" +fi + +echo 'name="test_pacrunner_webkit_syntaxerror"' +if [ "$result1" = "$result1_ok" -a "$result2" = "$result2_ok" ]; then + echo pass=True +else + echo pass=False + echo "reason='$proxy_bin returned $result1 and $result2 instead of $result1_ok and $result2_ok'" +fi -- cgit v1.2.1