From: Jeff Peeler Date: Wed, 12 Sep 2012 15:36:43 +0000 (-0400) Subject: Change VerifyClass to have a generic verify_url method X-Git-Tag: 2014.1~1434 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f2817a79d3fa6e08fcf0c98314e2ea8df6b72f8f;p=openstack-build%2Fheat-build.git Change VerifyClass to have a generic verify_url method Change-Id: I0e1298e7852e336d6271c4014b11935ac3ce6689 Signed-off-by: Jeff Peeler --- diff --git a/heat/tests/functional/verify.py b/heat/tests/functional/verify.py index f44b2288..d9bc235f 100644 --- a/heat/tests/functional/verify.py +++ b/heat/tests/functional/verify.py @@ -55,13 +55,7 @@ class VerifyStack: ''' @VerifyRetry() - def verify_wordpress(self, url, timeout=VERIFY_TIMEOUT): - ''' - Verify the url provided has a functional wordpress installation - for now we simply scrape the page and do a regex for an expected - string - ''' - WORDPRESS_REGEX = "

Welcome to the famous five minute WordPress" + def verify_url(self, url, timeout, regex): print "Reading html from %s" % url try: @@ -69,9 +63,24 @@ class VerifyStack: except: return False - matches = re.findall(WORDPRESS_REGEX, content) + matches = re.findall(regex, content) if len(matches): - print "VERIFY WORDPRESS : looks OK!" + print "VERIFY : looks OK!" return True else: return False + + @VerifyRetry() + def verify_wordpress(self, url, timeout=VERIFY_TIMEOUT): + ''' + Verify the url provided has a functional wordpress installation + for now we simply scrape the page and do a regex for an expected + string + ''' + WORDPRESS_REGEX = "

Welcome to the famous five minute WordPress" + + return self.verify_url(url, timeout, WORDPRESS_REGEX) + + def verify_openshift(self, url, timeout=VERIFY_TIMEOUT): + OPENSHIFT_REGEX = "Welcome to OpenShift" + return self.verify_url(url, timeout, OPENSHIFT_REGEX)