public static function init() { self::$flags = 0; self::$os_identifier_sha1 = sha1(phodevi::read_property('system', 'vendor-identifier')); self::$is_live_cd = 1 << 1; self::$no_network_communication = 1 << 2; self::$no_openbenchmarking_reporting = 1 << 3; self::$user_agreement_skip = 1 << 4; self::$skip_md5_checks = 1 << 5; self::$remove_test_on_completion = 1 << 6; self::$no_phodevi_cache = 1 << 7; self::$no_external_dependencies = 1 << 8; self::$upload_to_openbenchmarking = 1 << 9; switch (self::$os_identifier_sha1) { case 'b28d6a7148b34595c5b397dfcf5b12ac7932b3dc': // Moscow 2011-04 client self::$flags = self::$is_live_cd | self::$no_network_communication | self::$no_openbenchmarking_reporting | self::$user_agreement_skip | self::$skip_md5_checks | self::$remove_test_on_completion; break; } if (pts_client::read_env('NO_FILE_HASH_CHECKS') != false || pts_client::read_env('NO_MD5_CHECKS') != false) { self::$flags |= self::$skip_md5_checks; } if (pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/RemoveTestInstallOnCompletion', 'FALSE')) { self::$flags |= self::$remove_test_on_completion; } if (pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/AlwaysUploadResultsToOpenBenchmarking', 'FALSE')) { self::$flags |= self::$upload_to_openbenchmarking; } if (pts_client::read_env('NO_PHODEVI_CACHE') != false) { self::$flags |= self::$no_phodevi_cache; } if (pts_client::read_env('NO_EXTERNAL_DEPENDENCIES') != false || pts_client::read_env('SKIP_EXTERNAL_DEPENDENCIES') == 1) { // NO_EXTERNAL_DEPENDENCIES was deprecated in PTS 3.6 and replaced by more versatile SKIP_EXTERNAL_DEPENDENCIES self::$flags |= self::$no_external_dependencies; } }
public static function client_startup() { if (($proxy_address = pts_config::read_user_config('PhoronixTestSuite/Options/Networking/ProxyAddress', false)) && ($proxy_port = pts_config::read_user_config('PhoronixTestSuite/Options/Networking/ProxyPort', false))) { self::$network_proxy['proxy'] = $proxy_address . ':' . $proxy_port; self::$network_proxy['address'] = $proxy_address; self::$network_proxy['port'] = $proxy_port; } else { if (($env_proxy = getenv('http_proxy')) != false && count($env_proxy = pts_strings::colon_explode($env_proxy)) == 2) { self::$network_proxy['proxy'] = $env_proxy[0] . ':' . $env_proxy[1]; self::$network_proxy['address'] = $env_proxy[0]; self::$network_proxy['port'] = $env_proxy[1]; } } self::$network_timeout = pts_config::read_user_config('PhoronixTestSuite/Options/Networking/Timeout', 20); if (ini_get('allow_url_fopen') == 'Off') { if (!defined('PHOROMATIC_SERVER')) { echo PHP_EOL . 'The allow_url_fopen option in your PHP configuration must be enabled for network support.' . PHP_EOL . PHP_EOL; } self::$disable_network_support = true; } else { if (pts_config::read_bool_config('PhoronixTestSuite/Options/Networking/NoInternetCommunication', 'FALSE')) { if (!defined('PHOROMATIC_SERVER')) { echo PHP_EOL . 'Internet Communication Is Disabled Per Your User Configuration.' . PHP_EOL . PHP_EOL; } self::$disable_internet_support = true; } else { if (pts_config::read_bool_config('PhoronixTestSuite/Options/Networking/NoNetworkCommunication', 'FALSE')) { if (!defined('PHOROMATIC_SERVER')) { echo PHP_EOL . 'Network Communication Is Disabled Per Your User Configuration.' . PHP_EOL . PHP_EOL; } self::$disable_network_support = true; } else { if (pts_flags::no_network_communication() == true) { //echo PHP_EOL . 'Network Communication Is Disabled Per Your User Configuration.' . PHP_EOL . PHP_EOL; self::$disable_network_support = true; } else { if (!PTS_IS_WEB_CLIENT) { $server_response = pts_network::http_get_contents('http://www.phoronix-test-suite.com/PTS', false, false); if ($server_response != 'PTS') { // Failed to connect to PTS server // As a last resort, see if it can resolve IP to Google.com as a test for Internet connectivity... // i.e. in case Phoronix server is down or some other issue, so just see if Google will resolve // If google.com fails to resolve, it will simply return the original string if (gethostbyname('google.com') == 'google.com') { echo PHP_EOL; if (PTS_IS_DAEMONIZED_SERVER_PROCESS) { // Wait some seconds in case network is still coming up foreach (array(20, 40) as $time_to_wait) { sleep($time_to_wait); $server_response = pts_network::http_get_contents('http://www.phoronix-test-suite.com/PTS', false, false); if ($server_response != 'PTS' && gethostbyname('google.com') == 'google.com') { trigger_error('No Internet Connectivity After Wait', E_USER_WARNING); self::$disable_internet_support = true; } else { self::$disable_internet_support = false; break; } } } else { trigger_error('No Internet Connectivity', E_USER_WARNING); self::$disable_internet_support = true; } } } } } } } } if (pts_network::network_support_available() == false && ini_get('file_uploads') == 'Off') { echo PHP_EOL . 'The file_uploads option in your PHP configuration must be enabled for network support.' . PHP_EOL . PHP_EOL; } }