Doc #55474 [Opn->Fbk]: Improve tests/README...

From: Date: Tue, 23 Aug 2011 19:14:46 +0000
Subject: Doc #55474 [Opn->Fbk]: Improve tests/README...
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7049@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55474&edit=1 ID: 55474 Updated by: lytboris@php.net Reported by: ch@php.net Summary: Improve tests/README... -Status: Open +Status: Feedback Type: Documentation Problem Package: SNMP related Operating System: Debian Linux PHP Version: 5.4.0alpha3 -Assigned To: +Assigned To: lytboris Block user comment: N Private report: N New Comment: a) It is a strange command line for running tests, not sure it is quite correct. It is better to use something like make -C ../.. lcov TESTS="cd ../..; /bin/ls -1 ext/snmp/tests/*.phpt | xargs echo" This honors your environment variables for sure. b) Applied, thanks. Previous Comments: ------------------------------------------------------------------------ [2011-08-23 19:13:40] lytboris@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=315386 Log: apply docs fixes suggested in BR #55474 ------------------------------------------------------------------------ [2011-08-21 22:55:53] ch@php.net 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 this bug report at https://bugs.php.net/bug.php?id=55474&edit=1

« previous php.doc.bugs (#7049) next »