summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/run_tests17
-rw-r--r--tests/white-box/webapp.rb9
2 files changed, 21 insertions, 5 deletions
diff --git a/bin/run_tests b/bin/run_tests
index 526aa83a..3ba89684 100755
--- a/bin/run_tests
+++ b/bin/run_tests
@@ -127,11 +127,18 @@ class LeapTest < MiniTest::Unit::TestCase
if params
uri.query = URI.encode_www_form(params)
end
- response = Net::HTTP.get_response(uri)
- if response.is_a?(Net::HTTPSuccess)
- yield response.body, response, nil
- else
- yield nil, response, nil
+ http = Net::HTTP.new uri.host, uri.port
+ if uri.scheme == 'https'
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ http.use_ssl = true
+ end
+ http.start do |agent|
+ response = agent.get(uri.request_uri)
+ if response.is_a?(Net::HTTPSuccess)
+ yield response.body, response, nil
+ else
+ yield nil, response, nil
+ end
end
rescue => exc
yield nil, nil, exc
diff --git a/tests/white-box/webapp.rb b/tests/white-box/webapp.rb
index 142ac2de..05b86a41 100644
--- a/tests/white-box/webapp.rb
+++ b/tests/white-box/webapp.rb
@@ -60,4 +60,13 @@ class Webapp < LeapTest
pass
end
+ #
+ # this is technically a black-box test. so, move this when we have support
+ # for black box tests.
+ #
+ def test_04_Can_access_webapp?
+ assert_get('https://' + $node['webapp']['domain'] + '/')
+ pass
+ end
+
end