Permalink
Browse files

Adds two new QA tests for checking the HSTS support.

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6897 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent a2b8abc commit 67aceceb8da52ecc7b6c1a57eb982dc22207ad53 @alobbs alobbs committed Oct 7, 2011
Showing with 60 additions and 1 deletion.
  1. +28 −0 qa/293-HSTS-subdomains1.py
  2. +29 −0 qa/294-HSTS-subdomains2.py
  3. +3 −1 qa/Makefile.am
@@ -0,0 +1,28 @@
+from base import *
+
+NICK = "test-293"
+
+CONF = """
+vserver!2930!nick = %(NICK)s
+vserver!2930!document_root = %(droot)s
+vserver!2930!hsts = 1
+vserver!2930!hsts!subdomains = 1
+vserver!2930!rule!1!match = default
+vserver!2930!rule!1!handler = dirlist
+"""
+
+class Test (TestBase):
+ def __init__ (self):
+ TestBase.__init__ (self, __file__)
+ self.name = "HSTS: with Subdomains"
+ self.request = "HTTP / HTTP/1.0\r\n" + \
+ "Host: %s\r\n" %(NICK)
+ self.expected_error = 301
+ self.expected_content = ["Strict-Transport-Security:", "includeSubdomains"]
+
+ def Prepare (self, www):
+ droot = self.Mkdir (www, "%s_droot"%(NICK))
+
+ vars = globals()
+ vars.update(locals())
+ self.conf = CONF %(vars)
@@ -0,0 +1,29 @@
+from base import *
+
+NICK = "test-294"
+
+CONF = """
+vserver!2940!nick = %(NICK)s
+vserver!2940!document_root = %(droot)s
+vserver!2940!hsts = 1
+vserver!2940!hsts!subdomains = 0
+vserver!2940!rule!1!match = default
+vserver!2940!rule!1!handler = dirlist
+"""
+
+class Test (TestBase):
+ def __init__ (self):
+ TestBase.__init__ (self, __file__)
+ self.name = "HSTS: without Subdomains"
+ self.request = "HTTP / HTTP/1.0\r\n" + \
+ "Host: %s\r\n" %(NICK)
+ self.expected_error = 301
+ self.expected_content = ["Strict-Transport-Security:"]
+ self.forbidden_content = ["includeSubdomains"]
+
+ def Prepare (self, www):
+ droot = self.Mkdir (www, "%s_droot"%(NICK))
+
+ vars = globals()
+ vars.update(locals())
+ self.conf = CONF %(vars)
View
@@ -313,7 +313,9 @@ run-tests.py \
289-Connection_TE.py \
290-Question-mark-in-name.py \
291-Redir-keepalive.py \
-292-HSTS1.py
+292-HSTS1.py \
+293-HSTS-subdomains1.py \
+294-HSTS-subdomains2.py
test:
python -m compileall .

0 comments on commit 67acece

Please sign in to comment.