Annotation of embedaddon/php/ext/snmp/tests/bug64124.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #64124 IPv6 malformed
! 3: --CREDITS--
! 4: Boris Lytochkin
! 5: --SKIPIF--
! 6: <?php
! 7: require_once(dirname(__FILE__).'/skipif.inc');
! 8:
! 9: $packed = str_repeat(chr(0), 15) . chr(1);
! 10: if (@inet_ntop($packed) === false) {
! 11: die("skip no IPv6 support");
! 12: }
! 13: ?>
! 14: --FILE--
! 15: <?php
! 16: require_once(dirname(__FILE__).'/snmp_include.inc');
! 17:
! 18: # hostname variable was modified inline in netsnmp_session_init()
! 19: # Should be checked with IPv6 since IPv4 processing code do not alter pointer position
! 20:
! 21: //EXPECTF format is quickprint OFF
! 22: snmp_set_quick_print(false);
! 23: snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
! 24:
! 25: $checkvar = "$hostname6_port";
! 26:
! 27: var_dump(snmpget($checkvar, $community, '.1.3.6.1.2.1.1.1.0'));
! 28: var_dump(($checkvar === $hostname6_port));
! 29: var_dump(snmpget($checkvar, $community, '.1.3.6.1.2.1.1.1.0'));
! 30: var_dump(($checkvar === $hostname6_port));
! 31: var_dump(snmpget($checkvar, $community, '.1.3.6.1.2.1.1.1.0'));
! 32: var_dump(($checkvar === $hostname6_port));
! 33: ?>
! 34: --EXPECTF--
! 35: %unicode|string%(%d) "%s"
! 36: bool(true)
! 37: %unicode|string%(%d) "%s"
! 38: bool(true)
! 39: %unicode|string%(%d) "%s"
! 40: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>