Merge lp:~geethas1/charms/trusty/was-base/wasbase-fix into lp:~ibmcharmers/charms/trusty/was-base/devel

Proposed by Geetha S
Status: Merged
Approved by: vsr
Approved revision: 31
Merged at revision: 32
Proposed branch: lp:~geethas1/charms/trusty/was-base/wasbase-fix
Merge into: lp:~ibmcharmers/charms/trusty/was-base/devel
Diff against target: 39 lines (+15/-2)
1 file modified
tests/10-bundles-test.py (+15/-2)
To merge this branch: bzr merge lp:~geethas1/charms/trusty/was-base/wasbase-fix
Reviewer Review Type Date Requested Status
vsr Approve
Review via email: mp+266189@code.launchpad.net

This proposal supersedes a proposal from 2015-07-28.

To post a comment you must log in.
Revision history for this message
vsr (vsasi) :
review: Approve
32. By Geetha S

Committing reverse proxy test case

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/10-bundles-test.py'
--- tests/10-bundles-test.py 2015-07-28 10:21:40 +0000
+++ tests/10-bundles-test.py 2015-08-04 08:54:19 +0000
@@ -40,13 +40,17 @@
40 with open(bundle_path, 'r') as bundle_file:40 with open(bundle_path, 'r') as bundle_file:
41 contents = yaml.safe_load(bundle_file)41 contents = yaml.safe_load(bundle_file)
42 d.load(contents)42 d.load(contents)
43 d.add('haproxy')
4344
44 # Software doesn't actually install until you accept the license45 # Software doesn't actually install until you accept the license
45 d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg })46 d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg })
47 d.configure('haproxy', {'services': '- { service_name: was-base-service, service_host: 0.0.0.0, service_port: 9060, service_options: [balance leastconn, cookie SRVNAME insert], server_options: maxconn 100 cookie S check }'})
48 d.relate('haproxy:reverseproxy', 'was-base:website')
49 d.expose('haproxy')
46 d.setup(seconds_to_wait)50 d.setup(seconds_to_wait)
47 d.sentry.wait(seconds_to_wait)51 d.sentry.wait(seconds_to_wait)
48 cls.d = d52 cls.d = d
4953
50 def test_deployed(self):54 def test_deployed(self):
51 self.assertTrue(self.d.deployed)55 self.assertTrue(self.d.deployed)
5256
@@ -56,7 +60,16 @@
56 response = requests.get(url)60 response = requests.get(url)
57 # Raise an exception if the url was not a valid web page.61 # Raise an exception if the url was not a valid web page.
58 response.raise_for_status()62 response.raise_for_status()
5963
64 def test_reverseproxy(self):
65 unit = self.d.sentry.unit['haproxy/0']
66 haproxy_address = unit.info['public-address']
67 haurl = 'http://%s:9060/ibm/console' % haproxy_address
68 page = requests.get(haurl)
69 # Raise an exception if the url was not a valid web page.
70 page.raise_for_status()
71 print('Successfully got the WAS Base web page through haproxy IP address.')
72
60if __name__ == '__main__':73if __name__ == '__main__':
61 unittest.main()74 unittest.main()
6275

Subscribers

People subscribed via source and target branches

to all changes: