How to use test_install_error method of pts_test_installer class

Best Phoronix-test-suite code snippet using pts_test_installer.test_install_error

pts_test_installer.php

Source:pts_test_installer.php Github

copy

Full Screen

...16 along with this program. If not, see <http://www.gnu.org/licenses/>.17*/18class pts_test_installer19{20 protected static function test_install_error($test_run_manager, &$test_run_request, $error_msg)21 {22 $error_obj = array($test_run_manager, $test_run_request, $error_msg);23 pts_module_manager::module_process('__event_run_error', $error_obj);24 pts_client::$display->test_install_error($error_msg);25 }26 public static function standard_install($items_to_install, $force_install = false, $no_prompts = false, $skip_tests_with_missing_dependencies = false)27 {28 // Refresh the pts_client::$display in case we need to run in debug mode29 if(pts_client::$display == false || !(pts_client::$display instanceof pts_websocket_display_mode))30 {31 pts_client::init_display_mode();32 }33 // Create a lock34 $lock_path = pts_client::temporary_directory() . '/phoronix-test-suite.active';35 pts_client::create_lock($lock_path);36 // Get the test profiles37 $unknown_tests = array();38 $test_profiles = pts_types::identifiers_to_test_profile_objects($items_to_install, true, true, $unknown_tests);39 // Any external dependencies?40 pts_external_dependencies::install_dependencies($test_profiles, $no_prompts, $skip_tests_with_missing_dependencies);41 // Install tests42 if(!is_writable(pts_client::test_install_root_path()))43 {44 trigger_error('The test installation directory is not writable.' . PHP_EOL . 'Location: ' . pts_client::test_install_root_path(), E_USER_ERROR);45 return false;46 }47 pts_test_installer::start_install($test_profiles, $unknown_tests, $force_install, $no_prompts);48 pts_client::release_lock($lock_path);49 return $test_profiles;50 }51 public static function start_install(&$test_profiles, &$unknown_tests = null, $force_install = false, $no_prompts = false)52 {53 if(count($test_profiles) == 0)54 {55 trigger_error('No Tests Found For Installation.', E_USER_ERROR);56 return false;57 }58 // Setup the install manager and add the tests59 $test_install_manager = new pts_test_install_manager();60 foreach($test_profiles as &$test_profile)61 {62 if($test_profile->get_identifier() == null)63 {64 continue;65 }66 if($test_profile->needs_updated_install() || $force_install)67 {68 if($test_profile->is_supported(false) == false)69 {70 pts_client::$display->generic_sub_heading('Not Supported: ' . $test_profile->get_identifier());71 }72 else if($test_install_manager->add_test_profile($test_profile) != false)73 {74 pts_client::$display->generic_sub_heading('To Install: ' . $test_profile->get_identifier());75 }76 }77 else78 {79 pts_client::$display->generic_sub_heading('Installed: ' . $test_profile->get_identifier());80 }81 }82 if($unknown_tests)83 {84 foreach($unknown_tests as $unkown)85 {86 pts_client::$display->generic_sub_heading('Unknown: ' . $unkown);87 }88 }89 if($test_install_manager->tests_to_install_count() == 0)90 {91 return true;92 }93 // Let the pts_test_install_manager make some estimations, etc...94 echo PHP_EOL;95 $test_install_manager->generate_download_file_lists();96 $test_install_manager->check_download_caches_for_files();97 pts_client::$display->test_install_process($test_install_manager);98 // Begin the install process99 pts_module_manager::module_process('__pre_install_process', $test_install_manager);100 $failed_installs = array();101 $test_profiles = array();102 while(($test_install_request = $test_install_manager->next_in_install_queue()) != false)103 {104 pts_client::$display->test_install_start($test_install_request->test_profile->get_identifier());105 $test_install_request->special_environment_vars['INSTALL_FOOTNOTE'] = $test_install_request->test_profile->get_install_dir() . 'install-footnote';106 $installed = pts_test_installer::install_test_process($test_install_request, $no_prompts);107 $compiler_data = pts_test_installer::end_compiler_mask($test_install_request);108 if($installed)109 {110 if(pts_client::do_anonymous_usage_reporting() && $test_install_request->install_time_duration > 0)111 {112 // If anonymous usage reporting enabled, report install time to OpenBenchmarking.org113 pts_openbenchmarking_client::upload_usage_data('test_install', array($test_install_request, $test_install_request->install_time_duration));114 }115 $install_footnote = null;116 if(is_file($test_install_request->special_environment_vars['INSTALL_FOOTNOTE']))117 {118 $install_footnote = pts_file_io::file_get_contents($test_install_request->special_environment_vars['INSTALL_FOOTNOTE']);119 }120 pts_tests::update_test_install_xml($test_install_request->test_profile, $test_install_request->install_time_duration, true, $compiler_data, $install_footnote);121 $test_profiles[] = $test_install_request->test_profile;122 }123 else124 {125 $failed_installs[] = $test_install_request;126 }127 pts_file_io::unlink($test_install_request->special_environment_vars['INSTALL_FOOTNOTE']);128 }129 pts_module_manager::module_process('__post_install_process', $test_install_manager);130 pts_download_speed_manager::save_data();131 if(count($failed_installs) > 1)132 {133 echo PHP_EOL . 'The following tests failed to install:' . PHP_EOL . PHP_EOL;134 foreach($failed_installs as &$install_request)135 {136 echo ' - ' . $install_request->test_profile . PHP_EOL;137 // If many tests are being installed, show the error messages reported in order to reduce scrolling...138 if($install_request->install_error && isset($failed_installs[5]))139 {140 echo ' [' . $install_request->install_error . ']' . PHP_EOL;141 }142 }143 }144 }145 public static function only_download_test_files(&$test_profiles, $to_dir = null)146 {147 // Setup the install manager and add the tests148 $test_install_manager = new pts_test_install_manager();149 foreach($test_profiles as &$test_profile)150 {151 if($test_install_manager->add_test_profile($test_profile) != false)152 {153 pts_client::$display->generic_sub_heading('To Download Files: ' . $test_profile->get_identifier());154 }155 }156 if($test_install_manager->tests_to_install_count() == 0)157 {158 return true;159 }160 // Let the pts_test_install_manager make some estimations, etc...161 $test_install_manager->generate_download_file_lists();162 $test_install_manager->check_download_caches_for_files();163 // Begin the download process164 while(($test_install_request = $test_install_manager->next_in_install_queue()) != false)165 {166 //pts_client::$display->test_install_start($test_install_request->test_profile->get_identifier());167 pts_test_installer::download_test_files($test_install_request, $to_dir);168 }169 }170 protected static function download_test_files(&$test_install_request, $download_location = false, $no_prompts = false)171 {172 // Download needed files for a test173 if($test_install_request->get_download_object_count() == 0)174 {175 return true;176 }177 $identifier = $test_install_request->test_profile->get_identifier();178 pts_client::$display->test_install_downloads($test_install_request);179 if($download_location == false)180 {181 $download_location = $test_install_request->test_profile->get_install_dir();182 }183 pts_file_io::mkdir($download_location);184 $module_pass = array($identifier, $test_install_request->get_download_objects());185 pts_module_manager::module_process('__pre_test_download', $module_pass);186 foreach($test_install_request->get_download_objects() as $download_package)187 {188 $package_filename = $download_package->get_filename();189 $download_destination = $download_location . $package_filename;190 $download_destination_temp = $download_destination . '.pts';191 if($download_package->get_download_location_type() == null)192 {193 // Attempt a possible last-minute look-aside copy cache in case a previous test in the install queue downloaded this file already194 $lookaside_copy = pts_test_install_manager::file_lookaside_test_installations($download_package);195 if($lookaside_copy)196 {197 if($download_package->get_filesize() == 0)198 {199 $download_package->set_filesize(filesize($lookaside_copy));200 }201 $download_package->set_download_location('LOOKASIDE_DOWNLOAD_CACHE', array($lookaside_copy));202 }203 }204 switch($download_package->get_download_location_type())205 {206 case 'IN_DESTINATION_DIR':207 pts_client::$display->test_install_download_file('FILE_FOUND', $download_package);208 continue;209 case 'REMOTE_DOWNLOAD_CACHE':210 $download_tries = 0;211 do212 {213 foreach($download_package->get_download_location_path() as $remote_download_cache_file)214 {215 pts_client::$display->test_install_download_file('DOWNLOAD_FROM_CACHE', $download_package);216 pts_network::download_file($remote_download_cache_file, $download_destination_temp);217 if(!is_file($download_destination_temp) || filesize($download_destination_temp) == 0)218 {219 self::test_install_error(null, $test_install_request, 'The file failed to download from the cache.');220 pts_file_io::unlink($download_destination_temp);221 break;222 }223 else if($download_package->check_file_hash($download_destination_temp))224 {225 rename($download_destination_temp, $download_destination);226 break;227 }228 else229 {230 self::test_install_error(null, $test_install_request, 'The check-sum of the downloaded file failed.');231 pts_file_io::unlink($download_destination_temp);232 }233 }234 $download_tries++;235 }236 while(!is_file($download_destination) && $download_tries < 2);237 if(is_file($download_destination))238 {239 continue;240 }241 case 'MAIN_DOWNLOAD_CACHE':242 case 'LOCAL_DOWNLOAD_CACHE':243 case 'LOOKASIDE_DOWNLOAD_CACHE':244 $download_cache_file = pts_arrays::last_element($download_package->get_download_location_path());245 if(is_file($download_cache_file))246 {247 if((pts_config::read_bool_config('PhoronixTestSuite/Options/Installation/SymLinkFilesFromCache', 'FALSE') && $download_package->get_download_location_type() != 'LOOKASIDE_DOWNLOAD_CACHE'))248 {249 // For look-aside copies never symlink (unless a pre-packaged LiveCD) in case the other test ends up being un-installed250 // SymLinkFilesFromCache is disabled by default251 pts_client::$display->test_install_download_file('LINK_FROM_CACHE', $download_package);252 symlink($download_cache_file, $download_destination);253 }254 else255 {256 // File is to be copied257 // Try up to two times to copy a file258 $attempted_copies = 0;259 do260 {261 pts_client::$display->test_install_download_file('COPY_FROM_CACHE', $download_package);262 // $context = stream_context_create();263 // stream_context_set_params($context, array('notification' => array('pts_network', 'stream_status_callback')));264 // TODO: get the context working correctly for this copy()265 copy($download_cache_file, $download_destination_temp);266 pts_client::$display->test_install_progress_completed();267 // Verify that the file was copied fine268 if($download_package->check_file_hash($download_destination_temp))269 {270 rename($download_destination_temp, $download_destination);271 break;272 }273 else274 {275 self::test_install_error(null, $test_install_request, 'The check-sum of the copied file failed.');276 pts_file_io::unlink($download_destination_temp);277 }278 $attempted_copies++;279 }280 while($attempted_copies < 2);281 }282 if(is_file($download_destination))283 {284 continue;285 }286 }287 default:288 $package_urls = $download_package->get_download_url_array();289 // Download the file290 if(!is_file($download_destination) && count($package_urls) > 0 && $package_urls[0] != null)291 {292 $fail_count = 0;293 do294 {295 if(pts_network::internet_support_available())296 {297 if(!$no_prompts && pts_config::read_bool_config('PhoronixTestSuite/Options/Installation/PromptForDownloadMirror', 'FALSE') && count($package_urls) > 1)298 {299 // Prompt user to select mirror300 do301 {302 echo PHP_EOL . 'Available Download Mirrors:' . PHP_EOL . PHP_EOL;303 $url = pts_user_io::prompt_text_menu('Select Preferred Mirror', $package_urls, false);304 }305 while(pts_strings::is_url($url) == false);306 }307 else308 {309 // Auto-select mirror310 shuffle($package_urls);311 do312 {313 $url = array_pop($package_urls);314 }315 while(pts_strings::is_url($url) == false && !empty($package_urls));316 }317 pts_client::$display->test_install_download_file('DOWNLOAD', $download_package);318 $download_start = time();319 pts_network::download_file($url, $download_destination_temp);320 $download_end = time();321 }322 else323 {324 self::test_install_error(null, $test_install_request, 'Internet support is needed and it\'s disabled or not available.');325 return false;326 }327 if($download_package->check_file_hash($download_destination_temp))328 {329 // Download worked330 if(is_file($download_destination_temp))331 {332 rename($download_destination_temp, $download_destination);333 }334 if($download_package->get_filesize() > 0 && $download_end != $download_start)335 {336 pts_download_speed_manager::update_download_speed_average($download_package->get_filesize(), ($download_end - $download_start));337 }338 }339 else340 {341 // Download failed342 if(is_file($download_destination_temp) && filesize($download_destination_temp) < 500 && (stripos(file_get_contents($download_destination_temp), 'not found') !== false || strpos(file_get_contents($download_destination_temp), 404) !== false))343 {344 self::test_install_error(null, $test_install_request, 'File Not Found: ' . $url);345 $md5_failed = false;346 }347 else if(is_file($download_destination_temp) && filesize($download_destination_temp) > 0)348 {349 self::test_install_error(null, $test_install_request, 'Checksum Failed: ' . $url);350 $md5_failed = true;351 }352 else353 {354 self::test_install_error(null, $test_install_request, 'Download Failed: ' . $url);355 $md5_failed = false;356 }357 pts_file_io::unlink($download_destination_temp);358 $fail_count++;359 if($fail_count > 3)360 {361 $try_again = false;362 }363 else364 {365 if(count($package_urls) > 0 && $package_urls[0] != null)366 {367 self::test_install_error(null, $test_install_request, 'Attempting to download from alternate mirror.');368 $try_again = true;369 }370 else371 {372 if($no_prompts)373 {374 $try_again = false;375 }376 else if($md5_failed)377 {378 $try_again = pts_user_io::prompt_bool_input('Try downloading the file again', true, 'TRY_DOWNLOAD_AGAIN');379 }380 else381 {382 $try_again = false;383 }384 if($try_again)385 {386 $package_urls[] = $url;387 }388 }389 }390 if(!$try_again)391 {392 //self::test_install_error(null, $test_install_request, 'Download of Needed Test Dependencies Failed!');393 return false;394 }395 }396 }397 while(!is_file($download_destination));398 }399 pts_module_manager::module_process('__interim_test_download', $module_pass);400 }401 }402 pts_module_manager::module_process('__post_test_download', $identifier);403 return true;404 }405 public static function create_compiler_mask(&$test_install_request)406 {407 if(phodevi::is_bsd() || getenv('PTS_NO_COMPILER_MASK'))408 {409 // XXX: Using the compiler-mask causes a number of tests to fail to properly install due to compiler issues with at least PC-BSD 10.0410 return false;411 }412 // or pass false to $test_install_request to bypass the test checks413 $compilers = array();414 $external_dependencies = $test_install_request != false ? $test_install_request->test_profile->get_external_dependencies() : false;415 if($test_install_request === false || in_array('build-utilities', $external_dependencies))416 {417 // Handle C/C++ compilers for this external dependency418 $compilers['CC'] = array(pts_strings::first_in_string(pts_client::read_env('CC'), ' '), 'gcc', 'clang', 'icc', 'pcc');419 $compilers['CXX'] = array(pts_strings::first_in_string(pts_client::read_env('CXX'), ' '), 'g++', 'clang++', 'cpp');420 }421 if($test_install_request === false || in_array('fortran-compiler', $external_dependencies))422 {423 // Handle Fortran for this external dependency424 $compilers['F9X'] = array(pts_strings::first_in_string(pts_client::read_env('F9X'), ' '), pts_strings::first_in_string(pts_client::read_env('F95'), ' '), 'gfortran', 'f90', 'f95', 'fortran');425 }426 if(empty($compilers))427 {428 // If the test profile doesn't request a compiler external dependency, probably not compiling anything429 return false;430 }431 foreach($compilers as $compiler_type => $possible_compilers)432 {433 // Compilers to check for, listed in order of priority434 $compiler_found = false;435 foreach($possible_compilers as $i => $possible_compiler)436 {437 // first check to ensure not null sent to executable_in_path from env variable438 if($possible_compiler && (($compiler_path = is_executable($possible_compiler)) || ($compiler_path = pts_client::executable_in_path($possible_compiler, 'ccache'))))439 {440 // Replace the array of possible compilers with a string to the detected compiler executable441 $compilers[$compiler_type] = $compiler_path;442 $compiler_found = true;443 break;444 }445 }446 if($compiler_found == false)447 {448 unset($compilers[$compiler_type]);449 }450 }451 if(!empty($compilers))452 {453 // Create a temporary directory that will be at front of PATH and serve for masking the actual compiler454 if($test_install_request instanceof pts_test_install_request)455 {456 $mask_dir = pts_client::temporary_directory() . '/pts-compiler-mask-' . $test_install_request->test_profile->get_identifier_base_name() . $test_install_request->test_profile->get_test_profile_version() . '/';457 }458 else459 {460 $mask_dir = pts_client::temporary_directory() . '/pts-compiler-mask-' . rand(100, 999) . '/';461 }462 pts_file_io::mkdir($mask_dir);463 $compiler_extras = array(464 'CC' => array('safeguard-names' => array('gcc', 'cc'), 'environment-variables' => 'CFLAGS'),465 'CXX' => array('safeguard-names' => array('g++', 'c++'), 'environment-variables' => 'CXXFLAGS'),466 'F9X' => array('safeguard-names' => array('gfortran', 'f95'), 'environment-variables' => 'F9XFLAGS')467 );468 foreach($compilers as $compiler_type => $compiler_path)469 {470 $compiler_name = basename($compiler_path);471 $main_compiler = $mask_dir . $compiler_name;472 // take advantage of environment-variables to be sure they're found in the string473 $env_var_check = PHP_EOL;474 /*475 foreach(pts_arrays::to_array($compiler_extras[$compiler_type]['environment-variables']) as $env_var)476 {477 // since it's a dynamic check in script could probably get rid of this check...478 if(true || getenv($env_var))479 {480 $env_var_check .= 'if [[ $COMPILER_OPTIONS != "*$' . $env_var . '*" ]]' . PHP_EOL . 'then ' . PHP_EOL . 'COMPILER_OPTIONS="$COMPILER_OPTIONS $' . $env_var . '"' . PHP_EOL . 'fi' . PHP_EOL;481 }482 }483 */484 // Write the main mask for the compiler485 file_put_contents($main_compiler,486 '#!/bin/bash' . PHP_EOL . 'COMPILER_OPTIONS="$@"' . PHP_EOL . $env_var_check . PHP_EOL . 'echo $COMPILER_OPTIONS >> ' . $mask_dir . $compiler_type . '-options-' . $compiler_name . PHP_EOL . $compiler_path . ' "$@"' . PHP_EOL);487 // Make executable488 chmod($main_compiler, 0755);489 // The two below code chunks ensure the proper compiler is always hit490 if($test_install_request instanceof pts_test_install_request && !in_array($compiler_name, pts_arrays::to_array($compiler_extras[$compiler_type]['safeguard-names'])) && getenv($compiler_type) == false)491 {492 // So if e.g. clang becomes the default compiler, since it's not GCC, it will ensure CC is also set to clang beyond the masking below493 $test_install_request->special_environment_vars[$compiler_type] = $compiler_name;494 }495 // Just in case any test profile script is statically always calling 'gcc' or anything not CC, try to make sure it hits one of the safeguard-names so it redirects to the intended compiler under test496 foreach(pts_arrays::to_array($compiler_extras[$compiler_type]['safeguard-names']) as $safe_name)497 {498 if(!is_file($mask_dir . $safe_name))499 {500 symlink($main_compiler, $mask_dir . $safe_name);501 }502 }503 }504 if($test_install_request instanceof pts_test_install_request)505 {506 $test_install_request->compiler_mask_dir = $mask_dir;507 // Appending the rest of the path will be done automatically within call_test_script508 $test_install_request->special_environment_vars['PATH'] = $mask_dir;509 }510 return $mask_dir;511 }512 return false;513 }514 public static function end_compiler_mask(&$test_install_request)515 {516 if($test_install_request->compiler_mask_dir == false && !is_dir($test_install_request->compiler_mask_dir))517 {518 return false;519 }520 $compiler = false;521 foreach(pts_file_io::glob($test_install_request->compiler_mask_dir . '*-options-*') as $compiler_output)522 {523 $output_name = basename($compiler_output);524 $compiler_type = substr($output_name, 0, strpos($output_name, '-'));525 $compiler_choice = substr($output_name, (strrpos($output_name, 'options-') + 8));526 $compiler_lines = explode(PHP_EOL, pts_file_io::file_get_contents($compiler_output));527 // Clean-up / reduce the compiler options that are important528 $compiler_options = null;529 $compiler_backup_line = null;530 foreach($compiler_lines as $l => $compiler_line)531 {532 $compiler_line .= ' '; // allows for easier/simplified detection in a few checks below533 $o = strpos($compiler_line, '-o ');534 if($o === false)535 {536 unset($compiler_lines[$l]);537 continue;538 }539 $o = substr($compiler_line, ($o + 3), (strpos($compiler_line, ' ', ($o + 3)) - $o - 3));540 $o_l = strlen($o);541 // $o now has whatever is set for the -o output542 if(($o_l > 2 && substr(basename($o), 0, 3) == 'lib') || ($o_l > 3 && substr($o, -4) == 'test'))543 {544 // If it's a lib, probably not what is the actual target545 unset($compiler_lines[$l]);546 continue;547 }548 else if(($o_l > 2 && substr($o, -2) == '.o'))549 {550 // If it's outputting to a .o should not be the proper compile command we want551 // but back it up in case... keep overwriting temp variable to get the last one552 $compiler_backup_line = $compiler_line;553 unset($compiler_lines[$l]);554 continue;555 }556 }557 if(!empty($compiler_lines))558 {559 $compiler_line = array_pop($compiler_lines);560 if(strpos($compiler_line, '-O') === false && strpos($compiler_line, '-f') === false && (strpos($compiler_backup_line, '-f') !== false || strpos($compiler_backup_line, '-O')))561 {562 $compiler_line .= ' ' . $compiler_backup_line;563 }564 $compiler_options = explode(' ', $compiler_line);565 foreach($compiler_options as $i => $option)566 {567 // Decide what to include and what not... D?568 if(!isset($option[2]) || $option[0] != '-' || $option[1] == 'L' || $option[1] == 'D' || $option[1] == 'I' || $option[1] == 'W' || isset($option[20]))569 {570 unset($compiler_options[$i]);571 }572 if(isset($option[1]) && $option[1] == 'l')573 {574 // If you're linking a library it's also useful for other purposes575 $library = substr($option, 1);576 // TODO XXX: scan the external dependencies to make sure $library is covered if not alert test profile maintainer...577 //unset($compiler_options[$i]);578 }579 }580 $compiler_options = implode(' ', array_unique($compiler_options));581 //sort($compiler_options);582 // TODO: right now just keep overwriting $compiler to take the last compiler.. so TODO add support for multiple compiler reporting or decide what todo583 $compiler = array('compiler-type' => $compiler_type, 'compiler' => $compiler_choice, 'compiler-options' => $compiler_options);584 //echo PHP_EOL . 'DEBUG: ' . $compiler_type . ' ' . $compiler_choice . ' :: ' . $compiler_options . PHP_EOL;585 }586 }587 pts_file_io::delete($test_install_request->compiler_mask_dir, null, true);588 return $compiler;589 }590 protected static function install_test_process(&$test_install_request, $no_prompts)591 {592 // Install a test593 $identifier = $test_install_request->test_profile->get_identifier();594 $test_install_directory = $test_install_request->test_profile->get_install_dir();595 pts_file_io::mkdir(dirname($test_install_directory));596 pts_file_io::mkdir($test_install_directory);597 $installed = false;598 if(ceil(disk_free_space($test_install_directory) / 1048576) < ($test_install_request->test_profile->get_download_size() + 128))599 {600 self::test_install_error(null, $test_install_request, 'There is not enough space at ' . $test_install_directory . ' for the test files.');601 }602 else if(ceil(disk_free_space($test_install_directory) / 1048576) < ($test_install_request->test_profile->get_environment_size(false) + 128))603 {604 self::test_install_error(null, $test_install_request, 'There is not enough space at ' . $test_install_directory . ' for this test.');605 }606 else607 {608 pts_test_installer::setup_test_install_directory($test_install_request, true);609 // Download test files610 $download_test_files = pts_test_installer::download_test_files($test_install_request, false, $no_prompts);611 if($download_test_files == false)612 {613 self::test_install_error(null, $test_install_request, 'Downloading of needed test files failed.');614 return false;615 }616 if($test_install_request->test_profile->get_file_installer() != false)617 {618 self::create_compiler_mask($test_install_request);619 pts_module_manager::module_process('__pre_test_install', $identifier);620 pts_client::$display->test_install_begin($test_install_request);621 $pre_install_message = $test_install_request->test_profile->get_pre_install_message();622 $post_install_message = $test_install_request->test_profile->get_post_install_message();623 $install_agreement = $test_install_request->test_profile->get_installation_agreement_message();624 if(!empty($install_agreement))625 {626 if(pts_strings::is_url($install_agreement))627 {628 $install_agreement = pts_network::http_get_contents($install_agreement);629 if(empty($install_agreement))630 {631 self::test_install_error(null, $test_install_request, 'The user agreement could not be found. Test installation aborted.');632 return false;633 }634 }635 echo $install_agreement . PHP_EOL;636 if(!$no_prompts)637 {638 $user_agrees = pts_user_io::prompt_bool_input('Do you agree to these terms', false, 'INSTALL_AGREEMENT');639 if(!$user_agrees)640 {641 self::test_install_error(null, $test_install_request, 'User agreement failed; this test will not be installed.');642 return false;643 }644 }645 }646 pts_client::$display->display_interrupt_message($pre_install_message);647 $install_time_length_start = microtime(true);648 $install_log = pts_tests::call_test_script($test_install_request->test_profile, 'install', null, $test_install_directory, $test_install_request->special_environment_vars, false);649 $test_install_request->install_time_duration = ceil(microtime(true) - $install_time_length_start);650 pts_client::$display->display_interrupt_message($post_install_message);651 if(!empty($install_log))652 {653 file_put_contents($test_install_directory . 'install.log', $install_log);654 pts_file_io::unlink($test_install_directory . 'install-failed.log');655 pts_client::$display->test_install_output($install_log);656 }657 if(is_file($test_install_directory . 'install-exit-status'))658 {659 // If the installer writes its exit status to ~/install-exit-status, if it's non-zero the install failed660 $install_exit_status = pts_file_io::file_get_contents($test_install_directory . 'install-exit-status');661 unlink($test_install_directory . 'install-exit-status');662 if($install_exit_status != 0 && phodevi::is_windows() == false)663 {664 $install_error = null;665 // TODO: perhaps better way to handle this than to remove pts-install.xml666 pts_file_io::unlink($test_install_directory . 'pts-install.xml');667 if(is_file($test_install_directory . 'install.log'))668 {669 $install_log = pts_file_io::file_get_contents($test_install_directory . 'install.log');670 $install_error = pts_tests::scan_for_error($install_log, $test_install_directory);671 copy($test_install_directory . 'install.log', $test_install_directory . 'install-failed.log');672 }673 //pts_test_installer::setup_test_install_directory($test_install_request, true); // Remove installed files from the bunked installation674 self::test_install_error(null, $test_install_request, 'The installer exited with a non-zero exit status.');675 if($install_error != null)676 {677 $test_install_request->install_error = pts_tests::pretty_error_string($install_error);678 if($test_install_request->install_error != null)679 {680 self::test_install_error(null, $test_install_request, 'ERROR: ' . $test_install_request->install_error);681 }682 }683 pts_client::$display->test_install_error('LOG: ' . str_replace(pts_core::user_home_directory(), '~/', $test_install_directory) . 'install-failed.log' . PHP_EOL);684 if(pts_client::do_anonymous_usage_reporting())685 {686 // If anonymous usage reporting enabled, report test install failure to OpenBenchmarking.org687 pts_openbenchmarking_client::upload_usage_data('test_install_failure', array($test_install_request, $install_error));688 }689 return false;690 }691 }692 pts_module_manager::module_process('__post_test_install', $identifier);693 $installed = true;694 if(pts_config::read_bool_config('PhoronixTestSuite/Options/Installation/RemoveDownloadFiles', 'FALSE'))695 {696 // Remove original downloaded files697 foreach($test_install_request->get_download_objects() as $download_object)698 {699 pts_file_io::unlink($test_install_directory . $download_object->get_filename());700 }701 }702 }703 else704 {705 pts_client::$display->test_install_error('No installation script found.');706 $installed = true;707 }708 // Additional validation checks?709 $custom_validated_output = pts_tests::call_test_script($test_install_request->test_profile, 'validate-install', PHP_EOL . 'Validating Installation...' . PHP_EOL, $test_install_directory, null, false);710 if(!empty($custom_validated_output) && !pts_strings::string_bool($custom_validated_output))711 {712 $installed = false;713 }714 }715 echo PHP_EOL;716 return $installed;717 }718 protected static function setup_test_install_directory(&$test_install_request, $remove_old_files = false)719 {...

Full Screen

Full Screen

test_install_error

Using AI Code Generation

copy

Full Screen

1$test_installer = new pts_test_installer();2$test_installer->test_install_error('test_name', 'test_version', 'test_profile', 'test_error_message');3$test_installer = new pts_test_installer();4$test_installer->test_install_error('test_name', 'test_version', 'test_profile', 'test_error_message', 'test_error_code');5$test_installer = new pts_test_installer();6$test_installer->test_install_error('test_name', 'test_version', 'test_profile', 'test_error_message', 'test_error_code', 'test_error_type');7$test_installer = new pts_test_installer();8$test_installer->test_install_error('test_name', 'test_version', 'test_profile', 'test_error_message', 'test_error_code', 'test_error_type', 'test_error_file');9$test_installer = new pts_test_installer();10$test_installer->test_install_error('test_name', 'test_version', 'test_profile', 'test_error_message', 'test_error_code', 'test_error_type', 'test_error_file', 'test_error_line');11$test_installer = new pts_test_installer();12$test_installer->test_install_error('test_name', 'test_version', 'test_profile', 'test_error_message', 'test_error_code', 'test_error_type', 'test_error_file', 'test_error_line', 'test_error_trace');13$test_installer = new pts_test_installer();14$test_installer->test_install_error('test_name', 'test_version', 'test_profile', 'test_error_message', 'test_error_code', 'test_error_type', 'test_error_file', 'test_error_line', 'test_error_trace', 'test_error_trace_string');

