Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54695 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18559 invoked from network); 18 Aug 2011 17:23:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2011 17:23:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=ulf.wendel@oracle.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ulf.wendel@oracle.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 148.87.113.117 cause and error) X-PHP-List-Original-Sender: ulf.wendel@oracle.com X-Host-Fingerprint: 148.87.113.117 rcsinet15.oracle.com Received: from [148.87.113.117] ([148.87.113.117:22823] helo=rcsinet15.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/66-21097-A7A4D4E4 for ; Thu, 18 Aug 2011 13:23:07 -0400 Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p7IHN1hl032437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 18 Aug 2011 17:23:03 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p7IHN0uh000988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 18 Aug 2011 17:23:01 GMT Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p7IHMtWR010038 for ; Thu, 18 Aug 2011 12:22:55 -0500 Received: from [192.168.2.116] (/91.6.183.105) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 18 Aug 2011 10:22:51 -0700 Message-ID: <4E4D4A73.5020106@oracle.com> Date: Thu, 18 Aug 2011 19:22:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: internals@lists.php.net References: <4E4C44AA.3070302@thelounge.net> In-Reply-To: <4E4C44AA.3070302@thelounge.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: rtcsinet21.oracle.com [66.248.204.29] X-CT-RefId: str=0001.0A090201.4E4D4A77.01F8,ss=1,re=0.000,fgs=0 Subject: Re: [PHP-DEV] Autotests: Access denied for user 'root'@'localhost' (using password: NO) From: ulf.wendel@oracle.com (Ulf Wendel) Am 18.08.2011 00:46, schrieb Reindl Harald: > Wouldn't it be a good idea to specify here a user/pwd/database for > build-systems without force them open root without password? > > SKIP mysql_get_host_info() [ext/mysql/tests/mysql_get_host_info.phpt] reason: Can't connect to MySQL Server - > [1045] Access denied for user 'root'@'localhost' (using password: NO) Please, configure the tests to use whatever database user you want them to use prior to running. If nothing else is configured, the tests need to make a guess on the on the DB credentials. The guess is user="root", password="" as such a DB account is available when doing, for example, a source installation of MySQL. Have a look at http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/mysql/tests/connect.inc?revision=296885&view=markup . It tries to check the environment for variable to allow for easy configuration but ultimately has some defaults in it. This is a common pattern, for example, check http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/oci8/tests/details.inc?revision=312024&view=markup . If no configuration done through environment settings, OCI8 tests default to DB user "system", password "oracle" - whatever user that is. grep -R getenv ext/*/tests/*.inc -> ext/ldap -> ext/mysqli -> ext/mysql -> ext/oci8 -> ext/pdo_mysql -> ext/pdo_pgsql -> ext/pdo -> ext/sybase grep -R getenv ext/*/tests/*.phpt -> ext/curl -> ext/pdo_ A potential pitfall that affects all test writers trying to allow configuration via environment settings is the - certainly sensible - variables_order setting found in php.ini-development and php.ini-production. php.ini-development:variables_order = "GPCS" php.ini-production:variables_order = "GPCS" If any of the two is used as a configuration file for running tests through run-tests.php, run-tests.phpt will not be able provide tests with all environment variables, http://lxr.php.net/xref/PHP_5_3/run-tests.php#140 . run-tests.php relies on $_ENV and $_ENV is empty. To make a long story short: tests may require manual configuration prior to running. Ulf