summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJames Hannah <jhannah@bytemark.co.uk>2017-03-17 11:37:53 +0000
committerJames Hannah <jhannah@bytemark.co.uk>2017-03-17 11:37:53 +0000
commit88f78a494fd0081043b45af946b12a616e143d18 (patch)
tree5164efc588c15f313b1d8fc5d2ac77a7edb9d194 /t
parent567d8b3c419a52ccc52f35f37338514c1d8fa623 (diff)
First stab at allowing custom SSL expiry daysssl-custom-expiry
Diffstat (limited to 't')
-rwxr-xr-xt/test-custodian-parser.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb
index cfecbb3..a6e075f 100755
--- a/t/test-custodian-parser.rb
+++ b/t/test-custodian-parser.rb
@@ -430,7 +430,31 @@ EOF
end
end
+ #
+ # HTTP/HTTPS tests might specify custom expiry
+ #
+ def test_https_custom_expiry
+
+ parser = Custodian::Parser.new
+
+ #
+ # A series of tests to parse
+ #
+ text = []
+ text.push('https://example.com/ must run https')
+ text.push('https://example.com/ must run https and cannot expire within 14 days')
+ text.push('https://example.com/ must run https and cannot expire within 45 days')
+ text.push('https://example.com/ must run https and cannot expire within 300 days')
+ #
+ # Test the parser with this text
+ #
+ text.each do |txt|
+ assert_raise ArgumentError do
+ parser.parse_lines(txt)
+ end
+ end
+ end
#