lytboris                                 Wed, 31 Aug 2011 19:45:45 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=315917

Log:
test coverage for SNMP::ERRNO_MULTIPLE_SET_QUERIES

Changed paths:
    _U  php/php-src/branches/PHP_5_4/ext/snmp/tests/
    U   
php/php-src/branches/PHP_5_4/ext/snmp/tests/snmp-object-errno-errstr.phpt


Property changes on: php/php-src/branches/PHP_5_4/ext/snmp/tests
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/trunk/ext/snmp/tests:284726,311033-315236,315386,315606,315608,315862
   + 
/php/php-src/trunk/ext/snmp/tests:284726,311033-315236,315386,315606,315608,315862,315916

Modified: 
php/php-src/branches/PHP_5_4/ext/snmp/tests/snmp-object-errno-errstr.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/snmp/tests/snmp-object-errno-errstr.phpt   
2011-08-31 19:44:39 UTC (rev 315916)
+++ php/php-src/branches/PHP_5_4/ext/snmp/tests/snmp-object-errno-errstr.phpt   
2011-08-31 19:45:45 UTC (rev 315917)
@@ -73,6 +73,30 @@
 var_dump(@$session->set($oid1, 'q', 'blah'));
 var_dump($session->getErrno() == SNMP::ERRNO_OID_PARSING_ERROR);
 var_dump($session->getError());
+
+echo "SNMP::ERRNO_MULTIPLE_SET_QUERIES\n";
+$oid1 = 'SNMPv2-MIB::sysContact.0';
+$oid2 = 'SNMPv2-MIB::sysLocation.0';
+$session = new SNMP(SNMP::VERSION_3, $hostname, $rwuser, $timeout, $retries);
+$session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass);
+$session->max_oids = 1;
+$oldvalue1 = $session->get($oid1);
+$newvalue1 = $oldvalue1 . '0';
+$oldvalue2 = $session->get($oid2);
+$newvalue2 = $oldvalue2 . '0';
+$z = @$session->set(array($oid1, $oid2), array('s','s'), array($newvalue1, 
$newvalue2));
+var_dump($z);
+var_dump($session->getErrno() == SNMP::ERRNO_MULTIPLE_SET_QUERIES);
+var_dump($session->getError());
+var_dump(($session->get($oid1) === $newvalue1));
+var_dump(($session->get($oid2) === $newvalue2));
+$z = @$session->set(array($oid1, $oid2), array('s','s'), array($oldvalue1, 
$oldvalue2));
+var_dump($z);
+var_dump($session->getErrno() == SNMP::ERRNO_MULTIPLE_SET_QUERIES);
+var_dump($session->getError());
+var_dump(($session->get($oid1) === $oldvalue1));
+var_dump(($session->get($oid2) === $oldvalue2));
+var_dump($session->close());
 ?>
 --EXPECTF--
 SNMP::ERRNO_NOERROR
@@ -108,4 +132,16 @@
 SET: Wrong type
 bool(false)
 bool(true)
-string(129) "Could not add variable: 
OID='.iso.org.dod.internet.mgmt.mib-2.system.sysContact.0' type='q' 
value='blah': Bad variable type ("q")"
\ No newline at end of file
+string(129) "Could not add variable: 
OID='.iso.org.dod.internet.mgmt.mib-2.system.sysContact.0' type='q' 
value='blah': Bad variable type ("q")"
+SNMP::ERRNO_MULTIPLE_SET_QUERIES
+bool(true)
+bool(true)
+string(74) "Can not fit all OIDs for SET query into one packet, using multiple 
queries"
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+string(74) "Can not fit all OIDs for SET query into one packet, using multiple 
queries"
+bool(true)
+bool(true)
+bool(true)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to