Doc #55474 [NEW]: Improve tests/README...
| From: | ch@php.net | Date: | Sun, 21 Aug 2011 22:55:54 +0000 |
| Subject: | Doc #55474 [NEW]: Improve tests/README... | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-7042@lists.php.net to get a copy of this message | ||
From:
Operating system: Debian Linux
PHP version: 5.4.0alpha3
Package: SNMP related
Bug Type: Documentation Problem
Bug description:Improve tests/README...
Description:
------------
Hello
I tried to run the test suite to eventually create a test case with IPv6
IPs but found two problems:
a) The README says that I can specify certain environment variables but
that does not seem to work:
$ TEST_PHP_EXECUTABLE="./sapi/cli/php" SNMP_MIBDIR="/var/lib/mibs/ietf/"
./run-tests.php ext/snmp/tests/snmp_read_mib.phpt
=====================================================================
PHP : ./sapi/cli/php
PHP_SAPI : cli
PHP_VERSION : 5.4.0alpha2
ZEND_VERSION: 2.4.0
PHP_OS : Linux - Linux james 3.0.0-1-amd64 #1 SMP Sun Jul 24 02:24:44
UTC 2011 x86_64
INI actual : /srv/home/james/workspace/php-src-5.4
More .INIs :
CWD : /srv/home/james/workspace/php-src-5.4
Extra dirs :
VALGRIND : Not used
=====================================================================
Running selected tests.
FAIL Function snmp_read_mib [ext/snmp/tests/snmp_read_mib.phpt]
=====================================================================
Number of tests : 1 1
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 1 (100.0%) (100.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 0 seconds
=====================================================================
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Function snmp_read_mib [ext/snmp/tests/snmp_read_mib.phpt]
=====================================================================
The output of phpinfo() called from this .phpt file shows that the
environment seems to be cleared:
Environment
Variable => Value
SCRIPT_FILENAME =>
/srv/home/james/workspace/php-src-5.4/ext/snmp/tests/snmp_read_mib.php
USE_ZEND_ALLOC => 1
PWD => /srv/home/james/workspace/php-src-5.4
TEST_PHP_EXECUTABLE => ./sapi/cli/php
REDIRECT_STATUS => 1
PATH_TRANSLATED => /srv/home/james/workspace/php-src-5.4/ext/snmp/tests
/snmp_read_mib.php
SHLVL => 1
REQUEST_METHOD => GET
_ => ./sapi/cli/php
Any other idea how to modify the MIB variable?
b) I propose to extract the snmpd config settings into a test-snmpd.conf
and put the command line to execute the daemon with this file into the
README. Saves the users from trying to figure out how to start snmpd.
In addition the below contains IPv6 IPs as well:
$ cat ext/snmp/tests/test-snmpd.conf
# Listen for connections from the local system only
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:127.0.0.1:161,udp6:[::1]:161
rocommunity public 127.0.0.1
rwcommunity private 127.0.0.1
rwcommunity6 private ::1
rocommunity6 public ::1
#Do not enable them - being set here they make appropriate OID switch into
r/o
#syslocation "Somewhere in the world"
#syscontact "root"
#SNMPv3 credentials
rouser adminMD5
rouser adminSHA
rwuser adminMD5AES
rouser adminMD5AES128
rouser adminMD5DES
createUser adminMD5 MD5 test1234
createUser adminSHA SHA test1234
createUser adminMD5AES MD5 test1234 AES test1234
createUser adminMD5AES128 MD5 test1234 AES test1234
createUser adminMD5DES MD5 test1234 DES test1234
createUser noAuthUser
authuser read noAuthUser noauth
And the snmpd command line would be:
sudo snmpd -C -c test-snmpd.conf -f -Le
--
Edit bug report at https://bugs.php.net/bug.php?id=55474&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55474&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55474&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55474&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55474&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55474&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55474&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55474&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55474&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55474&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55474&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55474&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55474&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55474&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55474&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55474&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55474&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55474&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55474&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55474&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55474&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55474&r=mysqlcfg