~ubuntuone-pqm-team/charm-haproxy/snap-store

« back to all changes in this revision

Viewing changes to tests/10_deploy_test.py

[verterok, r=admcleod, a=kwmonroe] restart rsyslog if haproxy config changes; minor updates to tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
# Test that haproxy is acting as the proxy for apache2.
49
49
 
50
50
# Get the haproxy unit.
51
 
haproxy_unit = d.sentry.unit['haproxy/0']
 
51
haproxy_unit = d.sentry['haproxy'][0]
52
52
haproxy_address = haproxy_unit.info['public-address']
53
53
page = requests.get('http://%s/index.html' % haproxy_address)
54
54
# Raise an error if the page does not load through haproxy.
63
63
# Test that the apache2 relation data is saved on the haproxy server.
64
64
 
65
65
# Get the sentry for apache and get the private IP address.
66
 
apache_unit = d.sentry.unit['apache2/0']
 
66
apache_unit = d.sentry['apache2'][0]
67
67
# Get the relation.
68
68
relation = apache_unit.relation('website', 'haproxy:reverseproxy')
69
69
# Get the private address from the relation.
105
105
         'crts': ['DEFAULT'],
106
106
         'servers': [['apache', apache_private, 80, 'maxconn 50']]}])
107
107
})
 
108
time.sleep(10)
 
109
d.sentry.wait(seconds)
108
110
 
109
111
# We need a retry loop here, since there's no way to tell when the new
110
112
# configuration is in place.
128
130
 
129
131
print('Successfully got the Apache2 web page through haproxy SSL termination.')
130
132
 
131
 
apache_unit2 = d.sentry.unit['apache2/1']
 
133
apache_unit2 = d.sentry['apache2'][1]
132
134
apache_private2 = apache_unit2.run("unit-get private-address")[0]
133
135
 
134
136
# Create a file on the second apache unit's www directory.
151
153
                  ['apache2', apache_private2, 80, 'maxconn 50']]}
152
154
         ]}])
153
155
})
 
156
time.sleep(10)
 
157
d.sentry.wait(seconds)
154
158
 
155
159
# Let's exercise our URL-based routing by trying to fetch a URL that will
156
160
# only work for the second apache unit (which is configured as server