auth_request_get_var_expand test fails on big endian arches.

Rafael dos Santos rdossant at redhat.com
Mon Nov 2 13:28:43 UTC 2015


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 at +domain1@+domain2
+user
+domain1 at +domain2
+service

7.91.205.21
73.150.2.210
54321
+password
+mech
secured
21
210
valid

instead of

---------- expected output ---------
+user at +domain1@+domain2
+user
+domain1 at +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


More information about the dovecot mailing list