]> sjero.net Git - wget/blob - tests/Test-ftp-list-Multinet.px
NEWS: cite --start-pos
[wget] / tests / Test-ftp-list-Multinet.px
1 #!/usr/bin/env perl
2
3
4 # 2013-10-17 Andrea Urbani (matfanjol)
5 # In this ftp test:
6 # - the response of SYST command is
7 #   215 UNIX MultiNet Unix Emulation V5.3(93)
8 # - the response of "LIST -a" command is an empty
9 #   directory.
10 # wget should use directly the "LIST" command to get
11 # the right content, but it will be ok also "LIST -a"
12 # if followed by "LIST" (in the case of future changes).
13
14
15 use strict;
16 use warnings;
17
18 use FTPTest;
19
20
21 ###############################################################################
22
23 my $afile = <<EOF;
24 Some text.
25 EOF
26
27 my $bfile = <<EOF;
28 Some more text.
29 EOF
30
31 $afile =~ s/\n/\r\n/g;
32 $bfile =~ s/\n/\r\n/g;
33
34 # code, msg, headers, content
35 my %urls = (
36     '/afile.txt' => {
37         content => $afile,
38     },
39     '/bfile.txt' => {
40         content => $bfile,
41     },
42 );
43
44 my $cmdline = $WgetTest::WGETPATH . " --no-directories --recursive --level=1 --accept \"?file.txt\" ftp://localhost:{{port}}/";
45
46 my $expected_error_code = 0;
47
48 my %expected_downloaded_files = (
49     'afile.txt' => {
50         content => $afile,
51     },
52     'bfile.txt' => {
53         content => $bfile,
54     },
55 );
56
57 ###############################################################################
58
59 my $the_test = FTPTest->new (name => "Test-ftp-list-Multinet",
60                              input => \%urls,
61                              cmdline => $cmdline,
62                              errcode => $expected_error_code,
63                              output => \%expected_downloaded_files,
64                              server_behavior => {list_empty_if_list_a => 1,
65                                                  syst_response => "215 UNIX MultiNet Unix Emulation V5.3(93)"});
66 exit $the_test->run();
67