Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require_errors.t fails with tests #37 an #38 on AFS file system #22068

Open
djzhh opened this issue Mar 7, 2024 · 3 comments · May be fixed by #22076
Open

require_errors.t fails with tests #37 an #38 on AFS file system #22068

djzhh opened this issue Mar 7, 2024 · 3 comments · May be fixed by #22076

Comments

@djzhh
Copy link

djzhh commented Mar 7, 2024

Module: op

Description

  • Making perl produces an error in t/op/require_errors.t .
  • ./Configure detects that the sources reside in AFS: AFS may be running... I'll be extra cautious then...
  • Compiling on the local file system works w/o problems.
t/op/require_errors .............................................. 
# Failed test 37 - special error message if the file exists but can't be opened at op/require_errors.t line 187
#      got ''
# expected /(?^:^Can\'t\ locate\ tmp_HKSGF_C\.pm\:)/
# Failed test 38 - ...even if we use a full path at op/require_errors.t line 199
#      got ''
# expected /(?^:^Can\'t\ locate\ \/afs\/XXXX\.XX\/user\/X\/XXXX\/perl5\/os\/9\/perlbrew\/build\/perl\-5\.36\.3\/perl\-5\.36\.3\/t\/tmp_HKSGF_C\.pm\:)/
FAILED--unexpected output at test 36

NB: also errors for stat.t are produced; see #22067

Steps to Reproduce

cd perl-5.38.2/perl-5.38.2/t
./TEST

The compilation takes place in an AFS filesystem.

The failing test is

    172 chmod 0333, $mod_file;
    173
    174 SKIP: {
    175     skip_if_miniperl("these modules may not be available to miniperl", 2);
    176
    177     push @INC, '../lib';
    178     require Cwd;
    179     require File::Spec::Functions;
    180     if ($^O eq 'cygwin') {
    181         require Win32;
    182     }
    183
    184     # Going to try to switch away from root.  Might not work.
    185     # (stolen from t/op/stat.t)
    186     my $olduid = $>;
    187     eval { $> = 1; };
    188     skip "Can't test permissions meaningfully if you're superuser", 2
    189         if ($^O eq 'cygwin' ? Win32::IsAdminUser() : $> == 0);
    190
    191     local @INC = ".";
    192     eval "use $module";
    193     like $@,
    194         qr<^\QCan't locate $mod_file:>,
    195         "special error message if the file exists but can't be opened";
    196
    197     SKIP: {
    198         skip "Can't make the path absolute", 1
    199             if !defined(Cwd::getcwd());
    200
    201         my $file = File::Spec::Functions::catfile(Cwd::getcwd(), $mod_file);
    202         eval {
    203             require($file);
    204         };
    205         like $@,
    206             qr<^\QCan't locate $file:>,
    207             "...even if we use a full path";
    208     }
    209
    210     # switch uid back (may not be implemented)
    211     eval { $> = $olduid; };
    212 }
  1. line 187 / switch away from root:
  • the user root is meaningless in AFS in the context of that filesystem
  • the compiling user has all rights for this directory
  1. line 199 / Can't make path absolute:
  • I am not sure what the test tries to achive

Perhaps this example for the behaviour of AFS may be helpful:

% mkdir demo
% cd demo

% fs listacl -path .
Access list for . is
Normal rights:
  username rlidwka
  system:administrators rlidwka
  system:anyuser l

% echo Hello World > a_file

% ls -ld a_file
-rw-r--r--. 1 username grp 12 Mar  6 02:34 a_file

% cat a_file
Hello World

% chmod 0000 a_file

% ls -ld a_file
----------. 1 username grp 12 Mar  6 02:34 a_file

% getfacl a_file
# file: a_file
# owner: username
# group: grp
user::---
group::---
other::---

% cat a_file
Hello World

% echo "Have a nice day" >> a_file

% cat a_file
Hello World
Have a nice day

Expected behavior
In the end there should be no errors in testing :)

Perl configuration
At this time during the installation of perl there is no Config.pm available to un perl -V

@jkeenan
Copy link
Contributor

jkeenan commented Mar 11, 2024

My comment/questions on issue 22067 applies here as well.

@djzhh
Copy link
Author

djzhh commented Mar 12, 2024

A short "thank you!" here, then longer one here: #22067 (comment)

tonycoz added a commit to tonycoz/perl5 that referenced this issue Mar 12, 2024
tonycoz added a commit to tonycoz/perl5 that referenced this issue Mar 20, 2024
@jkeenan
Copy link
Contributor

jkeenan commented May 4, 2024

@djzhh, we have a pull request pending which may resolve this problem. Can you review #22076 and/or build and test it? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants