Re: auth_request_get_var_expand test fails on big endian arches.
Hi, On 27 November 2015 at 13:42, Timo Sirainenwrote: > On 02 Nov 2015, at 15:28, Rafael dos Santos wrote: > > > > Hi, > > > > when running the tests in a big endian machine, I get the following > error: > > > > 0 / 1 tests failed > > test-auth-request-var-expand.c:99: Assert failed: strcmp(str_c(str), > > test_output) == 0 > > test-auth-request-var-expand.c:104: Assert failed: strcmp(str_c(str), > > test_output) == 0 > > auth request var expand short and long ... : > > FAILED > > Should be fixed by http://hg.dovecot.org/dovecot-2.2/rev/cf956e34dc11 > I will test on a big-endian machine and report back. Att. -- Rafael Fonseca
Re: auth_request_get_var_expand test fails on big endian arches.
On 02 Nov 2015, at 15:28, Rafael dos Santoswrote: > > Hi, > > when running the tests in a big endian machine, I get the following error: > > 0 / 1 tests failed > test-auth-request-var-expand.c:99: Assert failed: strcmp(str_c(str), > test_output) == 0 > test-auth-request-var-expand.c:104: Assert failed: strcmp(str_c(str), > test_output) == 0 > auth request var expand short and long ... : > FAILED Should be fixed by http://hg.dovecot.org/dovecot-2.2/rev/cf956e34dc11
Re: auth_request_get_var_expand test fails on big endian arches.
Timo, On 27 November 2015 at 13:49, Rafael dos Santoswrote: > > >> Should be fixed by http://hg.dovecot.org/dovecot-2.2/rev/cf956e34dc11 >> > > > I will test on a big-endian machine and report back. > I tested the patch and now all tests pass. Thank you for the fix! Att. -- Rafael Fonseca
auth_request_get_var_expand test fails on big endian arches.
Hi, when running the tests in a big endian machine, I get the following error: 0 / 1 tests failed test-auth-request-var-expand.c:99: Assert failed: strcmp(str_c(str), test_output) == 0 test-auth-request-var-expand.c:104: Assert failed: strcmp(str_c(str), test_output) == 0 auth request var expand short and long ... : FAILED test: random seed #1 was 1446803094 auth request var expand flags : ok test-auth-request-var-expand.c:158: Assert failed: strcmp(str_c(str), test_output) == 0 auth request var expand long-only : FAILED auth request var expand usernames : ok auth request var expand funcs : ok 2 / 5 tests failed Makefile:1257: recipe for target 'check-test' failed Looking into it I found that auth_request_get_var_expand_table ends up calling the net_ip2addr function. This function, in turn, uses ntohl to convert from network byte order to host byte order. In big endian machines, that means that the string output will be - big endian --- +user@+domain1@+domain2 +user +domain1@+domain2 +service 7.91.205.21 73.150.2.210 54321 +password +mech secured 21 210 valid instead of -- expected output - +user@+domain1@+domain2 +user +domain1@+domain2 +service 21.205.91.7 210.2.150.73 54321 +password +mech secured 21 210 valid Let me know in case you need help testing on big endian arches. Att. -- Rafael Fonseca