提交 000edfec 编写于 作者: R Richard Levitte

Adapt 15-test_out_option.t for more than just Unix

Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4008)
上级 b107e7f5
...@@ -31,8 +31,8 @@ plan tests => 11; ...@@ -31,8 +31,8 @@ plan tests => 11;
test_illegal_path('/usr/'); test_illegal_path('/usr/');
test_illegal_path('/'); test_illegal_path('/');
test_illegal_path('.'); test_illegal_path('./');
test_illegal_path('..'); test_illegal_path('../');
# Test for trying to create a file in a non-exist directory # Test for trying to create a file in a non-exist directory
my @chars = ("A".."Z", "a".."z", "0".."9"); my @chars = ("A".."Z", "a".."z", "0".."9");
...@@ -44,7 +44,7 @@ test_legal_path('test.pem'); ...@@ -44,7 +44,7 @@ test_legal_path('test.pem');
unlink 'test.pem'; unlink 'test.pem';
sub test_illegal_path { sub test_illegal_path {
my ($path) = @_; my $path = File::Spec->canonpath($_[0]);
my $start = time(); my $start = time();
ok(!run(app([ 'openssl', 'genrsa', '-out', $path, '16384'])), "invalid output path: $path"); ok(!run(app([ 'openssl', 'genrsa', '-out', $path, '16384'])), "invalid output path: $path");
...@@ -54,7 +54,7 @@ sub test_illegal_path { ...@@ -54,7 +54,7 @@ sub test_illegal_path {
} }
sub test_legal_path { sub test_legal_path {
my ($path) = @_; my $path = File::Spec->canonpath($_[0]);
ok(run(app([ 'openssl', 'genrsa', '-out', $path, '2048'])), "valid output path: $path"); ok(run(app([ 'openssl', 'genrsa', '-out', $path, '2048'])), "valid output path: $path");
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册