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
1=== modified file 'tests/10-bundles-test.py'
2--- tests/10-bundles-test.py 2015-07-28 10:21:40 +0000
3+++ tests/10-bundles-test.py 2015-08-04 08:54:19 +0000
4@@ -40,13 +40,17 @@
5 with open(bundle_path, 'r') as bundle_file:
6 contents = yaml.safe_load(bundle_file)
7 d.load(contents)
8+ d.add('haproxy')
9
10 # Software doesn't actually install until you accept the license
11 d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg })
12+ 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 }'})
13+ d.relate('haproxy:reverseproxy', 'was-base:website')
14+ d.expose('haproxy')
15 d.setup(seconds_to_wait)
16 d.sentry.wait(seconds_to_wait)
17 cls.d = d
18-
19+
20 def test_deployed(self):
21 self.assertTrue(self.d.deployed)
22
23@@ -56,7 +60,16 @@
24 response = requests.get(url)
25 # Raise an exception if the url was not a valid web page.
26 response.raise_for_status()
27-
28+
29+ def test_reverseproxy(self):
30+ unit = self.d.sentry.unit['haproxy/0']
31+ haproxy_address = unit.info['public-address']
32+ haurl = 'http://%s:9060/ibm/console' % haproxy_address
33+ page = requests.get(haurl)
34+ # Raise an exception if the url was not a valid web page.
35+ page.raise_for_status()
36+ print('Successfully got the WAS Base web page through haproxy IP address.')
37+
38 if __name__ == '__main__':
39 unittest.main()
40

Subscribers

People subscribed via source and target branches

to all changes: