test613: make it pass on Windows, fix postprocess, unignore in CI

- on native Windows (also when using MSYS2 openssh), the group and other
  permissions do not end up as requested by Perl's chmod:
  ```diff
  --- log/8/check-expected
  +++ log/8/check-generated
  @@ -1,3 +1,3 @@
   d?????????    N U         U               N ???  N NN:NN asubdir[LF]
  --rw?rw?rw?    1 U         U              37 Jan  1  2000 plainfile.txt[LF]
  +-rw?r-?r-?    1 U         U              37 Jan  1  2000 plainfile.txt[LF]
   -r-?r-?r-?    1 U         U              47 Dec 31  2000 rofile.txt[LF]
  ```
  Ref: https://github.com/curl/curl/actions/runs/14004029192/job/39215359241?pr=16781#step:15:1596
  Fix it by ignoring group and other attributes.

- fix failing postprocess cleanup by making the read-only test file
  writeable again before deleting it. Fixing:
  ```
  Directory not empty at ../../tests/libtest/test613.pl line 83.
  ```
  (seen on Windows with Git for Windows `perl.exe`)

- unignore in GHA/windows.

Closes #16791
This commit is contained in:
Viktor Szakats 2025-03-22 10:41:44 +01:00
parent d838d43430
commit efa65b24ae
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
4 changed files with 9 additions and 18 deletions

View File

@ -349,7 +349,6 @@ jobs:
TFLAGS+=' ~SCP ~SFTP' # Flaky: `-8, Unable to exchange encryption keys`. https://github.com/libssh2/libssh2/issues/804
fi
fi
TFLAGS+=' ~613' # 'SFTP directory retrieval' SFTP, directory
if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
fi
@ -937,9 +936,7 @@ jobs:
if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then
TFLAGS+=' ~SCP ~SFTP' # Flaky: `-8, Unable to exchange encryption keys`. https://github.com/libssh2/libssh2/issues/804
fi
if [ '${{ matrix.openssh }}' = '' ]; then # MSYS2 openssh
TFLAGS+=' ~613' # 'SFTP directory retrieval' SFTP, directory
else # OpenSSH-Windows
if [ -n '${{ matrix.openssh }}' ]; then # OpenSSH-Windows
TFLAGS+=' ~601 ~603 ~617 ~619 ~621 ~641 ~665 ~2004' # SCP
if [[ '${{ matrix.install }}' = *'libssh '* ]]; then
TFLAGS+=' ~614' # 'SFTP pre-quote chmod' SFTP, pre-quote, directory

View File

@ -11,8 +11,8 @@ directory
<reply>
<datacheck>
d????????? N U U N ??? N NN:NN asubdir
-rw?rw?rw? 1 U U 37 Jan 1 2000 plainfile.txt
-r-?r-?r-? 1 U U 47 Dec 31 2000 rofile.txt
-rw??????? 1 U U 37 Jan 1 2000 plainfile.txt
-r-??????? 1 U U 47 Dec 31 2000 rofile.txt
</datacheck>
</reply>

View File

@ -12,8 +12,8 @@ directory
<reply>
<datacheck>
d????????? N U U N ??? N NN:NN asubdir
-r-?r-?r-? 1 U U 37 Jan 1 2000 plainfile.txt
-r-?r-?r-? 1 U U 47 Dec 31 2000 rofile.txt
-r-??????? 1 U U 37 Jan 1 2000 plainfile.txt
-r-??????? 1 U U 47 Dec 31 2000 rofile.txt
</datacheck>
</reply>

View File

@ -75,6 +75,7 @@ elsif ($ARGV[0] eq "postprocess")
my $logfile = $ARGV[2];
# Clean up the test directory
chmod 0666, "$dirname/rofile.txt";
unlink "$dirname/rofile.txt";
unlink "$dirname/plainfile.txt";
rmdir "$dirname/asubdir";
@ -110,18 +111,11 @@ elsif ($ARGV[0] eq "postprocess")
# consistent for across all test systems and filesystems
push @canondir, "d????????? N U U N ??? N NN:NN $8\n";
} elsif ($1 eq "-") {
# Replace missing group and other permissions with user
# permissions (eg. on Windows) due to them being shown as *
my ($u, $g, $o) = ($2, $3, $4);
if($g eq "**") {
$g = $u;
}
if($o eq "**") {
$o = $u;
}
# Ignore group and other permissions, because these may vary on
# some systems (e.g. on Windows)
# Erase user and group names, as they are not consistent across
# all test systems
my $line = sprintf("%s%s?%s?%s?%5d U U %15d %s %s\n", $1,$u,$g,$o,$5,$6,$7,$8);
my $line = sprintf("%s%s???????%5d U U %15d %s %s\n", $1,$2,$5,$6,$7,$8);
push @canondir, $line;
} else {
# Unexpected format; just pass it through and let the test fail