11
class TestDeploy(unittest.TestCase):
13
Deployment test for the IBM IM charm.
15
This charm doesn't do much by itself, so we expect functional
16
tests to happen in the charms that use this layer (for example, websphere).
19
self.d = amulet.Deployment(series='trusty')
20
local_path = os.path.join(os.path.dirname(__file__), 'local.yaml')
21
with open(local_path, "r") as fd:
22
config = yaml.safe_load(fd)
24
curl_url = config.get('ibm-repo').get('db2_curl_url')
26
message = 'Please provide the curl url from where the ' \
27
'package can be downloaded.'
28
amulet.raise_status(amulet.FAIL, msg=message)
31
curl_opts = config.get('ibm-repo').get('db2_curl_opts')
33
message = 'Please provide the curl_opts to specify the ' \
34
'credentials to download the packages.'
35
amulet.raise_status(amulet.FAIL, msg=message)
38
self.d.add('ibm-db2', 'cs:~ibmcharmers/trusty/ibm-db2')
39
self.d.add('websphere-liberty',
40
'cs:~ibmcharmers/trusty/websphere-liberty')
41
self.d.add('ibm-mobilefirst-server',
42
'cs:~ibmcharmers/trusty/ibm-mobilefirst-server')
43
self.d.configure('websphere-liberty',
44
{'accept-ibm-websphere-license': True})
45
self.d.configure('websphere-liberty',
46
{'accept-ibm-java-license': True})
47
self.d.configure('ibm-db2', {'license_accepted': True,
48
'curl_url': curl_url, 'curl_opts': curl_opts})
50
self.d.setup(timeout=900)
51
self.d.sentry.wait(timeout=1800)
53
def test_deploy_with_placeholder_resource(self):
54
# The status message when using placeholder resources will include the
55
# string "ibm_im_installer resource". If we see that, the test is
57
sentry_re = re.compile('ibm_mobilefirstserver_installer resource')
58
self.d.sentry.wait_for_messages({"ibm-mobilefirstserver": sentry_re})
60
if __name__ == '__main__':