1
0
mirror of https://github.com/moparisthebest/curl synced 2025-01-10 21:48:10 -05:00

test613.pl: make tests 613 and 614 work with OpenSSH for Windows

OpenSSH for Windows shows group and other/world permissions as *,
because those concepts do not exist on Windows. It also does not
show the current or parent directory, so we just ignore those.

Reviewed-by: Daniel Stenberg
Closes #5328
This commit is contained in:
Marc Hoersken 2020-05-05 22:05:49 +02:00
parent e1d81b52c0
commit 2d1745fe2c
No known key found for this signature in database
GPG Key ID: 61E03CBED7BC859E
3 changed files with 17 additions and 7 deletions

View File

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

View File

@ -11,8 +11,6 @@ directory
# Server-side # Server-side
<reply> <reply>
<datacheck> <datacheck>
d????????? N U U N ??? N NN:NN .
d????????? N U U N ??? N NN:NN ..
d????????? N U U N ??? N NN:NN asubdir 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 37 Jan 1 2000 plainfile.txt
-r-?r-?r-? 1 U U 47 Dec 31 2000 rofile.txt -r-?r-?r-? 1 U U 47 Dec 31 2000 rofile.txt

View File

@ -97,15 +97,29 @@ elsif ($ARGV[0] eq "postprocess")
my @canondir; my @canondir;
open(IN, "<$logfile") || die "$!"; open(IN, "<$logfile") || die "$!";
while (<IN>) { while (<IN>) {
/^(.)(..).(..).(..).\s*(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+\s+\S+\s+\S+)(.*)$/; /^(.)(..).(..).(..).\s*(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+\s+\S+\s+\S+)\s+(.*)$/;
if ($1 eq "d") { if ($1 eq "d") {
# Skip current and parent directory listing, because some SSH
# servers (eg. OpenSSH for Windows) are not listing those
if ($8 eq "." || $8 eq "..") {
next;
}
# Erase all directory metadata except for the name, as it is not # Erase all directory metadata except for the name, as it is not
# consistent for across all test systems and filesystems # consistent for across all test systems and filesystems
push @canondir, "d????????? N U U N ??? N NN:NN$8\n"; push @canondir, "d????????? N U U N ??? N NN:NN $8\n";
} elsif ($1 eq "-") { } 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;
}
# Erase user and group names, as they are not consistent across # Erase user and group names, as they are not consistent across
# all test systems # all test systems
my $line = sprintf("%s%s?%s?%s?%5d U U %15d %s%s\n", $1,$2,$3,$4,$5,$6,$7,$8); my $line = sprintf("%s%s?%s?%s?%5d U U %15d %s %s\n", $1,$u,$g,$o,$5,$6,$7,$8);
push @canondir, $line; push @canondir, $line;
} else { } else {
# Unexpected format; just pass it through and let the test fail # Unexpected format; just pass it through and let the test fail