mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/9297] Make EPSV unit tests work without IPv6.
PHPBB3-9297
This commit is contained in:
parent
18f19b03ab
commit
83fa6cffc3
1 changed files with 9 additions and 10 deletions
|
@ -17,20 +17,19 @@ class phpbb_ftp_fsock_test extends phpbb_test_case
|
|||
{
|
||||
public function test_pasv_epsv()
|
||||
{
|
||||
foreach (dns_get_record('ftp.debian.org', DNS_A | DNS_AAAA) as $row)
|
||||
$hostname = 'ftp.debian.org.';
|
||||
$ipv4 = gethostbyname($hostname);
|
||||
|
||||
if ($ipv4 == $hostname)
|
||||
{
|
||||
if (isset($row['ip']))
|
||||
{
|
||||
$ipv4 = $row['ip'];
|
||||
}
|
||||
else if (isset($row['ipv6']))
|
||||
{
|
||||
$ipv6 = $row['ipv6'];
|
||||
}
|
||||
$this->markTestSkipped("Got no A record back from DNS query for $hostname");
|
||||
}
|
||||
|
||||
// PASV
|
||||
$this->assert_ls_contains_debian($ipv4);
|
||||
$this->assert_ls_contains_debian("[$ipv6]");
|
||||
|
||||
// EPSV
|
||||
$this->assert_ls_contains_debian("[::ffff:$ipv4]");
|
||||
}
|
||||
|
||||
protected function assert_ls_contains_debian($hostname)
|
||||
|
|
Loading…
Add table
Reference in a new issue