Re: [Bug-wget] What are the tests testing?

2017-06-12 Thread Josef Moellers
On 12.06.2017 10:00, Tim Rühsen wrote:
> Hi Josef,
> 
> 
> On 06/12/2017 09:23 AM, Josef Moellers wrote:
>> Hello Tim,
>>
>> Thanks for the reply.
>>
>> On 10.06.2017 13:36, Tim Rühsen wrote:
>>> On Freitag, 9. Juni 2017 17:02:15 CEST Josef Moellers wrote:
 Hi,
>>>
>>> Hi Josef,
>>>
 I'm currently trying to build test suites for openQA.
 One of the candidates is wget and, luckily, it already provides quite an
 extensive test suite.
 I have successfully built an RPM which has all that is needed for the 
 tests.
 One test, Test-ftp-iri-fallback.px, fails on SLES12-SP2 and I can't see
 why. 
>>>
>>> Look at tests/Test-ftp-iri-fallback.log, if you can't interpret the content 
>>> send it here.
>>
>> I cannot find any such file, no *.log" anywhere in the vicinity of the
>> tests.
> 
> Ok, the .log files just contain the output of each single test when
> tested with 'make check'. If you use run-px, copy & pasting from the
> console is the right thing to do.
> 
>> Ah ... maybe I should have addede that I'm working on a slightly older
>> version of wget: 1.14, which we ship with SLES12.
> 
> So I compiled 1.14 (git tag v1.14) and used run-px to run the test suite
> - but still can't reproduce the problem (Debian unstable here, `locale`
> shows all set to 'en_US.UTF-8').
> 
>>
>> 227 Entering Passive Mode (127,0,0,1,155,189)
>> --> RETR français.txt^M
>>
>> 150 Opening ASCII mode data connection.
>> Length: 12 (unauthoritative)
>>
>>  0K   100% 2.95M=0s
>>
>> 226 File retrieval complete. Data connection has been closed.
>> 2017-06-09 16:42:53 (2.95 MB/s) - â<80><98>français.txtâ<80><99> saved [12]
>>
>> Test failed: file français.txt not downloaded
> 
> My out put looks identical except the these last lines:
> 
> 227 Entering Passive Mode (127,0,0,1,175,123)
> --> RETR français.txt
> 
> 150 Opening ASCII mode data connection.
> Length: 12 (unauthoritative)
> 
>  0K   100% 2.05M=0s
> 
> 226 File retrieval complete. Data connection has been closed.
> 2017-06-12 09:39:27 (2.05 MB/s) - ‘fran\347ais.txt’ saved [12]
> 
> Test successful.
> 
> 
> I just can guess:
> - something with your locale (what does the 'locale' command output ?)

LANG=POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Changing everything to en_US.UTF-8 doesn't help:
I added "export LC...=en_US.UTF-8" lines prior to running the test.
I must admit, I never really understood this "locale" thingy, it bites
my whenever I come close.

> - something with iconv() function
> 
> Does the same test fail if you use Wget 1.19.1 ?

I can't get it to build on SLES12 as it does not have libidn2(-devel)!

I'll keep on trying, but until then ...

> And from your 'update 2':
>> If I add the option "-O fran${ccedilla_l1}ais.txt" to the cmdline,
>> then the test succeeds:
> 
> Of course it does ;-) You simply created the expected output file...
> (circumventing the real test.)

:-(

Josef



signature.asc
Description: OpenPGP digital signature


Re: [Bug-wget] What are the tests testing?

2017-06-12 Thread Tim Rühsen
Hi Josef,


On 06/12/2017 09:23 AM, Josef Moellers wrote:
> Hello Tim,
> 
> Thanks for the reply.
> 
> On 10.06.2017 13:36, Tim Rühsen wrote:
>> On Freitag, 9. Juni 2017 17:02:15 CEST Josef Moellers wrote:
>>> Hi,
>>
>> Hi Josef,
>>
>>> I'm currently trying to build test suites for openQA.
>>> One of the candidates is wget and, luckily, it already provides quite an
>>> extensive test suite.
>>> I have successfully built an RPM which has all that is needed for the tests.
>>> One test, Test-ftp-iri-fallback.px, fails on SLES12-SP2 and I can't see
>>> why. 
>>
>> Look at tests/Test-ftp-iri-fallback.log, if you can't interpret the content 
>> send it here.
> 
> I cannot find any such file, no *.log" anywhere in the vicinity of the
> tests.

Ok, the .log files just contain the output of each single test when
tested with 'make check'. If you use run-px, copy & pasting from the
console is the right thing to do.

> Ah ... maybe I should have addede that I'm working on a slightly older
> version of wget: 1.14, which we ship with SLES12.

So I compiled 1.14 (git tag v1.14) and used run-px to run the test suite
- but still can't reproduce the problem (Debian unstable here, `locale`
shows all set to 'en_US.UTF-8').

