From: Viktor Szakats Date: Sat, 22 Mar 2025 09:41:44 +0000 (+0100) Subject: test613: make it pass on Windows, fix postprocess, unignore in CI X-Git-Tag: curl-8_13_0~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efa65b24ae22d8ae2798fb1a2b4cdc113270bdaf;p=thirdparty%2Fcurl.git 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 --- diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cc58940a9b..90f713b235 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 diff --git a/tests/data/test613 b/tests/data/test613 index 42cb1ee413..a61d82afd9 100644 --- a/tests/data/test613 +++ b/tests/data/test613 @@ -11,8 +11,8 @@ directory 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 diff --git a/tests/data/test614 b/tests/data/test614 index 53d34137ca..11851a7456 100644 --- a/tests/data/test614 +++ b/tests/data/test614 @@ -12,8 +12,8 @@ directory 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 diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index dee3b17543..3bcd32aa44 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -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