]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Add Wordpress_2_Instances testcase
authorSteven Dake <sdake@redhat.com>
Thu, 13 Sep 2012 18:36:31 +0000 (11:36 -0700)
committerSteven Dake <sdake@redhat.com>
Thu, 13 Sep 2012 18:37:28 +0000 (11:37 -0700)
Fixes Issue #205

Change-Id: Ic7a08b2ac278a032033bec47bbfe53aeb11b253e
Signed-off-by: Steven Dake <sdake@redhat.com>
heat/tests/functional/test_WordPress_2_Intances.py [new file with mode: 0644]

diff --git a/heat/tests/functional/test_WordPress_2_Intances.py b/heat/tests/functional/test_WordPress_2_Intances.py
new file mode 100644 (file)
index 0000000..339058b
--- /dev/null
@@ -0,0 +1,61 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#
+
+import util
+import verify
+import nose
+from nose.plugins.attrib import attr
+
+from heat.common import context
+from heat.engine import manager
+import unittest
+import os
+
+
+@attr(speed='slow')
+@attr(tag=['func', 'wordpress', '2instance', 'ebs',
+      'WordPress_2_Instances.template'])
+class WordPress2Instances(unittest.TestCase):
+    def setUp(self):
+        template = 'WordPress_2_Instances.template'
+
+        stack_paramstr = ';'.join(['InstanceType=m1.xlarge',
+            'DBUsername=dbuser',
+            'DBPassword=' + os.environ['OS_PASSWORD']])
+
+        self.stack = util.Stack(template, 'F17', 'x86_64', 'cfntools',
+            stack_paramstr)
+
+        self.DatabaseServer = util.Instance('DatabaseServer')
+        self.DatabaseServer.check_cfntools()
+        self.DatabaseServer.wait_for_provisioning()
+
+        self.WebServer = util.Instance('WebServer')
+        self.WebServer.check_cfntools()
+        self.WebServer.wait_for_provisioning()
+
+    def test_instance(self):
+        # ensure wordpress was installed
+        self.assertTrue(self.WebServer.file_present
+                        ('/etc/wordpress/wp-config.php'))
+        print "Wordpress installation detected"
+
+        # Verify the output URL parses as expected, ie check that
+        # the wordpress installation is operational
+        stack_url = self.stack.get_stack_output("WebsiteURL")
+        print "Got stack output WebsiteURL=%s, verifying" % stack_url
+        ver = verify.VerifyStack()
+        self.assertTrue(ver.verify_wordpress(stack_url))
+
+        self.stack.cleanup()