> 
> 227 Entering Passive Mode (127,0,0,1,155,189)
> --> RETR français.txt^M
> 
> 150 Opening ASCII mode data connection.
> Length: 12 (unauthoritative)
> 
>  0K   100% 2.95M=0s
> 
> 226 File retrieval complete. Data connection has been closed.
> 2017-06-09 16:42:53 (2.95 MB/s) - â<80><98>français.txtâ<80><99> saved [12]
> 
> Test failed: file français.txt not downloaded

My out put looks identical except the these last lines:

227 Entering Passive Mode (127,0,0,1,175,123)
--> RETR français.txt

150 Opening ASCII mode data connection.
Length: 12 (unauthoritative)

 0K   100% 2.05M=0s

226 File retrieval complete. Data connection has been closed.
2017-06-12 09:39:27 (2.05 MB/s) - ‘fran\347ais.txt’ saved [12]

Test successful.


I just can guess:
- something with your locale (what does the 'locale' command output ?)
- something with iconv() function

Does the same test fail if you use Wget 1.19.1 ?


And from your 'update 2':
> If I add the option "-O fran${ccedilla_l1}ais.txt" to the cmdline,
> then the test succeeds:

Of course it does ;-) You simply created the expected output file...
(circumventing the real test.)

With Best Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: [Bug-wget] What are the tests testing?

2017-06-12 Thread Josef Moellers
On 12.06.2017 09:37, Josef Moellers wrote:
> On 12.06.2017 09:23, Josef Moellers wrote:
>> Hello Tim,
>>
>> Thanks for the reply.
> 
> I ran just this test under strace:
> top_srcdir=/var/opt/wget-tests
> test=Test-ftp-iri-fallback.px
> strace -fo test.out perl -I$top_srcdir/tests $top_srcdir/tests/$test
> $top_srcdir
> 
> and it seems that it never tests for fran\347ais.txt, but it does test
> for fran\303\247ais.txt:
> 3511  lstat("fran\303\247ais.txt", {st_mode=S_IFREG|0644, st_size=12,
> ...}) = 0
> 3511  geteuid() = 0
> 3511  lstat("fran\303\247ais.txt", {st_mode=S_IFREG|0644, st_size=12,
> ...}) = 0
> 3511  unlink("fran\303\247ais.txt") = 0
> 
> So, it does fall back to the UTF8 version of the filename but still
> checks for the iso-8859-1 filename!

Update^2:

If I add the option "-O fran${ccedilla_l1}ais.txt" to the cmdline, then
the test succeeds:
:
226 File retrieval complete. Data connection has been closed.
2017-06-12 09:38:43 (3.07 MB/s) - ‘fran\347ais.txt’ saved [12]

Test successful.
-end of output-

Josef

>> On 10.06.2017 13:36, Tim Rühsen wrote:
>>> On Freitag, 9. Juni 2017 17:02:15 CEST Josef Moellers wrote:
 Hi,
>>>
>>> Hi Josef,
>>>
 I'm currently trying to build test suites for openQA.
 One of the candidates is wget and, luckily, it already provides quite an
 extensive test suite.
 I have successfully built an RPM which has all that is needed for the 
 tests.
 One test, Test-ftp-iri-fallback.px, fails on SLES12-SP2 and I can't see
 why. 
