summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-03-16 22:15:46 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-03-16 22:30:33 +0900
commite61e9bcfb27580ae52b46fc7ca49c38f8fdeb8cd (patch)
tree99434546cd04aeaf441a1503d568955fe089c98e /test
parent44d67128a827c65d1a3867c5d8fd190d10aa1dd2 (diff)
test/openssl/test_config: skip tests for .include on older OpenSSL
The .include directive was initially added by OpenSSL 1.1.1, but the syntax was later modified in 1.1.1b to improve compatibility with the parser in <= 1.1.0. The test case expects 1.1.1b's parser. https://github.com/openssl/openssl/commit/95f59d398c3f28f7ee50f092106c5910d25f9e30 The test case is failing on Ubuntu 18.04 because it still uses the initial 1.1.1 release: http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20210316T120003Z.fail.html.gz
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_config.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/openssl/test_config.rb b/test/openssl/test_config.rb
index 3af9923d2a..769e65ceb5 100644
--- a/test/openssl/test_config.rb
+++ b/test/openssl/test_config.rb
@@ -121,6 +121,11 @@ __EOC__
end
def test_s_parse_include
+ if !openssl?(1, 1, 1, 2)
+ # OpenSSL < 1.1.1 parses .include directive as a normal assignment
+ pend ".include directive is not supported"
+ end
+
in_tmpdir("ossl-config-include-test") do |dir|
Dir.mkdir("child")
File.write("child/a.conf", <<~__EOC__)
@@ -150,10 +155,6 @@ __EOC__
# Include a file by relative path
c1 = OpenSSL::Config.parse(include_file)
- if c1["sec-main"][".include"]
- # OpenSSL < 1.1.1 parses '.include =' as a normal assignment
- pend ".include directive is not supported"
- end
assert_equal(["default", "sec-a", "sec-b", "sec-main"], c1.sections.sort)
assert_equal(["file-a", "file-b", "file-main"], c1["default"].keys.sort)
assert_equal({"a" => "123"}, c1["sec-a"])