]> granicus.if.org Git - curl/commitdiff
Fixed test cases 613 and 614 by improving the log postprocessor to handle
authorDan Fandrich <dan@coneharvesters.com>
Tue, 17 Jul 2007 21:53:38 +0000 (21:53 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Tue, 17 Jul 2007 21:53:38 +0000 (21:53 +0000)
a new directory listing format that newer libssh2's can provide.  This
is probably NOT sufficient to handle all directory listing formats that
server's can provide and should be revisited.

CHANGES
tests/libtest/test613.pl

diff --git a/CHANGES b/CHANGES
index 570dcba8663eeaaa173bcf81c4816c241e0f1c24..0fabedee796abb37c03f84db2393f6004bee520a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,12 @@
 
                                   Changelog
 
+Dan F (17 July 2007)
+- Fixed test cases 613 and 614 by improving the log postprocessor to handle
+  a new directory listing format that newer libssh2's can provide.  This
+  is probably NOT sufficient to handle all directory listing formats that
+  server's can provide, and should be revisited.
+
 Daniel S (17 July 2007)
 - Jofell Gallardo posted a libcurl log using FTP that exposed a bug which made
   a control connection that was deemed "dead" to yet be re-used in a following
index 749763d4ecd06bd856e743bedecb81ad8b33f00f..778c4a91178c889c9ec3c5f41deaeed17d1b40ca 100755 (executable)
@@ -55,15 +55,25 @@ elsif ($ARGV[0] eq "postprocess")
        rmdir $dirname || die "$!";
 
        if ($logfile) {
-               # Process the directory file to remove all information that could
-               # be inconsistent from one test run to the next (e.g. file date)
-               # or may be unsupported on some platforms (e.g. Windows)
+               # Process the directory file to remove all information that
+               # could be inconsistent from one test run to the next (e.g.
+               # file date) or may be unsupported on some platforms (e.g.
+               # Windows). Also, since >7.16.4, the sftp directory listing
+               # format can be dependent on the server (with a recent
+               # enough version of libssh2) so this script must also
+               # canonicalize the format.  These are the two formats
+               # currently supported:
+               # -r--r--r--    1 ausername grp            47 Dec 31  2000 rofile.txt
+               # -r--r--r--   1  1234  4321         47 Dec 31  2000 rofile.txt
+               # The "canonical" format is similar to the second (which is
+               # the one generated with an older libssh2):
+               # -r-?r-?r-?   1     U     U         47 Dec 31  2000 rofile.txt
 
                my $newfile = $logfile . ".new";
                open(IN, "<$logfile") || die "$!";
                open(OUT, ">$newfile") || die "$!";
                while (<IN>) {
-                       s/^(.)(..).(..).(..).(.{4}?).{6}?.{6}?(.{12}?)/\1\2?\3?\4?\5     U     U\6/;
+                       s/^(.)(..).(..).(..).\s*(\d+)\s+\S+ \S?.{5}?(\s+\d)+(.{12}?)/\1\2?\3?\4?   \5     U     U\6\7/;
                        if ($1 eq "d") {
                                # Erase inodes, size, mode, time fields for directories
                                s/^.{14}?(.{12}?).{11}? ... .\d .\d:\d\d/d?????????   N\1          N ???  N NN:NN/;