>>>
>>> Look at tests/Test-ftp-iri-fallback.log, if you can't interpret the content 
>>> send it here.
>>
>> I cannot find any such file, no *.log" anywhere in the vicinity of the
>> tests.
>>
>> Ah ... maybe I should have addede that I'm working on a slightly older
>> version of wget: 1.14, which we ship with SLES12.
>>
>> NB I run the tests by calling
>>  run-px /var/opt/wget-tests
>> The tests are installed in /var/opt/wget-tests/tests and the wget binary
>> is in /var/opt/wget-tests/src (although I would have preferred to use
>> the system's own wget, but that's a thing to be considered later).
>>
>> I want to run just the tests in an openQA environment to aid in
>> integration testing. To that end, I am building an RPM with just enough
>> to run the tests:
>> tests/run-px
>> tests/unit-tests
>> tests/Test-*
>> tests/*.pm
>> tests/Makefile (not used)
>> tests/WgetFeature.cfg
>> tests/WgetTest.pm.in
>> tests/certs/*
>> src/wget
>>
 Is there a list describing exactly what each test checks and what a
 failure means?
>>>
>>> Each test should self-contain a short description of it's purpose, 
>>> sometimes 
>>> these are missing (accidentally).
>>
>> The accident must have happened here ;-)
>> NB The only difference I find between the 1.14 and the 1.19 versions of
>> this test is that the 1.19 version has the "name" hash tag in the
>> "FTPTest->new()" call.
>>
>>> Test-ftp-iri-fallback tries to FTP-download a file containing non-ASCII 
>>> char(s).
>>> The behavior of Wget (with IRI support) is to convert the file name to 
>>> UTF-8 
>>> for using with a RETR command.
>>> This should fail with a "550 file not found".
>>
>> It does.
>>
>>> Now Wget falls back to the unconverted file name and tries RETR again - 
>>> this 
>>> should succeed (we told the FTP test server to know this file name).
>>
>> This indeed succeeds, but in the end:
>>
>> Test failed: file français.txt not downloaded
>>
>>
>> As I cannot find any log file, here's the output the test produced
>> (using cut-and-past from the ssh tty):
>> 
>> Running Test-ftp-iri-fallback.px
>>
>> Running test Test-ftp-iri-fallback
>> Calling ../src/wget --local-encoding=iso-8859-1 -S
>> ftp://localhost:39938/français.txt
>> --2017-06-09 16:42:53--  ftp://localhost:39938/fran%C3%A7ais.txt
>>=> â<80><98>français.txtâ<80><99>
>> Resolving localhost (localhost)... ::1, 127.0.0.1
>> Connecting to localhost (localhost)|::1|:39938... failed: Connection
>> refused.
>> Connecting to localhost (localhost)|127.0.0.1|:39938... connected.
>> Logging in as anonymous ...
>> 220 GNU Wget Testing FTP Server ready.
>> --> USER anonymous^M
>>
>> 230 Anonymous user access granted.
>> --> SYST^M
>>
>> 215 UNIX Type: L8
>> --> PWD^M
>>
>> 257 "/"
>> --> TYPE I^M
>>
>> 200 TYPE changed to I.
>> ==> CWD not needed.
>> --> SIZE français.txt^M
>>
>> 550 File or directory not found.
>> --> PASV^M
>>
>> 227 Entering Passive Mode (127,0,0,1,179,75)
>> --> RETR français.txt^M
>>
>> Use of uninitialized value in string eq at
>> /var/opt/wget-tests/tests/FTPServer.pm line 251, <$socket> chunk 7.
>> 550 File not found.
>>
>> No such file â<80><98>français.txtâ<80><99>.
>>
>> --2017-06-09 16:42:53--  ftp://localhost:39938/fran%E7ais.txt
>>=> â<80><98>français.txtâ<80><99>
>> Connecting to localhost (localhost)|127.0.0.1|:39938... connected.
>> Logging in as anonymous ...
>> 220 GNU Wget Testing FTP Server ready.
>> --> USER anonymous^M

Re: [Bug-wget] What are the tests testing?

2017-06-12 Thread Josef Moellers
On 12.06.2017 09:23, Josef Moellers wrote:
> Hello Tim,
> 
> Thanks for the reply.

I ran just this test under strace:
top_srcdir=/var/opt/wget-tests
test=Test-ftp-iri-fallback.px
strace -fo test.out perl -I$top_srcdir/tests $top_srcdir/tests/$test
$top_srcdir

and it seems that it never tests for fran\347ais.txt, but it does test
for fran\303\247ais.txt:
3511  lstat("fran\303\247ais.txt", {st_mode=S_IFREG|0644, st_size=12,
...}) = 0
3511  geteuid() = 0
3511  lstat("fran\303\247ais.txt", {st_mode=S_IFREG|0644, st_size=12,
...}) = 0
3511  unlink("fran\303\247ais.txt") = 0

So, it does fall back to the UTF8 version of the filename but still
checks for the iso-8859-1 filename!


Josef

> On 10.06.2017 13:36, Tim Rühsen wrote:
>> On Freitag, 9. Juni 2017 17:02:15 CEST Josef Moellers wrote:
>>> Hi,
>>
>> Hi Josef,
>>
>>> I'm currently trying to build test suites for openQA.
>>> One of the candidates is wget and, luckily, it already provides quite an
>>> extensive test suite.
>>> I have successfully built an RPM which has all that is needed for the tests.
>>> One test, Test-ftp-iri-fallback.px, fails on SLES12-SP2 and I can't see
>>> why. 
>>
>> Look at tests/Test-ftp-iri-fallback.log, if you can't interpret the content 
>> send it here.
> 
> I cannot find any such file, no *.log" anywhere in the vicinity of the
> tests.
> 
> Ah ... maybe I should have addede that I'm working on a slightly older
> version of wget: 1.14, which we ship with SLES12.
> 
> NB I run the tests by calling
>   run-px /var/opt/wget-tests
> The tests are installed in /var/opt/wget-tests/tests and the wget binary
> is in /var/opt/wget-tests/src (although I would have preferred to use
> the system's own wget, but that's a thing to be considered later).
> 
> I want to run just the tests in an openQA environment to aid in
> integration testing. To that end, I am building an RPM with just enough
> to run the tests:
> tests/run-px
> tests/unit-tests
> tests/Test-*
> tests/*.pm
> tests/Makefile (not used)
> tests/WgetFeature.cfg
> tests/WgetTest.pm.in
> tests/certs/*
> src/wget
> 
>>> Is there a list describing exactly what each test checks and what a
>>> failure means?
>>
>> Each test should self-contain a short description of it's purpose, sometimes 
>> these are missing (accidentally).
> 
> The accident must have happened here ;-)
> NB The only difference I find between the 1.14 and the 1.19 versions of
> this test is that the 1.19 version has the "name" hash tag in the
> "FTPTest->new()" call.
> 
>> Test-ftp-iri-fallback tries to FTP-download a file containing non-ASCII 
>> char(s).
>> The behavior of Wget (with IRI support) is to convert the file name to UTF-8 
>> for using with a RETR command.
>> This should fail with a "550 file not found".
> 
> It does.
> 
>> Now Wget falls back to the unconverted file name and tries RETR again - this 
>> should succeed (we told the FTP test server to know this file name).
> 
> This indeed succeeds, but in the end:
> 
> Test failed: file français.txt not downloaded
> 
> 
> As I cannot find any log file, here's the output the test produced
> (using cut-and-past from the ssh tty):
> 
> Running Test-ftp-iri-fallback.px
> 
> Running test Test-ftp-iri-fallback
> Calling ../src/wget --local-encoding=iso-8859-1 -S
> ftp://localhost:39938/français.txt
> --2017-06-09 16:42:53--  ftp://localhost:39938/fran%C3%A7ais.txt
>=> â<80><98>français.txtâ<80><99>
> Resolving localhost (localhost)... ::1, 127.0.0.1
> Connecting to localhost (localhost)|::1|:39938... failed: Connection
> refused.
> Connecting to localhost (localhost)|127.0.0.1|:39938... connected.
> Logging in as anonymous ...
> 220 GNU Wget Testing FTP Server ready.
> --> USER anonymous^M
> 
> 230 Anonymous user access granted.
> --> SYST^M
> 
> 215 UNIX Type: L8
> --> PWD^M
> 
> 257 "/"
> --> TYPE I^M
> 
> 200 TYPE changed to I.
> ==> CWD not needed.
> --> SIZE français.txt^M
> 
> 550 File or directory not found.
> --> PASV^M
> 
> 227 Entering Passive Mode (127,0,0,1,179,75)
> --> RETR français.txt^M
> 
> Use of uninitialized value in string eq at
> /var/opt/wget-tests/tests/FTPServer.pm line 251, <$socket> chunk 7.
> 550 File not found.
> 
> No such file â<80><98>français.txtâ<80><99>.
> 
> --2017-06-09 16:42:53--  ftp://localhost:39938/fran%E7ais.txt
>=> â<80><98>français.txtâ<80><99>
> Connecting to localhost (localhost)|127.0.0.1|:39938... connected.
> Logging in as anonymous ...
> 220 GNU Wget Testing FTP Server ready.
> --> USER anonymous^M
> 
> 230 Anonymous user access granted.
> --> SYST^M
> 
> 215 UNIX Type: L8
> --> PWD^M
> 
> 257 "/"
> --> TYPE I^M
> 
> 200 TYPE changed to I.
> ==> CWD not needed.
> --> SIZE français.txt^M
> 
> 213 12
> --> PASV^M
> 
> 227 Entering Passive Mode (127,0,0,1,155,189)
> --> RETR français.txt^M
> 
> 150 Opening ASCII mode data connection.
> Length: 12 (unauthoritative)
> 
>  0K   100% 2.95M=0s
> 
> 226