35
36
amulet.raise_status(amulet.FAIL, msg=message)
38
self.d.add('ibm-db2', 'cs:~ibmcharmers/trusty/ibm-db2')
39
#self.d.add('ibm-db2', 'cs:~shilkaul/trusty/ibm-db2-0')
39
self.d.add('ibm-db2', 'cs:trusty/ibm-db2')
40
# self.d.add('ibm-db2', 'cs:~shilkaul/trusty/ibm-db2-0')
40
41
self.d.add('websphere-liberty',
41
'cs:~ibmcharmers/trusty/websphere-liberty')
42
'cs:trusty/websphere-liberty-4')
42
43
self.d.add('ibm-mobilefirst-server',
43
44
'cs:~ibmcharmers/trusty/ibm-mobilefirst-server')
45
# self.d.add('ibm-mobilefirst-server',
46
# 'cs:~shilkaul/trusty/ibm-mobilefirst-server-0')
44
47
self.d.configure('websphere-liberty',
45
48
{'accept-ibm-websphere-license': True})
46
49
self.d.configure('websphere-liberty',
47
50
{'accept-ibm-java-license': True})
51
self.d.configure('websphere-liberty',
52
{'ibm-liberty-version': "8.5.5.8"})
53
self.d.configure('websphere-liberty',
54
{'sha_wlp': "a0497da259cf6ad972500ceedbb1227c0ac72de \
55
4adc50a0fa6edc60ea044ab3a32d4f390533c98dee72ad1f36f \
56
a54d09591bb0d0ec6e6245b602e091bf7ea3de"})
48
58
self.d.configure('ibm-db2', {'license_accepted': True,
49
'curl_url': curl_url, 'curl_opts': curl_opts})
51
self.d.relate('websphere-liberty:website','ibm-mobilefirst-server:website')
52
self.d.relate('ibm-db2:db','ibm-mobilefirst-server:mobilefirstserverdb')
59
'curl_url': curl_url, 'curl_opts': curl_opts})
61
self.d.relate('websphere-liberty:website',
62
'ibm-mobilefirst-server:website')
63
self.d.relate('ibm-db2:db',
64
'ibm-mobilefirst-server:mobilefirstserverdb')
55
66
self.d.setup(timeout=1200)
56
67
self.d.sentry.wait(timeout=1200)
58
69
def test_deploy_with_placeholder_resource(self):
59
70
# The status message when using placeholder resources will include the
60
# string "ibm_mobilefirstserver_installer resource". If we see that, the test is
71
# string "ibm_mobilefirstserver_installer resource". If we see that,
72
# the test is successful.
62
73
sentry_re = re.compile('ibm_mobilefirstserver_installer resource')
63
74
self.d.sentry.wait_for_messages({"ibm-mobilefirstserver": sentry_re})
65
76
def test_mobilefirst_server_deployed(self):
66
77
self.assertTrue(self.d.deployed)
67
78
unit = self.d.sentry['ibm-mobilefirst-server'][0]
68
state_worklight = unit.info['agent-state']
69
print('Mobile First Server is %s' % state_worklight)
70
79
url = 'http://%s:9081/appcenterconsole' % unit.info['public-address']
71
https_url = 'https://%s:9443/appcenterconsole' % unit.info['public-address']
80
url1 = 'https://%s:9443/appcenterconsole' % unit.info['public-address']
81
print('Url is %s' % url)
72
82
response = requests.get(url, verify=False)
73
response = requests.get(https_url, verify=False)
83
response = requests.get(url1, verify=False)
74
84
# Raise an exception if the url was not a valid web page.
75
85
response.raise_for_status()
77
88
if __name__ == '__main__':