6 use File::Spec::Functions;
9 use OpenSSL::Test qw/:DEFAULT top_file/;
15 indir "rehash.$$" => sub {
17 ok(run(app(["openssl", "rehash", curdir()])),
18 'Testing normal rehash operations');
19 }, create => 1, cleanup => 1;
21 indir "rehash.$$" => sub {
22 prepare(sub { chmod 400, $_ foreach (@_); });
23 ok(run(app(["openssl", "rehash", curdir()])),
24 'Testing rehash operations on readonly files');
25 }, create => 1, cleanup => 1;
27 indir "rehash.$$" => sub {
28 ok(run(app(["openssl", "rehash", curdir()])),
29 'Testing rehash operations on empty directory');
30 }, create => 1, cleanup => 1;
32 indir "rehash.$$" => sub {
35 isnt(run(app(["openssl", "rehash", curdir()])), 1,
36 'Testing rehash operations on readonly directory');
37 chmod 0700, curdir(); # make it writable again, so cleanup works
38 }, create => 1, cleanup => 1;
42 sort map { glob(top_file('certs', 'demo', "*.$_")) } ('pem',
47 foreach (@sourcefiles) {
49 push @destfiles, catfile(curdir(), basename($_));
52 die "Internal error, argument is not CODE"
53 unless (ref($_) eq 'CODE');