Full Screen

Full Screen

test_install_error

Using AI Code Generation

copy

Full Screen

1require_once('pts-test-installer.php');2$test_installer = new pts_test_installer();3$test_installer->test_install_error('test_install_error', 'test_install_error');4require_once('pts-test-installer.php');5$test_installer = new pts_test_installer();6$test_installer->test_install_error('test_install_error', 'test_install_error');7require_once('pts-test-installer.php');8$test_installer = new pts_test_installer();9$test_installer->test_install_success('test_install_success', 'test_install_success');10require_once('pts-test-installer.php');11$test_installer = new pts_test_installer();12$test_installer->test_install_warning('test

Full Screen

Full Screen

test_install_error

Using AI Code Generation

copy

Full Screen

1include_once("pts_test_installer.php");2$test_installer = new pts_test_installer();3$test_installer->test_install_error("package_name");4$test_installer->test_install_error("package_name");5$test_installer->test_install_error("package_name");6$test_installer->test_install_error("package_name");7$test_installer->test_install_error("package_name");8$test_installer->test_install_error("package_name");9$test_installer->test_install_error("package

Full Screen

Full Screen

test_install_error

Using AI Code Generation

copy

Full Screen

1require_once('pts-core/pts-core.php');2$test = new pts_test_profile('test');3$test_installer = new pts_test_installer($test);4$test_installer->test_install_error();5require_once('pts-core/pts-core.php');6$test = new pts_test_profile('test');7$test_installer = new pts_test_installer($test);8$test_installer->test_install();9require_once('pts-core/pts-core.php');10$test = new pts_test_profile('test');11$test_installer = new pts_test_installer($test);12$test_installer->test_uninstall();13require_once('pts-core/pts-core.php');14$test = new pts_test_profile('test');15$test_installer = new pts_test_installer($test);16$test_installer->test_install();17require_once('pts-core/pts-core.php');18$test = new pts_test_profile('test');19$test_installer = new pts_test_installer($test);20$test_installer->test_uninstall();21require_once('pts-core/pts-core.php');22$test = new pts_test_profile('test');23$test_installer = new pts_test_installer($test);24$test_installer->test_install();25require_once('pts-core/pts-core.php');26$test = new pts_test_profile('test');27$test_installer = new pts_test_installer($test);28$test_installer->test_uninstall();

Full Screen

Full Screen

test_install_error

Using AI Code Generation

copy

Full Screen

1require_once('pts_test_installer.php');2$test_installer = new pts_test_installer();3$test_installer->test_install_error('php', 1);4require_once('pts_test_installer.php');5$test_installer = new pts_test_installer();6$test_installer->test_install_error('php', 2);7require_once('pts_test_installer.php');8$test_installer = new pts_test_installer();9$test_installer->test_install_error('php', 3);10require_once('pts_test_installer.php');11$test_installer = new pts_test_installer();12$test_installer->test_install_error('php', 4);13require_once('pts_test_installer.php');14$test_installer = new pts_test_installer();15$test_installer->test_install_error('php', 5);16require_once('pts_test_installer.php');17$test_installer = new pts_test_installer();

Full Screen

Full Screen

test_install_error

Using AI Code Generation

copy

Full Screen

1require_once('pts_test_installer.php');2$test_installer = new pts_test_installer();3echo $test_installer->test_install_error('test_name', 'test_version');4require_once('pts_test_installer.php');5$test_installer = new pts_test_installer();6echo $test_installer->test_install('test_name', 'test_version');7require_once('pts_test_installer.php');8$test_installer = new pts_test_installer();9echo $test_installer->test_uninstall('test_name', 'test_version');10require_once('pts_test_installer.php');

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger test_install_error code on LambdaTest Cloud Grid

Execute automation tests with test_install_error on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful