summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-07-11 09:48:08 +0200
committerRichard Levitte <levitte@openssl.org>2017-07-15 18:53:07 +0200
commit94437cebc4e6c638dbf1c089877d053fecbe3361 (patch)
treed4a15e682193ade3f7ae36ff818210c37fbb79f2 /test
parentStart to overhaul RAND API (diff)
downloadopenssl-94437cebc4e6c638dbf1c089877d053fecbe3361.tar.xz
openssl-94437cebc4e6c638dbf1c089877d053fecbe3361.zip
test/recipes/90-test_store.t: Rename some functions
to_rel_file_uri really treated all files appropriately, absolute and relative alike, and really just constructs a URI, so gets renamed to to_file_uri to_file_uri, on the other hand, forces the path into an absolute one, so gets renamed to to_abs_file_uri Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3907)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/90-test_store.t32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/recipes/90-test_store.t b/test/recipes/90-test_store.t
index 65cf9fbaba..c19afbb7b0 100644
--- a/test/recipes/90-test_store.t
+++ b/test/recipes/90-test_store.t
@@ -71,31 +71,31 @@ indir "store_$$" => sub {
foreach (@noexist_files) {
my $file = srctop_file($_);
ok(!run(app(["openssl", "storeutl", $file])));
- ok(!run(app(["openssl", "storeutl", to_file_uri($file)])));
+ ok(!run(app(["openssl", "storeutl", to_abs_file_uri($file)])));
}
foreach (@src_files) {
my $file = srctop_file($_);
ok(run(app(["openssl", "storeutl", $file])));
- ok(run(app(["openssl", "storeutl", to_file_uri($file)])));
- ok(run(app(["openssl", "storeutl", to_file_uri($file, 0,
- "")])));
- ok(run(app(["openssl", "storeutl", to_file_uri($file, 0,
- "localhost")])));
- ok(!run(app(["openssl", "storeutl", to_file_uri($file, 0,
- "dummy")])));
+ ok(run(app(["openssl", "storeutl", to_abs_file_uri($file)])));
+ ok(run(app(["openssl", "storeutl", to_abs_file_uri($file, 0,
+ "")])));
+ ok(run(app(["openssl", "storeutl", to_abs_file_uri($file, 0,
+ "localhost")])));
+ ok(!run(app(["openssl", "storeutl", to_abs_file_uri($file, 0,
+ "dummy")])));
}
foreach (@generated_files) {
ok(run(app(["openssl", "storeutl", "-passin", "pass:password",
$_])));
ok(run(app(["openssl", "storeutl", "-passin", "pass:password",
- to_file_uri($_)])));
+ to_abs_file_uri($_)])));
ok(!run(app(["openssl", "storeutl", "-passin", "pass:password",
- to_rel_file_uri($_)])));
+ to_file_uri($_)])));
}
{
my $dir = srctop_dir("test", "certs");
ok(run(app(["openssl", "storeutl", $dir])));
- ok(run(app(["openssl", "storeutl", to_file_uri($dir, 1)])));
+ ok(run(app(["openssl", "storeutl", to_abs_file_uri($dir, 1)])));
}
}
}, create => 1, cleanup => 1;
@@ -296,12 +296,12 @@ sub runall {
# According to RFC8089, a relative file: path is invalid. We still produce
# them for testing purposes.
-sub to_rel_file_uri {
+sub to_file_uri {
my ($file, $isdir, $authority) = @_;
my $vol;
my $dir;
- die "to_rel_file_uri: No file given\n" if !defined($file) || $file eq '';
+ die "to_file_uri: No file given\n" if !defined($file) || $file eq '';
($vol, $dir, $file) = File::Spec->splitpath($file, $isdir // 0);
@@ -341,9 +341,9 @@ sub to_rel_file_uri {
return "file:$file";
}
-sub to_file_uri {
+sub to_abs_file_uri {
my ($file, $isdir, $authority) = @_;
- die "to_file_uri: No file given\n" if !defined($file) || $file eq '';
- return to_rel_file_uri(File::Spec->rel2abs($file), $isdir, $authority);
+ die "to_abs_file_uri: No file given\n" if !defined($file) || $file eq '';
+ return to_file_uri(to_abs_file($file), $isdir, $authority);
}