Opened 3 years ago

Closed 3 years ago

Last modified 15 months ago

#2622 closed Bug (fixed)

Unit test ipv6 failing on windows

Reported by: matt Owned by:
Priority: normal Milestone: 1.6 Piwik 1.6
Component: Core Keywords:
Cc: Sensitive: no

Description

I have the following unit test failure on local windows box,

Fail: D:\piwik\svn\trunk/tests/core/IP.test.php -> Test_Piwik_IP -> test_getHostByAddr -> ::1 -> ip6-localhost at [D:\piwik\svn\trunk\tests\core\IP.test.php line 582]

Infos:
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.2 mod_perl/2.0.4 Perl/v5.10.1
PHP Version 5.3.6

Any idea?

Change History (12)

comment:1 Changed 3 years ago by vipsoft (robocoder)

What do you get for:

<?= php_uname('n');

comment:2 Changed 3 years ago by matt (mattab)

I get: string 'MYLAPTOP' (length=8)

comment:4 Changed 3 years ago by matt (mattab)

After svn up, still failing with:

Fail: Test_Piwik_IP -> test_getHostByAddr -> ::1 -> ip6-localhost at [D:\piwik\svn\trunk\tests\core\IP.test.php line 582]

comment:5 Changed 3 years ago by vipsoft (robocoder)

What do you get for Piwik_IP::getHostByAddr('::1') ?

Alternately, we could simply disable this test on Windows.

comment:6 Changed 3 years ago by matt (mattab)

I get an empty string for Piwik_IP::getHostByAddr('::1')

Is it OK to disable the test you think?

comment:7 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [5119]) fixes #2622

comment:8 Changed 3 years ago by vipsoft (robocoder)

(In [5120]) refs #2622 - strtolower converts it to an empty string

comment:9 Changed 3 years ago by matt (mattab)

  • Resolution fixed deleted
  • Status changed from closed to reopened

Sorry it is still failing on my config:
Fail: Test_Piwik_IP -> test_getHostByAddr -> ::1 -> ip6-localhost at [D:\piwik\svn\trunk\tests\core\IP.test.php line 582]

comment:10 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [5126]) fixes #2622

comment:11 Changed 15 months ago by Fabian Becker

In 97de0abfbca545f8192430ef705d2357363c5cea:

Build was failing again. Result of getHostByAddr
depends on /etc/hosts. On most systems ::1 will resolve
to ipv6-localhost, but for Travis it resolves to localhost.

refs #2622

comment:12 Changed 15 months ago by halfdan

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback

Note: See TracTickets for help on using tickets.