Annotation of embedaddon/php/ext/snmp/tests/bug60749.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #60749: SNMP module should not strip non-standard SNMP port from hostname
! 3: --CREDITS--
! 4: Boris Lytochkin
! 5: --SKIPIF--
! 6: <?php
! 7: require_once(dirname(__FILE__).'/skipif.inc');
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: require_once(dirname(__FILE__).'/snmp_include.inc');
! 12:
! 13: $hostname = "php.net";
! 14: $ip = gethostbyname($hostname);
! 15: if (ip2long($ip) === FALSE) {
! 16: echo "Could not resolve $hostname properly!\n";
! 17: exit(1);
! 18: }
! 19: $port = 1161;
! 20: $session = new SNMP(SNMP::VERSION_1, "$hostname:$port", $community, $timeout, $retries);
! 21: $info = $session->info;
! 22: if (strcmp($info["hostname"], "$ip:$port") !== 0) {
! 23: echo "'" . $info["hostname"] . "' != '$ip:$port'\n";
! 24: }
! 25: var_dump($session->close());
! 26: ?>
! 27: --EXPECTF--
! 28: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>