plan skip_all => "Test is disabled on NonStop" if config('target') =~ m|^nonstop|;
# MacOS arranges symbol names differently
plan skip_all => "Test is disabled on MacOS" if config('target') =~ m|^darwin|;
+plan skip_all => "Test is disabled on MinGW" if config('target') =~ m|^mingw|;
plan skip_all => "Only useful when building shared libraries"
if disabled("shared");
unless ok(run(test([ 'confdump', $input_path ],
stdout => $result_path)),
"dumping $_");
- is(compare_text($result_path, $expected_path), 0,
- "comparing the dump of $_ with $input_result{$_}");
+ is(compare_text($result_path, $expected_path, sub {
+ my $in1 = $_[0];
+ my $in2 = $_[1];
+ $in1 =~ s/\r\n/\n/g;
+ $in2 =~ s/\r\n/\n/g;
+ $in1 ne $in2}), 0,
+ "comparing the dump of $_ with $input_result{$_}");
}
}
my $testout = "$app.tst";
ok(run(app(['openssl', $app, '-out', $testout, '-in', $_])));
- ok(!compare_text($_, $testout), "Original file $_ is the same as new one");
+ ok(!compare_text($_, $testout, sub {
+ my $in1 = $_[0];
+ my $in2 = $_[1];
+ $in1 =~ s/\r\n/\n/g;
+ $in2 =~ s/\r\n/\n/g;
+ $in1 ne $in2}), "Original file $_ is the same as new one");
}
}
ok(run(app(["openssl", "x509", "-ext", "subjectAltName", "-in", $utf8_pem, "-noout", "-out", $out])));
is(cmp_text($out, srctop_file($folder, "san.utf8")), 0, 'Comparing othername for IDN domain');
-ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", "学生\@elementary.school.example.com", "-CAfile", $ascii_chain_pem, $ascii_pem])));
-ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", "医生\@大学.example.com", "-CAfile", $utf8_chain_pem, $utf8_pem])));
+SKIP: {
+ skip "Unicode tests disabled on MingW", 2 if $^O =~ /^msys$/;
+
+ ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", "学生\@elementary.school.example.com", "-CAfile", $ascii_chain_pem, $ascii_pem])));
+ ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-verify_email", "医生\@大学.example.com", "-CAfile", $utf8_chain_pem, $utf8_pem])));
+}
ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $ascii_chain_pem, $ascii_pem])));
ok(run(app(["openssl", "verify", "-nameopt", "utf8", "-no_check_time", "-CAfile", $utf8_chain_pem, $utf8_pem])));
note("There should not be more that at most 80 per line");
}
+# Prevent MSys2 filename munging for arguments that look like file paths but
+# aren't
+$ENV{MSYS2_ARG_CONV_EXCL} = "/CN=";
+
# Check for duplicate -addext parameters, and one "working" case.
my @addext_args = ( "openssl", "req", "-new", "-out", "testreq.pem",
"-key", srctop_file("test", "certs", "ee-key.pem"),
plan tests => 18;
+# Prevent MSys2 filename munging for arguments that look like file paths but
+# aren't
+$ENV{MSYS2_ARG_CONV_EXCL} = "/CN=";
+
require_ok(srctop_file("test", "recipes", "tconversion.pl"));
my @certs = qw(test certs);
SKIP: {
skip "DES disabled", 1 if disabled("des");
- skip "VMS doesn't support command line UTF-8", 1 if $^O eq 'VMS';
+ skip "Platform doesn't support command line UTF-8", 1 if $^O =~ /^(VMS|msys)$/;
my $p12 = srctop_file("test", "shibboleth.pfx");
my $p12pass = "σύνθημα γνώρισμα";
skip "OCSP disabled", 1 if disabled("ocsp");
my $cmd = [qw{openssl ocsp -index any -port 0}];
my @output = run(app($cmd), capture => 1);
+ $output[0] =~ s/\r\n/\n/g;
ok($output[0] =~ /^ACCEPT (0.0.0.0|\[::\]):(\d+?) PID=(\d+)$/
&& $2 >= 1024 && $3 > 0,
"HTTP server auto-selects and reports local port >= 1024 and pid > 0");
if disabled("sock");
plan skip_all => "Tests involving local HTTP server not available on Windows or VMS"
- if $^O =~ /^(VMS|MSWin32)$/;
+ if $^O =~ /^(VMS|MSWin32|msys)$/;
plan skip_all => "Tests involving local HTTP server not available in cross-compile builds"
if defined $ENV{EXE_SHELL};
plan skip_all => "These tests are not supported in a no-cmp build"
if disabled("cmp");
+# Prevent MSys2 filename munging for arguments that look like file paths but
+# aren't
+$ENV{MSYS2_ARG_CONV_EXCL} = "/CN=";
+
my @app = qw(openssl cmp);
my @cmp_basic_tests = (
my $test_name = "test_store";
setup($test_name);
-my $mingw = config('target') =~ m|^mingw|;
-
my $use_md5 = !disabled("md5");
my $use_des = !(disabled("des") || disabled("legacy")); # also affects 3des and pkcs12 app
my $use_dsa = !disabled("dsa");
+ 3
+ 11 );
+# Test doesn't work under msys because the file name munging doesn't work
+# correctly with the "ot:" prefix
my $do_test_ossltest_store =
- !(disabled("engine") || disabled("dynamic-engine"));
+ !(disabled("engine") || disabled("dynamic-engine") || $^O =~ /^msys$/);
if ($do_test_ossltest_store) {
# test loading with apps 'org.openssl.engine:' loader, using the
ok(run(app([@storeutl, "-noout", to_abs_file($file)])));
SKIP:
{
- skip "file: tests disabled on MingW", 4 if $mingw;
+ skip "file: tests disabled on MingW", 4 if $^O =~ /^msys$/;
ok(run(app([@storeutl, "-noout",
to_abs_file_uri($file)])));
SKIP:
{
- skip "file: tests disabled on MingW", 2 if $mingw;
+ skip "file: tests disabled on MingW", 2 if $^O =~ /^msys$/;
ok(run(app([@storeutl, "-noout", "-passin",
"pass:password", to_abs_file_uri($_)])));
foreach (values %generated_file_files) {
SKIP:
{
- skip "file: tests disabled on MingW", 1 if $mingw;
+ skip "file: tests disabled on MingW", 1 if $^O =~ /^msys$/;
ok(run(app([@storeutl, "-noout", $_])));
}
foreach (@noexist_file_files) {
SKIP:
{
- skip "file: tests disabled on MingW", 1 if $mingw;
+ skip "file: tests disabled on MingW", 1 if $^O =~ /^msys$/;
ok(!run(app([@storeutl, "-noout", $_])));
}
ok(run(app([@storeutl, "-noout", to_abs_file($dir, 1)])));
SKIP:
{
- skip "file: tests disabled on MingW", 1 if $mingw;
+ skip "file: tests disabled on MingW", 1 if $^O =~ /^msys$/;
ok(run(app([@storeutl, "-noout",
to_abs_file_uri($dir, 1)])));