summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominique.leuenberger <dominique.leuenberger@c587cffe-e639-0410-9787-d7902ae8ed56>2009-09-24 13:03:15 +0000
committerdominique.leuenberger <dominique.leuenberger@c587cffe-e639-0410-9787-d7902ae8ed56>2009-09-24 13:03:15 +0000
commit84c2ef1a686715fc8cb34cb40a444193a365bde3 (patch)
tree86cb65243ee69cb1c6b864ba2c242a1cc320a70c
parent1f397dba8a6f8bf5b34adefe9895d8ebbeb7fd88 (diff)
downloadlibproxy-84c2ef1a686715fc8cb34cb40a444193a365bde3.tar.gz
Some more tests for the testsuite...
git-svn-id: http://libproxy.googlecode.com/svn/trunk@426 c587cffe-e639-0410-9787-d7902ae8ed56
-rw-r--r--test.d/libproxy_test_envvar_internal.test20
-rw-r--r--test.d/libproxy_test_pac_file_syntaxerror.test.pac6
-rwxr-xr-xtest.d/libproxy_test_pacrunner_mozjs_syntaxerror.test24
-rwxr-xr-xtest.d/libproxy_test_pacrunner_webkit_syntaxerror.test24
4 files changed, 74 insertions, 0 deletions
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