]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test615: fix for Cygwin, unignore in CI
authorViktor Szakats <commit@vsz.me>
Sun, 23 Mar 2025 23:31:33 +0000 (00:31 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 24 Mar 2025 15:49:57 +0000 (16:49 +0100)
Setting a server-side file read-only by `chmod 0444` has does not
prevent overwriting it via SFTP upload (as tested in CI).

Fix it by setting its MS-DOS read-only attribute in addition. It
requires the Cygwin tool `chattr`.

Also unignore in CI.

Fixes:
```
test 0615...[SFTP put remote failure]
curl returned 0, when expecting 9
 615: exit FAILED
=== Start of file stderr615
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 100    30    0     0  100    30      0     93 --:--:-- --:--:-- --:--:--    95

 100    30    0     0  100    30      0     92 --:--:-- --:--:-- --:--:--    92
=== End of file stderr615
```
Ref: https://github.com/curl/curl/actions/runs/14037991918/job/39300723214#step:12:1269

Closes #16818

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

index b2dbd60fafd06d2a2501a14266e559d5cd6b8233..d8eb86fe84284dc746de7970f66d55b0bd87adc4 100644 (file)
@@ -149,7 +149,7 @@ jobs:
         timeout-minutes: 15
         run: |
           PATH=/usr/bin
-          export TFLAGS='-j8 ${{ matrix.tflags }} ~615'
+          export TFLAGS='-j8 ${{ matrix.tflags }}'
           if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
             TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
           fi
index 3bcd32aa4444c55101ec95e84526ef2eb3e55d6b..2d4f390f77cdb026fcaeda116fc9d874e2c417de 100755 (executable)
@@ -66,6 +66,9 @@ if ($ARGV[0] eq "prepare")
     # represented exactly on a FAT filesystem.
     utime time, timegm(0,0,12,31,11,100), "rofile.txt";
     chmod 0444, "rofile.txt";
+    if($^O eq 'cygwin') {
+      system "chattr +r rofile.txt";
+    }
 
     exit 0;
 }
@@ -75,6 +78,9 @@ elsif ($ARGV[0] eq "postprocess")
     my $logfile = $ARGV[2];
 
     # Clean up the test directory
+    if($^O eq 'cygwin') {
+      system "chattr -r $dirname/rofile.txt";
+    }
     chmod 0666, "$dirname/rofile.txt";
     unlink "$dirname/rofile.txt";
     unlink "$dirname/plainfile.txt";