2
# Ubuntu Continuous Integration Engine
3
# Copyright 2014 Canonical Ltd.
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU Affero General Public License version 3, as
7
# published by the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12
# PURPOSE. See the GNU Affero General Public License for more details.
14
# You should have received a copy of the GNU Affero General Public License
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
class WebUITest(deployers.DeployerTest):
23
"""Integration tests for ticket-system service run on a juju deployment"""
25
def get_server_status_and_content(self, url):
26
final_url = url.format(
27
self.get_ip_and_port('ci-airline-webui-apache')[0])
29
# Issue a simple command against the ticket API
30
client = httplib2.Http()
31
return client.request(final_url, 'GET')
34
'''show we can load our front page.'''
36
self.get_ip_and_port('ci-airline-webui-apache')
37
resp, content = self.get_server_status_and_content(url)
38
self.assertEqual('200', resp['status'])
40
def test_json_status(self):
41
'''Ensure the webui charm is providing us a valid status_urls.json'''
42
url = 'http://{}/static/engine-health/status_urls.json'
43
self.get_ip_and_port('ci-airline-webui-apache')
44
resp, content = self.get_server_status_and_content(url)
45
self.assertEqual('200', resp['status'])
48
def test_status_page(self):
49
'''show we can load our front page.'''
50
url = 'http://{}/status/'
51
self.get_ip_and_port('ci-airline-webui-apache')
52
resp, content = self.get_server_status_and_content(url)
53
self.assertEqual('200', resp['status'])
54
self.assertIn('href="/status/" class="active">Engine health', content)
57
if __name__ == "__main__":