Tests should not depend on localhost==127.0.0.1 (Test 'addr/basic' failure in tor master)
I just built branch 'master' (revision 46434ecf) from the tor.git repository with gcc 4.5.3 on x86_64-linux using this configure line:
CC="gcc -m64 -mtune=core2" PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig PKG_CONFIG_PATH=/usr/share/pkgconfig ./configure --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec64 --sysconfdir=/etc --localstatedir=/var --build=x86_64-linux --host=x86_64-linux --disable-linker-hardening --disable-asciidoc
This causes a test suite failure I haven't seen before:
addr/basic: FAIL test_addr.c:36: assert((u32) == (0x7f000001u)): 2851995905 vs 2130706433 [basic FAILED]
Turns out the DNS in this hotel resolves localhost to 169.254.1.1. This is horribly wrong, of course, and I should have had a proper /etc/hosts for it anyway (lashes self with wet noodle), but why does the test suite depend on stuff random machines elsewhere on the network do at all to pass? Shouldn't we mock this stuff somehow?