summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorroot <root@yawns.default.skx.uk0.bigv.io>2016-02-10 12:07:42 +0000
committerroot <root@yawns.default.skx.uk0.bigv.io>2016-02-10 12:07:42 +0000
commit1bda31480aa43534313e0557c0d484caaceb4a08 (patch)
tree88b15999ef2cfef95ca456ad7e28a37151f06699 /t
parent4dd406dd29b166d98485a09ef25ec52867bd5530 (diff)
Don't allow limiting protocl on HTTP/HTTPS tests.
We cannot allow HTTP/HTTPS to be limited by protocol, such as IPv4-only or IPv6-only. Raise an error in the parser if this is attempted. Added test-case to confirm, and this closes #12488.
Diffstat (limited to 't')
-rwxr-xr-xt/test-custodian-parser.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb
index d3c3842..bc2bc2b 100755
--- a/t/test-custodian-parser.rb
+++ b/t/test-custodian-parser.rb
@@ -434,6 +434,33 @@ EOF
#
+ # HTTP/HTTPS tests don't like IPv4/IPv6-limits
+ #
+ def test_http_protocols
+
+ parser = Custodian::Parser.new
+
+ #
+ # A series of tests to parse
+ #
+ text = []
+ text.push('https://example.com/ must run https ipv4_only')
+ text.push('https://example.com/ must run https ipv6_only')
+ text.push('http://example.com/ must run http ipv4_only')
+ text.push('http://example.com/ must run http ipv6_only')
+
+ #
+ # Test the parser with this text
+ #
+ text.each do |txt|
+ assert_raise ArgumentError do
+ parser.parse_lines(txt)
+ end
+ end
+ end
+
+
+ #
# Test that the text we're going to use in alerters is present.
#
def test_alert_text