'''
@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 = "<p>Welcome to the famous five minute WordPress"
+ def verify_url(self, url, timeout, regex):
print "Reading html from %s" % url
try:
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 = "<p>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 = "<title>Welcome to OpenShift</title>"
+ return self.verify_url(url, timeout, OPENSHIFT_REGEX)