mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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.95f59d398c
The test case is failing on Ubuntu 18.04 because it still uses the initial 1.1.1 release:20210316
T120003Z.fail.html.gz
This commit is contained in:
parent
44d67128a8
commit
e61e9bcfb2
1 changed files with 5 additions and 4 deletions
|
@ -121,6 +121,11 @@ __EOC__
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_s_parse_include
|
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|
|
in_tmpdir("ossl-config-include-test") do |dir|
|
||||||
Dir.mkdir("child")
|
Dir.mkdir("child")
|
||||||
File.write("child/a.conf", <<~__EOC__)
|
File.write("child/a.conf", <<~__EOC__)
|
||||||
|
@ -150,10 +155,6 @@ __EOC__
|
||||||
|
|
||||||
# Include a file by relative path
|
# Include a file by relative path
|
||||||
c1 = OpenSSL::Config.parse(include_file)
|
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(["default", "sec-a", "sec-b", "sec-main"], c1.sections.sort)
|
||||||
assert_equal(["file-a", "file-b", "file-main"], c1["default"].keys.sort)
|
assert_equal(["file-a", "file-b", "file-main"], c1["default"].keys.sort)
|
||||||
assert_equal({"a" => "123"}, c1["sec-a"])
|
assert_equal({"a" => "123"}, c1["sec-a"])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue