PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/sockets/tests/mcast_ipv6_recv.phpt ('Multicast support: IPv6 receive options')

Script

1: <?php
2:
include __DIR__."/mcast_helpers.php.inc";
3:
$domain AF_INET6;
4:
$level IPPROTO_IPV6;
5:
$interface 0;
6:
$mcastaddr 'ff01::114';
7:
$sblock "?";
8:
9: echo 
"creating send socket\n";
10:
$sends1 socket_create($domainSOCK_DGRAMSOL_UDP) or die("err");
11:
var_dump($sends1);
12:
13: echo 
"creating receive socket\n";
14:
$s socket_create($domainSOCK_DGRAMSOL_UDP) or die("err");
15:
var_dump($s);
16:
$br socket_bind($s'::0'3000) or die("err");
17:
var_dump($br);
18:
19:
$so socket_set_option($s$levelMCAST_JOIN_GROUP, array(
20:     
"group"    => $mcastaddr,
21:     
"interface" => $interface,
22: )) or die(
"err");
23:
var_dump($so);
24:
25:
$r socket_sendto($sends1$m "testing packet"strlen($m), 0$mcastaddr3000);
26:
var_dump($r);
27:
checktimeout($s500);
28:
$r socket_recvfrom($s$str20000$from$fromPort);
29:
var_dump($r$str$from);
30:
$sblock $from;
31:
32:
$r socket_sendto($sends1$m "initial packet"strlen($m), 0$mcastaddr3000);
33:
var_dump($r);
34:
35:
$i 0;
36:
checktimeout($s500);
37: while ((
$str socket_read($s3000)) !== FALSE) {
38:     
$i++;
39:     echo 
"$i> "$str"\n";
40:
41: if (
$i == 1) {
42:     echo 
"leaving group\n";
43:     
$so socket_set_option($s$levelMCAST_LEAVE_GROUP, array(
44:         
"group"    => $mcastaddr,
45:         
"interface" => $interface,
46:     ));
47:     
var_dump($so);
48:     
$r socket_sendto($sends1$m "ignored mcast packet"strlen($m), 0$mcastaddr3000);
49:     
var_dump($r);
50:     
$r socket_sendto($sends1$m "unicast packet"strlen($m), 0"::1"3000);
51:     
var_dump($r);
52: }
53: if (
$i == 2) {
54:     echo 
"re-joining group\n";
55:     
$so socket_set_option($s$levelMCAST_JOIN_GROUP, array(
56:         
"group"    => $mcastaddr,
57:         
"interface" => $interface,
58:     ));
59:     
var_dump($so);
60:     
$r socket_sendto($sends1$m "mcast packet"strlen($m), 0$mcastaddr3000);
61:     
var_dump($r);
62: }
63: if (
$i == 3) {
64:     echo 
"blocking source\n";
65:     
$so socket_set_option($s$levelMCAST_BLOCK_SOURCE, array(
66:         
"group"    => $mcastaddr,
67:         
"interface" => $interface,
68:         
"source" => $sblock,
69:     ));
70:     
var_dump($so);
71:     
$r socket_sendto($sends1$m "ignored packet (blocked source)"strlen($m), 0$mcastaddr3000);
72:     
var_dump($r);
73:     
$r socket_sendto($sends1$m "unicast packet"strlen($m), 0"::1"3000);
74:     
var_dump($r);
75: }
76: if (
$i == 4) {
77:     echo 
"unblocking source\n";
78:     
$so socket_set_option($s$levelMCAST_UNBLOCK_SOURCE, array(
79:         
"group"    => $mcastaddr,
80:         
"interface" => $interface,
81:         
"source" => $sblock,
82:     ));
83:     
var_dump($so);
84:     
$r socket_sendto($sends1$m "mcast packet"strlen($m), 0$mcastaddr3000);
85:     
var_dump($r);
86: }
87: if (
$i == 5) {
88:     echo 
"leaving group\n";
89:     
$so socket_set_option($s$levelMCAST_LEAVE_GROUP, array(
90:         
"group"    => $mcastaddr,
91:         
"interface" => $interface,
92:     ));
93:     
var_dump($so);
94:     
$r socket_sendto($sends1$m "ignored mcast packet"strlen($m), 0$mcastaddr3000);
95:     
var_dump($r);
96:     
$r socket_sendto($sends1$m "unicast packet"strlen($m), 0"::1"3000);
97:     
var_dump($r);
98: }
99: if (
$i == 6) {
100:     echo 
"joining source group\n";
101:     
$so socket_set_option($s$levelMCAST_JOIN_SOURCE_GROUP, array(
102:         
"group"    => $mcastaddr,
103:         
"interface" => $interface,
104:         
"source" => $sblock,
105:     ));
106:     
var_dump($so);
107:     
$r socket_sendto($sends1$m "mcast packet from desired source"strlen($m), 0$mcastaddr3000);
108:     
var_dump($r);
109: }
110: if (
$i == 7) {
111:     echo 
"leaving source group\n";
112:     
$so socket_set_option($s$levelMCAST_LEAVE_SOURCE_GROUP, array(
113:         
"group"    => $mcastaddr,
114:         
"interface" => $interface,
115:         
"source" => $sblock,
116:     ));
117:     
var_dump($so);
118:     
$r socket_sendto($sends1$m "ignored mcast packet"strlen($m), 0$mcastaddr3000);
119:     
var_dump($r);
120:     
$r socket_sendto($sends1$m "unicast packet"strlen($m), 0"::1"3000);
121:     
var_dump($r);
122: }
123: if (
$i == 8) {
124:     
/*echo "joining source group\n";
125:     $so = socket_set_option($s, $level, MCAST_JOIN_SOURCE_GROUP, array(
126:         "group"    => $mcastaddr,
127:         "interface" => $interface,
128:         "source" => $sblock,
129:     ));
130:     var_dump($so);*/
131:     
break;
132: }
133:
134: }
135:

Expected

creating send socket
resource(%d) of type (Socket)
creating receive socket
resource(%d) of type (Socket)
bool(true)
bool(true)
int(14)
int(14)
string(14) "testing packet"
string(%d) "%s"
int(14)
1> initial packet
leaving group
bool(true)
int(20)
int(14)
2> unicast packet
re-joining group
bool(true)
int(12)
3> mcast packet
blocking source
bool(true)
int(31)
int(14)
4> unicast packet
unblocking source
bool(true)
int(12)
5> mcast packet
leaving group
bool(true)
int(20)
int(14)
6> unicast packet
joining source group
bool(true)
int(32)
7> mcast packet from desired source
leaving source group
bool(true)
int(20)
int(14)
8> unicast packet

Output

creating send socket
resource(5) of type (Socket)
creating receive socket
resource(6) of type (Socket)
bool(true)
bool(true)
int(14)
Socket read timeout hit. Can be a bug, a test bug, or a firewall issue.

Diff

008+ Socket read timeout hit. Can be a bug, a test bug, or a firewall issue.
008- int(14)

009- string(14) "testing packet"

010- string(%d) "%s"

011- int(14)

012- 1> initial packet

013- leaving group

014- bool(true)

015- int(20)

016- int(14)

017- 2> unicast packet

018- re-joining group

019- bool(true)

020- int(12)

021- 3> mcast packet

022- blocking source

023- bool(true)

024- int(31)

025- int(14)

026- 4> unicast packet

027- unblocking source

028- bool(true)

029- int(12)

030- 5> mcast packet

031- leaving group

032- bool(true)

033- int(20)

034- int(14)

035- 6> unicast packet

036- joining source group

037- bool(true)

038- int(32)

039- 7> mcast packet from desired source

040- leaving source group

041- bool(true)

042- int(20)

043- int(14)

044- 8> unicast packet

 

Generated at Thu, 20 Nov 2014 12:38:44 +0000 (10 hours ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.