]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test613: make it pass on Windows, fix postprocess, unignore in CI
authorViktor Szakats <commit@vsz.me>
Sat, 22 Mar 2025 09:41:44 +0000 (10:41 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 24 Mar 2025 09:05:17 +0000 (10:05 +0100)
- 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

.github/workflows/windows.yml
tests/data/test613
tests/data/test614
tests/libtest/test613.pl

index cc58940a9bf3aef625efb8f9f37b10e27059d50f..90f713b235820591094b0b0c6c84eb2865e5dc84 100644 (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
index 42cb1ee41357791b4b3f4702ad7a16015c07dd3f..a61d82afd981fac9f1b284cacebbf1c750aadac8 100644 (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>
 
index 53d34137ca1e88a59d678ced10de9899313bd121..11851a7456470dfc37c96d96f7252eaf06bcaf6b 100644 (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>
 
index dee3b175431fcca7b5805cea16f4ef90d9f7803f..3bcd32aa4444c55101ec95e84526ef2eb3e55d6b 100755 (executable)
@@ -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