1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
# not use this file except in compliance with the License. You may obtain
5
# a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
# License for the specific language governing permissions and limitations
17
from nose.plugins.attrib import attr
24
@attr(tag=['func', 'wordpress', '2instance', 'ebs', 'F17',
25
'WordPress_2_Instances.template'])
26
class WordPress2Instances(unittest.TestCase):
28
template = 'WordPress_2_Instances.template'
30
stack_paramstr = ';'.join(['InstanceType=m1.xlarge',
32
'DBPassword=' + os.environ['OS_PASSWORD']])
34
self.stack = util.Stack(self, template, 'F17', 'x86_64', 'cfntools',
36
self.DatabaseServer = util.Instance(self, 'DatabaseServer')
37
self.WebServer = util.Instance(self, 'WebServer')
42
def test_instance(self):
45
self.DatabaseServer.wait_for_boot()
46
self.DatabaseServer.check_cfntools()
47
self.DatabaseServer.wait_for_provisioning()
49
self.WebServer.wait_for_boot()
50
self.WebServer.check_cfntools()
51
self.WebServer.wait_for_provisioning()
53
# ensure wordpress was installed
54
self.assertTrue(self.WebServer.file_present
55
('/etc/wordpress/wp-config.php'))
56
print "Wordpress installation detected"
58
# Verify the output URL parses as expected, ie check that
59
# the wordpress installation is operational
60
stack_url = self.stack.get_stack_output("WebsiteURL")
61
print "Got stack output WebsiteURL=%s, verifying" % stack_url
62
ver = verify.VerifyStack()
63
self.assertTrue(ver.verify_wordpress(stack_url))