]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat tests : add new Boto wordpress functional test
authorSteven Hardy <shardy@redhat.com>
Tue, 11 Sep 2012 12:08:22 +0000 (13:08 +0100)
committerSteven Hardy <shardy@redhat.com>
Tue, 11 Sep 2012 12:17:34 +0000 (13:17 +0100)
Add new test_WordPress_Single_Instance_Boto.py, which
does a wordpress single instance test using StackBoto

Note, this will require a valid /etc/boto.cfg to work,
and probably a recent (git) version of boto

Fixes #220

Change-Id: Ia95de35dc9d1d52ba6b9f4fae333e4fad02762ca
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/tests/functional/test_WordPress_Single_Instance_Boto.py [new file with mode: 0644]

diff --git a/heat/tests/functional/test_WordPress_Single_Instance_Boto.py b/heat/tests/functional/test_WordPress_Single_Instance_Boto.py
new file mode 100644 (file)
index 0000000..8c0a842
--- /dev/null
@@ -0,0 +1,47 @@
+# 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
+import unittest
+
+
+@attr(speed='slow')
+@attr(tag=['func', 'wordpress', 'WordPress_Single_Instance.template', 'boto'])
+class WordPressBotoFunctionalTest(unittest.TestCase):
+    def setUp(self):
+        template = 'WordPress_Single_Instance.template'
+
+        self.stack = util.StackBoto(template, 'F17', 'x86_64', 'cfntools')
+        self.WikiDatabase = util.Instance('WikiDatabase')
+        self.WikiDatabase.check_cfntools()
+        self.WikiDatabase.wait_for_provisioning()
+
+    def test_instance(self):
+        # ensure wordpress was installed by checking for expected
+        # configuration file over ssh
+        self.assertTrue(self.WikiDatabase.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()