The rehash test broke the test if run by root. Instead, just skip the
check that requires non-root to be worth it.
Fixes #4387
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5184)
plan skip_all => "test_rehash is not available on this platform"
unless run(app(["openssl", "rehash", "-help"]));
-plan tests => 5;
+plan tests => 4;
indir "rehash.$$" => sub {
prepare();
prepare();
chmod 0500, curdir();
SKIP: {
- if (!ok(!open(FOO, ">unwritable.txt"),
- "Testing that we aren't running as a privileged user, such as root")) {
+ if (open(FOO, ">unwritable.txt")) {
close FOO;
skip "It's pointless to run the next test as root", 1;
}