How to use read_bool_config method of pts_config class

Best Phoronix-test-suite code snippet using pts_config.read_bool_config

pts_test_run_manager.php

Source:pts_test_run_manager.php Github

copy

Full Screen

...48 protected $auto_mode = false;49 public $DEBUG_no_test_execution_just_result_parse = false;50 public function __construct($batch_mode = false, $auto_mode = false)51 {52 $this->do_dynamic_run_count = pts_config::read_bool_config('PhoronixTestSuite/Options/TestResultValidation/DynamicRunCount', 'TRUE');53 $this->dynamic_run_count_on_length_or_less = 60; //pts_config::read_user_config('PhoronixTestSuite/Options/TestResultValidation/LimitIncreasingRunCountForTestsOverLength', 60);54 $this->dynamic_run_count_std_deviation_threshold = pts_config::read_user_config('PhoronixTestSuite/Options/TestResultValidation/StandardDeviationThreshold', 3.50);55 $this->dynamic_run_count_export_script = pts_config::read_user_config('PhoronixTestSuite/Options/TestResultValidation/ExportResultsTo', null);56 if($batch_mode)57 {58 $this->set_batch_mode($batch_mode);59 }60 // 1/true is normal auto mode, 2 = auto + default benchmark mode61 $this->auto_mode = $auto_mode;62 pts_module_manager::module_process('__run_manager_setup', $this);63 }64 public function is_pcqs()65 {66 return $this->is_pcqs;67 }68 public function do_dynamic_run_count()69 {70 return $this->do_dynamic_run_count;71 }72 public function allow_test_cache_share()73 {74 return $this->allow_test_cache_share;75 }76 public function disable_dynamic_run_count()77 {78 $this->do_dynamic_run_count = false;79 }80 public function auto_upload_to_openbenchmarking($do = true)81 {82 $this->auto_upload_to_openbenchmarking = ($do == true);83 }84 public function increase_run_count_check(&$active_result_buffer, $scheduled_times_to_run, $latest_test_run_time)85 {86 // First make sure this test doesn't take too long to run where we don't want dynamic handling87 if(floor($latest_test_run_time / 60) > $this->dynamic_run_count_on_length_or_less)88 {89 return false;90 }91 // Determine if results are statistically significant, otherwise up the run count92 $std_dev = pts_math::percent_standard_deviation($active_result_buffer->results);93 if($std_dev >= $this->dynamic_run_count_std_deviation_threshold)94 {95 static $last_run_count = 128; // just a number that should always cause the first check below to be true96 static $run_std_devs;97 $times_already_ran = count($active_result_buffer->results);98 if($times_already_ran <= $last_run_count)99 {100 // We're now onto a new test so clear out the array101 $run_std_devs = array();102 }103 $last_run_count = $times_already_ran;104 $run_std_devs[$last_run_count] = $std_dev;105 // If we haven't reached scheduled times to run x 2, increase count straight away106 if($times_already_ran < ($scheduled_times_to_run * 2))107 {108 return true;109 }110 else if($times_already_ran < ($scheduled_times_to_run * 3))111 {112 // More aggressive determination whether to still keep increasing the run count113 $first_and_now_diff = pts_arrays::first_element($run_std_devs) - pts_arrays::last_element($run_std_devs);114 // Increasing the run count at least looks to be helping...115 if($first_and_now_diff > (pts_arrays::first_element($run_std_devs) / 2))116 {117 // If we are at least making progress in the right direction, increase the run count some more118 return true;119 }120 // TODO: could add more checks and take better advantage of the array of data to better determine if it's still worth increasing121 }122 }123 // Check to see if there is an external/custom script to export the results to in determining whether results are valid124 if(($ex_file = $this->dynamic_run_count_export_script) != null && is_executable($ex_file) || is_executable(($ex_file = PTS_USER_PATH . $this->dynamic_run_count_export_script)))125 {126 $exit_status = trim(shell_exec($ex_file . ' ' . $active_result_buffer->get_values_as_string() . ' > /dev/null 2>&1; echo $?'));127 switch($exit_status)128 {129 case 1:130 // Run the test again131 return true;132 case 2:133 // Results are bad, abandon testing and do not record results134 return -1;135 case 0:136 default:137 // Return was 0 or something else, results are valid, or was some other exit status138 break;139 }140 }141 // No reason to increase the run count with none of the previous checks requesting otherwise142 return false;143 }144 protected function add_test_result_object(&$test_result)145 {146 $hash = $test_result->get_comparison_hash(true, false);147 if($this->validate_test_to_run($test_result->test_profile) && !isset($this->hashes_of_tests_to_run[$hash]))148 {149 $this->hashes_of_tests_to_run[$hash] = $hash;150 $this->tests_to_run[] = $test_result;151 }152 }153 public function get_tests_to_run()154 {155 return $this->tests_to_run;156 }157 public function get_tests_to_run_identifiers()158 {159 $identifiers = array();160 foreach($this->tests_to_run as &$test_run_request)161 {162 $identifiers[] = $test_run_request->test_profile->get_identifier();163 }164 array_unique($identifiers);165 return $identifiers;166 }167 public function get_estimated_run_time($index = -1)168 {169 if($index == -1)170 {171 $index = $this->last_test_run_index;172 }173 $estimated_time = 0;174 foreach(array_slice($this->tests_to_run, $index) as $test_run_request)175 {176 $estimated_time += $test_run_request->test_profile->get_estimated_run_time();177 }178 return $estimated_time;179 }180 public function get_percent_complete()181 {182 return round($this->last_test_run_index / count($this->tests_to_run) * 100);183 }184 public function get_test_to_run($index)185 {186 $this->last_test_run_index = $index;187 return is_numeric($index) && isset($this->tests_to_run[$index]) ? $this->tests_to_run[$index] : false;188 }189 public function get_test_count()190 {191 return count($this->tests_to_run);192 }193 public function force_results_save()194 {195 $this->force_save_results = true;196 }197 public function do_save_results()198 {199 return $this->file_name != null;200 }201 public function get_file_name()202 {203 return $this->file_name;204 }205 public function get_title()206 {207 return $this->file_name_title;208 }209 public function get_results_identifier()210 {211 return $this->results_identifier;212 }213 public function get_description()214 {215 return $this->run_description;216 }217 public function get_notes()218 {219 return null; // TODO: Not Yet Implemented220 }221 public function get_internal_tags()222 {223 return null;224 }225 public function get_reference_id()226 {227 return null;228 }229 public function get_preset_environment_variables()230 {231 return pts_module_manager::var_store_string();232 }233 public function result_already_contains_identifier()234 {235 if($this->result_file)236 {237 foreach($this->result_file->get_systems() as $s)238 {239 if($s->get_identifier() == $this->results_identifier)240 {241 return true;242 }243 }244 }245 return false;246 }247 public function set_save_name($save_name, $is_new_save = true)248 {249 if(empty($save_name))250 {251 $save_name = date('Y-m-d-Hi');252 }253 $this->file_name = self::clean_save_name($save_name, $is_new_save);254 $this->file_name_title = $save_name;255 $this->force_save_results = true;256 $this->result_file = new pts_result_file($this->file_name);257 $this->is_new_result_file = $this->result_file->get_system_count() == 0;258 }259 public function set_results_identifier($identifier)260 {261 $this->results_identifier = self::clean_results_identifier($identifier);262 }263 public function prompt_save_name()264 {265 if($this->file_name != null)266 {267 return;268 }269 // Prompt to save a file when running a test270 $save_name = null;271 if(($env = pts_client::read_env('TEST_RESULTS_NAME')))272 {273 $save_name = $env;274 //echo 'Saving Results To: ' . $proposed_name . PHP_EOL;275 }276 if(!$this->batch_mode || $this->batch_mode['PromptSaveName'])277 {278 $is_reserved_word = false;279 // Be of help to the user by showing recently saved test results280 if($save_name == null)281 {282 pts_tests::recently_saved_results();283 }284 $save_name_length = strlen($save_name);285 while(empty($save_name) || ($is_reserved_word = pts_types::is_test_or_suite($save_name)) || $save_name_length > 126)286 {287 if($is_reserved_word)288 {289 echo PHP_EOL . 'The name of the saved file cannot be the same as a test/suite: ' . $save_name . PHP_EOL;290 $is_reserved_word = false;291 }292 if($save_name_length > 126)293 {294 echo PHP_EOL . 'The name of the saved file must have between 2 and 126 characters in length.' . PHP_EOL;295 }296 pts_client::$display->generic_prompt('Enter a name to save these results under: ');297 $save_name = pts_user_io::read_user_input();298 }299 }300 $this->set_save_name($save_name);301 }302 public function prompt_results_identifier()303 {304 // Prompt for a results identifier305 $results_identifier = null;306 $show_identifiers = array();307 $no_repeated_tests = true;308 if(!$this->is_new_result_file)309 {310 // Running on an already-saved result311 $current_identifiers = array();312 $current_hardware = array();313 $current_software = array();314 foreach($this->result_file->get_systems() as $s)315 {316 $current_hardware[] = $s->get_hardware();317 $current_software[] = $s->get_software();318 $current_identifiers[] = $s->get_identifier();319 }320 $hashes = array();321 foreach($this->result_file->get_result_objects() as $result)322 {323 $hashes[] = $result->get_comparison_hash(true, false);324 }325 foreach($this->tests_to_run as &$run_request)326 {327 if($run_request instanceof pts_test_result && in_array($run_request->get_comparison_hash(true, false), $hashes))328 {329 $no_repeated_tests = false;330 break;331 }332 }333 }334 else335 {336 // Fresh run337 $current_identifiers = array();338 $current_hardware = array();339 $current_software = array();340 }341 if((!$this->batch_mode || $this->batch_mode['PromptForTestIdentifier']) && !$this->auto_mode)342 {343 if(count($current_identifiers) > 0)344 {345 echo PHP_EOL . 'Current Test Identifiers:' . PHP_EOL;346 echo pts_user_io::display_text_list($current_identifiers);347 echo PHP_EOL;348 }349 $times_tried = 0;350 do351 {352 if($times_tried == 0 && ($env_identifier = pts_client::read_env('TEST_RESULTS_IDENTIFIER')))353 {354 $results_identifier = isset($env_identifier) ? self::clean_results_identifier($env_identifier) : null;355 echo 'Test Identifier: ' . $results_identifier . PHP_EOL;356 }357 else358 {359 pts_client::$display->generic_prompt('Enter a unique name to describe this test run / configuration: ');360 $results_identifier = self::clean_results_identifier(pts_user_io::read_user_input());361 }362 $times_tried++;363 $identifier_pos = (($p = array_search($results_identifier, $current_identifiers)) !== false ? $p : -1);364 }365 while((!$no_repeated_tests && $identifier_pos != -1) || (isset($current_hardware[$identifier_pos]) && $current_hardware[$identifier_pos] != phodevi::system_hardware(true)) || (isset($current_software[$identifier_pos]) && $current_software[$identifier_pos] != phodevi::system_software(true)));366 }367 else if(($env_identifier = pts_client::read_env('TEST_RESULTS_IDENTIFIER')))368 {369 $results_identifier = self::clean_results_identifier($env_identifier);370 }371 if(empty($results_identifier))372 {373 $results_identifier = $this->auto_generate_results_identifier();374 }375 $this->results_identifier = $results_identifier;376 }377 public function auto_generate_results_identifier()378 {379 // If the save result identifier is empty, try to come up with something based upon the tests being run.380 $results_identifier = null;381 $subsystem_r = array();382 $subsystems_to_test = $this->subsystems_under_test();383 if(!$this->is_new_result_file)384 {385 $result_file_intent = pts_result_file_analyzer::analyze_result_file_intent($this->result_file);386 if(is_array($result_file_intent) && $result_file_intent[0] != 'Unknown')387 {388 array_unshift($subsystems_to_test, $result_file_intent[0]);389 }390 }391 foreach($subsystems_to_test as $subsystem)392 {393 $components = pts_result_file_analyzer::system_component_string_to_array(phodevi::system_hardware(true) . ', ' . phodevi::system_software(true));394 if($subsystem != null && isset($components[$subsystem]))395 {396 $subsystem_name = pts_strings::trim_search_query($components[$subsystem]);397 if(phodevi::is_vendor_string($subsystem_name) && !in_array($subsystem_name, $subsystem_r))398 {399 $subsystem_r[] = $subsystem_name;400 }401 if(isset($subsystem_r[2]) || isset($subsystem_name[19]))402 {403 break;404 }405 }406 }407 if(isset($subsystem_r[0]))408 {409 $results_identifier = implode(' - ', $subsystem_r);410 }411 if(empty($results_identifier) && !$this->batch_mode)412 {413 $results_identifier = phodevi::read_property('cpu', 'model') . ' - ' . phodevi::read_property('gpu', 'model') . ' - ' . phodevi::read_property('motherboard', 'identifier');414 }415 if(strlen($results_identifier) > 55)416 {417 $results_identifier = substr($results_identifier, 0, 54);418 $results_identifier = substr($results_identifier, 0, strrpos($results_identifier, ' '));419 }420 if(empty($results_identifier))421 {422 $results_identifier = date('Y-m-d H:i');423 }424 $this->results_identifier = $results_identifier;425 return $results_identifier;426 }427 public static function clean_results_identifier($results_identifier)428 {429 $results_identifier = trim(pts_client::swap_variables($results_identifier, array('pts_client', 'user_run_save_variables')));430 $results_identifier = pts_strings::remove_redundant(pts_strings::keep_in_string($results_identifier, pts_strings::CHAR_LETTER | pts_strings::CHAR_NUMERIC | pts_strings::CHAR_DASH | pts_strings::CHAR_UNDERSCORE | pts_strings::CHAR_COLON | pts_strings::CHAR_COMMA | pts_strings::CHAR_SLASH | pts_strings::CHAR_SPACE | pts_strings::CHAR_DECIMAL | pts_strings::CHAR_AT | pts_strings::CHAR_PLUS | pts_strings::CHAR_SEMICOLON | pts_strings::CHAR_EQUAL), ' ');431 return $results_identifier;432 }433 public function get_test_run_position()434 {435 return $this->test_run_pos + 1;436 }437 public function get_test_run_count_reported()438 {439 return $this->test_run_count;440 }441 public function call_test_runs()442 {443 // Create a lock444 $lock_path = pts_client::temporary_directory() . '/phoronix-test-suite.active';445 pts_client::create_lock($lock_path);446 if($this->pre_run_message != null)447 {448 pts_client::$display->display_interrupt_message($this->pre_run_message);449 }450 // Hook into the module framework451 self::$test_run_process_active = true;452 pts_module_manager::module_process('__pre_run_process', $this);453 pts_file_io::unlink(PTS_USER_PATH . 'halt-testing');454 pts_file_io::unlink(PTS_USER_PATH . 'skip-test');455 $continue_test_flag = true;456 $tests_to_run_count = $this->get_test_count();457 pts_client::$display->test_run_process_start($this);458 $total_loop_count = (($t = pts_client::read_env('TOTAL_LOOP_COUNT')) && is_numeric($t) && $t > 0) ? $t : 1;459 $total_loop_time = (($t = pts_client::read_env('TOTAL_LOOP_TIME')) && is_numeric($t) && $t > 9) ? ($t * 60) : -1;460 $loop_end_time = $total_loop_time != -1 ? (time() + $total_loop_time) : false;461 $this->test_run_count = ($tests_to_run_count * $total_loop_count);462 for($loop = 1; $loop <= $total_loop_count && $continue_test_flag; $loop++)463 {464 for($i = 0; $i < $tests_to_run_count && $continue_test_flag; $i++)465 {466 $this->test_run_pos = $i;467 $continue_test_flag = $this->process_test_run_request($i);468 if(pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/RemoveTestInstallOnCompletion', 'FALSE'))469 {470 // Remove the installed test if it's no longer needed in this run queue471 $this_test_profile_identifier = $this->get_test_to_run($this->test_run_pos)->test_profile->get_identifier();472 $still_in_queue = false;473 for($j = ($this->test_run_pos + 1); $j < $tests_to_run_count && $still_in_queue == false; $j++)474 {475 if($this->get_test_to_run($j)->test_profile->get_identifier() == $this_test_profile_identifier)476 {477 $still_in_queue = true;478 }479 }480 if($still_in_queue == false)481 {482 pts_client::remove_installed_test($this->get_test_to_run($this->test_run_pos)->test_profile);483 }484 }485 if($loop_end_time)486 {487 if(time() > $loop_end_time)488 {489 $continue_test_flag = false;490 }491 else if($this->test_run_count == ($i + 1))492 {493 // There's still time remaining so increase the run count....494 $this->test_run_count += $tests_to_run_count;495 }496 }497 }498 }499 pts_file_io::unlink(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/active.xml');500 foreach($this->tests_to_run as &$run_request)501 {502 // Remove cache shares503 foreach(pts_file_io::glob($run_request->test_profile->get_install_dir() . 'cache-share-*.pt2so') as $cache_share_file)504 {505 unlink($cache_share_file);506 }507 }508 if($this->post_run_message != null)509 {510 pts_client::$display->display_interrupt_message($this->post_run_message);511 }512 self::$test_run_process_active = -1;513 pts_module_manager::module_process('__post_run_process', $this);514 pts_client::release_lock($lock_path);515 // Report any tests that failed to properly run516 if(pts_client::is_debug_mode() || $this->get_test_count() > 3)517 {518 if(count($this->failed_tests_to_run) > 0)519 {520 echo PHP_EOL . PHP_EOL . 'The following tests failed to properly run:' . PHP_EOL . PHP_EOL;521 foreach($this->failed_tests_to_run as &$run_request)522 {523 echo "\t- " . $run_request->test_profile->get_identifier() . ($run_request->get_arguments_description() != null ? ': ' . $run_request->get_arguments_description() : null) . PHP_EOL;524 }525 echo PHP_EOL;526 }527 }528 }529 public static function test_run_process_active()530 {531 return self::$test_run_process_active = true;532 }533 public function process_test_run_request($run_index)534 {535 $result = false;536 if($this->result_file && $this->result_file->get_test_count() > 0)537 {538 $this->result_file->get_xml(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/composite.xml');539 }540 if(is_object($run_index))541 {542 $test_run_request = $run_index;543 $run_index = 0;544 }545 else546 {547 $test_run_request = $this->get_test_to_run($run_index);548 }549 if(($run_index != 0 && count(pts_file_io::glob($test_run_request->test_profile->get_install_dir() . 'cache-share-*.pt2so')) == 0))550 {551 // Sleep for six seconds between tests by default552 sleep(6);553 }554 if($test_run_request == false)555 {556 return;557 }558 if($this->result_file instanceof pts_result_file && $this->result_file->has_matching_test_and_run_identifier($test_run_request, $this->get_results_identifier()))559 {560 // There already is a match for this test in this particular result buffer561 return true;562 }563 $test_successful = pts_test_execution::run_test($this, $test_run_request);564 if(pts_file_io::unlink(PTS_USER_PATH . 'halt-testing'))565 {566 // Stop the testing process entirely567 return false;568 }569 else if(pts_file_io::unlink(PTS_USER_PATH . 'skip-test'))570 {571 // Just skip the current test and do not save the results, but continue testing572 return true;573 }574 else if(pts_client::read_env('LIMIT_ELAPSED_TEST_TIME') > 0 && (PTS_INIT_TIME + (pts_client::read_env('LIMIT_ELAPSED_TEST_TIME') * 60)) > time())575 {576 // Allocated amount of time has expired577 return false;578 }579 if($test_successful == false && $test_run_request->test_profile->get_identifier() != null)580 {581 $this->failed_tests_to_run[] = $test_run_request;582 // For now delete the failed test log files, but it may be a good idea to keep them583 pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/' . $this->get_results_identifier() . '/', null, true);584 }585 pts_module_manager::module_process('__post_test_run_process', $this->result_file);586 return true;587 }588 public static function process_json_report_attributes(&$test_run_request)589 {590 // XXX : add to attributes JSON here591 $json_report_attributes = null;592 if(($t = $test_run_request->test_profile->test_installation->get_compiler_data()))593 {594 $json_report_attributes['compiler-options'] = $t;595 }596 if(($t = $test_run_request->test_profile->test_installation->get_install_footnote()))597 {598 $json_report_attributes['install-footnote'] = $t;599 }600 if(($t = $test_run_request->active->get_min_result()) != 0)601 {602 $json_report_attributes['min-result'] = $t;603 }604 if(($t = $test_run_request->active->get_max_result()) != 0)605 {606 $json_report_attributes['max-result'] = $t;607 }608 return $json_report_attributes;609 }610 public static function clean_save_name($input, $is_new_save = true)611 {612 $input = pts_client::swap_variables($input, array('pts_client', 'user_run_save_variables'));613 $input = pts_strings::remove_redundant(pts_strings::keep_in_string(str_replace(' ', '-', trim($input)), pts_strings::CHAR_LETTER | pts_strings::CHAR_NUMERIC | pts_strings::CHAR_DASH), '-');614 if($is_new_save)615 {616 $input = strtolower($input);617 }618 if(strlen($input) > 126)619 {620 $input = substr($input, 0, 126);621 }622 return $input;623 }624 public function initial_checks(&$to_run, $override_display_mode = false)625 {626 // Refresh the pts_client::$display in case we need to run in debug mode627 if(pts_client::$display == false || !(pts_client::$display instanceof pts_websocket_display_mode))628 {629 pts_client::init_display_mode($override_display_mode);630 }631 $to_run = pts_types::identifiers_to_objects($to_run);632 if($this->batch_mode && $this->batch_mode['Configured'] == false && !$this->auto_mode)633 {634 trigger_error('The batch mode must first be configured.' . PHP_EOL . 'To configure, run phoronix-test-suite batch-setup', E_USER_ERROR);635 return false;636 }637 if(!is_writable(pts_client::test_install_root_path()))638 {639 trigger_error('The test installation directory is not writable.' . PHP_EOL . 'Location: ' . pts_client::test_install_root_path(), E_USER_ERROR);640 return false;641 }642 // Cleanup tests to run643 if($this->cleanup_tests_to_run($to_run) == false)644 {645 return false;646 }647 else if(count($to_run) == 0)648 {649 trigger_error('You must enter at least one test, suite, or result identifier to run.', E_USER_ERROR);650 return false;651 }652 return true;653 }654 public function pre_execution_process()655 {656 if($this->do_save_results())657 {658 if($this->is_new_result_file || $this->result_already_contains_identifier() == false)659 {660 $this->result_file->set_title($this->file_name_title);661 $this->result_file->set_description($this->run_description);662 $this->result_file->set_notes($this->get_notes());663 $this->result_file->set_internal_tags($this->get_internal_tags());664 $this->result_file->set_reference_id($this->get_reference_id());665 $this->result_file->set_preset_environment_variables($this->get_preset_environment_variables());666 // TODO XXX JSON In null and notes667 $sys = new pts_result_file_system($this->results_identifier, phodevi::system_hardware(true), phodevi::system_software(true), $this->generate_json_system_attributes(), pts_client::current_user(), pts_test_notes_manager::generate_test_notes($this->tests_to_run), date('Y-m-d H:i:s'), PTS_VERSION);668 $this->result_file->add_system($sys);669 }670 pts_client::setup_test_result_directory($this->get_file_name());671 }672 }673 protected function generate_json_system_attributes()674 {675 $test_external_dependencies = array();676 $test_hardware_types = array();677 $test_internal_tags = array();678 foreach($this->tests_to_run as &$test_to_run)679 {680 $test_external_dependencies = array_merge($test_external_dependencies, $test_to_run->test_profile->get_external_dependencies());681 $test_internal_tags = array_merge($test_internal_tags, $test_to_run->test_profile->get_internal_tags());682 pts_arrays::unique_push($test_hardware_types, $test_to_run->test_profile->get_test_hardware_type());683 }684 return self::pull_test_notes(false, $test_external_dependencies, $test_internal_tags, $test_hardware_types);685 }686 public static function pull_test_notes($show_all = false, $test_external_dependencies = array(), $test_internal_tags = array(), $test_hardware_types = array())687 {688 $notes = null;689 if($show_all || in_array('build-utilities', $test_external_dependencies))690 {691 // So compiler tests were run....692 $test = false;693 $compiler_mask_dir = pts_test_installer::create_compiler_mask($test);694 if($compiler_mask_dir && is_executable($compiler_mask_dir . 'cc'))695 {696 $compiler_configuration = phodevi_system::sw_compiler_build_configuration($compiler_mask_dir . 'cc');697 pts_file_io::delete($compiler_mask_dir, null, true);698 if(!empty($compiler_configuration))699 {700 $notes['compiler-configuration'] = $compiler_configuration;701 }702 }703 }704 if($show_all || in_array('OpenCL', $test_internal_tags))705 {706 // So OpenCL tests were run....707 $gpu_compute_cores = phodevi::read_property('gpu', 'compute-cores');708 if($gpu_compute_cores > 0)709 {710 $notes['graphics-compute-cores'] = $gpu_compute_cores;711 }712 }713 if($show_all || in_array('Disk', $test_hardware_types))714 {715 // A disk test was run so report some disk information...716 $disk_scheduler = phodevi::read_property('disk', 'scheduler');717 if($disk_scheduler)718 {719 $notes['disk-scheduler'] = $disk_scheduler;720 }721 $mount_options = phodevi::read_property('disk', 'mount-options');722 if($mount_options['mount-options'] != null)723 {724 $notes['disk-mount-options'] = $mount_options['mount-options'];725 }726 $extra = phodevi::read_property('disk', 'extra-disk-details');727 if($extra != null)728 {729 $notes['disk-details'] = $extra;730 }731 }732 if(true || $show_all || in_array('Processor', $test_hardware_types) || in_array('System', $test_hardware_types))733 {734 // XXX probably makes sense always reporting the CPU scaling governor735 $scaling_governor = phodevi::read_property('cpu', 'scaling-governor');736 if($scaling_governor)737 {738 $notes['cpu-scaling-governor'] = $scaling_governor;739 }740 }741 if($show_all || in_array('Graphics', $test_hardware_types))742 {743 $accel_2d = phodevi::read_property('gpu', '2d-acceleration');744 if($accel_2d)745 {746 $notes['graphics-2d-acceleration'] = $accel_2d;747 }748 $aa = phodevi::read_property('gpu', 'aa-level');749 if($aa)750 {751 $notes['graphics-aa'] = $aa;752 }753 $af = phodevi::read_property('gpu', 'af-level');754 if($af)755 {756 $notes['graphics-af'] = $af;757 }758 $oc_offset = phodevi::read_property('gpu', 'oc-offset-string');759 if(!empty($oc_offset))760 {761 $notes['graphics-oc'] = $oc_offset;762 }763 }764 if(phodevi::read_property('system', 'kernel-parameters'))765 {766 $notes['kernel-parameters'] = phodevi::read_property('system', 'kernel-parameters');767 }768 if(phodevi::read_property('system', 'environment-variables'))769 {770 $notes['environment-variables'] = phodevi::read_property('system', 'environment-variables');771 }772 return $notes;773 }774 public function post_execution_process()775 {776 if($this->do_save_results())777 {778 if($this->result_file->get_test_count() == 0 && $this->is_new_result_file)779 {780 pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name());781 return false;782 }783 pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/', null, true);784 if($this->is_new_result_file || $this->result_already_contains_identifier() == false)785 {786 // nothing to do here now787 }788 echo PHP_EOL;789 pts_module_manager::module_process('__event_results_process', $this);790 pts_client::save_test_result($this->get_file_name() . '/composite.xml', $this->result_file->get_xml(), true, $this->results_identifier);791 pts_module_manager::module_process('__event_results_saved', $this);792 //echo PHP_EOL . 'Results Saved To: ; . PTS_SAVE_RESULTS_PATH . $this->get_file_name() . ;/composite.xml' . PHP_EOL;793 if(!$this->auto_mode)794 {795 if($this->batch_mode)796 {797 if($this->batch_mode['OpenBrowser'])798 {799 pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, true);800 }801 }802 else803 {804 if((pts_client::read_env('DISPLAY') == false && pts_client::read_env('WAYLAND_DISPLAY') == false) && !defined('PHOROMATIC_PROCESS'))805 {806 $txt_results = pts_user_io::prompt_bool_input('Do you want to view the text results of the testing', true);807 if($txt_results)808 {809 echo pts_result_file_output::result_file_to_text($this->result_file, pts_client::terminal_width());810 }811 }812 else813 {814 pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, false);815 }816 }817 }818 if($this->allow_sharing_of_results && pts_network::internet_support_available())819 {820 if($this->auto_upload_to_openbenchmarking || pts_openbenchmarking_client::auto_upload_results() || pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/AlwaysUploadResultsToOpenBenchmarking', 'FALSE'))821 {822 $upload_results = true;823 }824 else if($this->batch_mode)825 {826 $upload_results = $this->batch_mode['UploadResults'];827 }828 else if(!$this->auto_mode)829 {830 $upload_results = pts_user_io::prompt_bool_input('Would you like to upload the results to OpenBenchmarking.org', true);831 }832 else833 {834 $upload_results = false;835 }836 if($upload_results)837 {838 $this->openbenchmarking_results_data = pts_openbenchmarking::upload_test_result($this, true, (!$this->auto_mode && !$this->batch_mode));839 if($this->get_results_url())840 {841 if(!$this->auto_mode && !$this->batch_mode && pts_openbenchmarking_client::auto_upload_results() == false)842 {843 pts_client::display_web_page($this->get_results_url(), 'Do you want to launch OpenBenchmarking.org', true);844 }845 }846 else847 {848 echo PHP_EOL . 'Results Failed To Upload.' . PHP_EOL;849 }850 }851 }852 }853 }854 public function get_results_url()855 {856 return isset($this->openbenchmarking_results_data['url']) ? $this->openbenchmarking_results_data['url'] : false;857 }858 public function get_result_upload_data()859 {860 return $this->openbenchmarking_results_data;861 }862 public function set_batch_mode($custom_preset = false)863 {864 $this->batch_mode = array(865 'UploadResults' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/UploadResults', 'TRUE'),866 'SaveResults' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/SaveResults', 'TRUE'),867 'PromptForTestDescription' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/PromptForTestDescription', 'FALSE'),868 'RunAllTestCombinations' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/RunAllTestCombinations', 'TRUE'),869 'PromptSaveName' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/PromptSaveName', 'FALSE'),870 'PromptForTestIdentifier' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/PromptForTestIdentifier', 'TRUE'),871 'Configured' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/Configured', 'FALSE'),872 'OpenBrowser' => pts_config::read_bool_config('PhoronixTestSuite/Options/BatchMode/OpenBrowser', 'FALSE'),873 );874 if($custom_preset && is_array($custom_preset))875 {876 foreach($custom_preset as $key => $value)877 {878 $this->batch_mode[$key] = $value;879 }880 $this->batch_mode['Configured'] = true;881 }882 }883 public function cleanup_tests_to_run(&$to_run_objects)884 {885 $skip_tests = ($e = pts_client::read_env('SKIP_TESTS')) ? pts_strings::comma_explode($e) : false;886 $tests_verified = array();887 $tests_missing = array();888 foreach($to_run_objects as &$run_object)889 {890 if($skip_tests && (in_array($run_object->get_identifier(false), $skip_tests) || ($run_object instanceof pts_test_profile && in_array($run_object->get_identifier_base_name(), $skip_tests))))891 {892 pts_client::$display->generic_sub_heading('Skipping: ' . $run_object->get_identifier());893 continue;894 }895 else if($run_object instanceof pts_test_profile)896 {897 if($run_object->get_title() == null)898 {899 pts_client::$display->generic_sub_heading('Not A Test: ' . $run_object);900 continue;901 }902 else903 {904 if($run_object->is_supported(false) == false)905 {906 continue;907 }908 if($run_object->is_test_installed() == false)909 {910 // Check to see if older version of test is currently installed911 // TODO: show change-log between installed versions and upstream912 $tests_missing[] = $run_object;913 continue;914 }915 }916 }917 else if($run_object instanceof pts_result_file)918 {919 $num_installed = 0;920 foreach($run_object->get_contained_test_profiles() as $test_profile)921 {922 if($test_profile == null || $test_profile->get_identifier() == null || $test_profile->is_supported(false) == false)923 {924 continue;925 }926 else if($test_profile->is_test_installed() == false)927 {928 $tests_missing[] = $test_profile;929 }930 else931 {932 $num_installed++;933 }934 }935 if($num_installed == 0)936 {937 continue;938 }939 }940 else if($run_object instanceof pts_test_suite || $run_object instanceof pts_virtual_test_suite|| $run_object instanceof pts_virtual_test_queue)941 {942 if($run_object->is_core_version_supported() == false)943 {944 pts_client::$display->generic_sub_heading($run_object->get_title() . ' is a suite not supported by this version of the Phoronix Test Suite.');945 continue;946 }947 $num_installed = 0;948 foreach($run_object->get_contained_test_profiles() as $test_profile)949 {950 if($test_profile == null || $test_profile->get_identifier() == null || $test_profile->is_supported(false) == false)951 {952 continue;953 }954 if($test_profile->is_test_installed() == false)955 {956 $tests_missing[] = $test_profile;957 }958 else959 {960 $num_installed++;961 }962 }963 if($num_installed == 0)964 {965 continue;966 }967 }968 else969 {970 pts_client::$display->generic_sub_heading('Not Recognized: ' . $run_object);971 continue;972 }973 $tests_verified[] = $run_object;974 }975 $to_run_objects = $tests_verified;976 if(count($tests_missing) > 0 && !defined('PHOROMATIC_PROCESS'))977 {978 $tests_missing = array_unique($tests_missing);979 if(count($tests_missing) == 1)980 {981 trigger_error($tests_missing[0] . ' is not installed.', E_USER_ERROR);982 // PHP_EOL . 'To install, run: phoronix-test-suite install ' . $tests_missing[0]983 }984 else985 {986 $message = PHP_EOL . PHP_EOL . 'Multiple tests are not installed:' . PHP_EOL . PHP_EOL;987 $message .= pts_user_io::display_text_list($tests_missing);988 //$message .= PHP_EOL . 'To install, run: phoronix-test-suite install ' . implode(' ', $tests_missing) . PHP_EOL . PHP_EOL;989 echo $message;990 }991 if(!$this->batch_mode && !$this->auto_mode && pts_client::current_command() != 'benchmark')992 {993 $stop_and_install = pts_user_io::prompt_bool_input('Would you like to stop and install these tests now', true);994 if($stop_and_install)995 {996 pts_test_installer::standard_install($tests_missing);997 $this->cleanup_tests_to_run($to_run_objects);998 }999 }1000 }1001 return true;1002 }1003 public function auto_save_results($save_name, $result_identifier, $description = null, $is_new_save = false)1004 {1005 $this->set_save_name($save_name, $is_new_save);1006 $this->set_results_identifier($result_identifier);1007 $this->set_description($description);1008 }1009 public function set_description($description)1010 {1011 $this->run_description = $description == null ? self::auto_generate_description() : $description;1012 }1013 public function subsystems_under_test()1014 {1015 $subsystems_to_test = array();1016 foreach($this->tests_to_run as &$test_run_request)1017 {1018 pts_arrays::unique_push($subsystems_to_test, $test_run_request->test_profile->get_test_hardware_type());1019 }1020 return $subsystems_to_test;1021 }1022 protected function auto_generate_description()1023 {1024 $hw_components = array(pts_result_file_analyzer::system_component_string_to_array(phodevi::system_hardware(true)));1025 $sw_components = array(pts_result_file_analyzer::system_component_string_to_array(phodevi::system_software(true)));1026 if($this->is_new_result_file)1027 {1028 $existing_identifiers = array();1029 $hw_components = array();1030 $sw_components = array();1031 foreach($this->result_file->get_systems() as $s)1032 {1033 $hw_components[] = pts_result_file_analyzer::system_component_string_to_array($s->get_hardware());1034 $sw_components[] = pts_result_file_analyzer::system_component_string_to_array($s->get_software());1035 $existing_identifiers[] = $s->get_identifier();1036 }1037 $existing_identifier_count = count($existing_identifiers);1038 }1039 else1040 {1041 $existing_identifier_count = 0;1042 }1043 $auto_description = 'Running ' . implode(', ', array_unique($this->get_tests_to_run_identifiers()));1044 $subsystems_to_test = $this->subsystems_under_test();1045 // TODO: hook into $hw_components and $sw_components for leveraging existing result file data for comparisons already in existent1046 // dropped: count($subsystems_to_test) == 1 && $1047 if($existing_identifier_count == 0)1048 {1049 switch($subsystems_to_test)1050 {1051 case 'Graphics':1052 $auto_description = phodevi::read_property('gpu', 'model') . ' graphics testing with ' . phodevi::read_property('system', 'display-driver-string') . ' / ' . phodevi::read_property('system', 'opengl-driver');1053 break;1054 case 'Disk':1055 $auto_description = phodevi::read_name('disk') . ' testing on ' . phodevi::read_property('system', 'operating-system') . ' with a ' . phodevi::read_property('system', 'filesystem') . ' file-system';1056 break;1057 case 'Memory':1058 case 'Processor':1059 $auto_description = phodevi::read_property('cpu', 'model') . ' testing with a ' . phodevi::read_name('motherboard') . ' on ' . phodevi::read_property('system', 'operating-system');1060 break;1061 default:1062 if(phodevi::read_property('system', 'system-layer'))1063 {1064 // Virtualization, Wine testing...1065 $auto_description = phodevi::read_property('system', 'system-layer') . ' testing on ' . phodevi::read_property('system', 'operating-system');1066 }1067 else if(phodevi::read_name('motherboard') != null && phodevi::read_property('gpu', 'model') != null)1068 {1069 // Standard description1070 $auto_description = phodevi::read_property('cpu', 'model') . ' testing with a ' . phodevi::read_name('motherboard') . ' and ' . phodevi::read_property('gpu', 'model') . ' on ' . phodevi::read_property('system', 'operating-system');1071 }1072 else1073 {1074 // A virtualized environment or a BSD or other OS where not all hardware info is available...1075 $auto_description = phodevi::read_property('cpu', 'model') . ' testing on ' . phodevi::read_property('system', 'operating-system');1076 }1077 break;1078 }1079 }1080 else1081 {1082 if($this->is_new_result_file)1083 {1084 $result_file_intent = pts_result_file_analyzer::analyze_result_file_intent($this->result_file);1085 if(is_array($result_file_intent) && $result_file_intent[0] != 'Unknown')1086 {1087 $auto_description = 'A ' . $result_file_intent[0] . ' comparison';1088 }1089 }1090 }1091 $auto_description .= ' via the Phoronix Test Suite.';1092 return $auto_description;1093 }1094 public function save_results_prompt()1095 {1096 if(!$this->auto_mode)1097 {1098 pts_client::$display->generic_heading('System Information');1099 echo phodevi::system_centralized_view() . PHP_EOL;1100 }1101 if(($this->prompt_save_results || $this->force_save_results) && count($this->tests_to_run) > 0) // or check for DO_NOT_SAVE_RESULTS == false1102 {1103 if($this->force_save_results || pts_client::read_env('TEST_RESULTS_NAME'))1104 {1105 $save_results = true;1106 }1107 else if($this->batch_mode)1108 {1109 $save_results = $this->batch_mode['SaveResults'];1110 }1111 else if(pts_client::is_debug_mode())1112 {1113 $save_results = false;1114 }1115 else1116 {1117 $save_results = pts_user_io::prompt_bool_input('Would you like to save these test results', true);1118 }1119 if($save_results)1120 {1121 // Prompt Save File Name1122 $this->prompt_save_name();1123 // Prompt Identifier1124 $this->prompt_results_identifier();1125 if(!isset($this->run_description[16]) || strpos($this->run_description, 'via the Phoronix Test Suite') !== false)1126 {1127 // Write the auto-description if nothing is set or attempt to auto-detect if it was a previous auto-description saved1128 $this->run_description = self::auto_generate_description();1129 }1130 // Prompt Description1131 if(!$this->batch_mode || $this->batch_mode['PromptForTestDescription'])1132 {1133 if($this->run_description == null)1134 {1135 $this->run_description = 'N/A';1136 }1137 if(pts_client::read_env('TEST_RESULTS_DESCRIPTION'))1138 {1139 if(strlen(pts_client::read_env('TEST_RESULTS_DESCRIPTION')) > 1)1140 {1141 $this->run_description = pts_client::read_env('TEST_RESULTS_DESCRIPTION');1142 echo 'Test Description: ' . $this->run_description . PHP_EOL;1143 }1144 }1145 else if(!$this->auto_mode)1146 {1147 //echo PHP_EOL . 'Current Title: ' . $this->file_name_title . PHP_EOL;1148 pts_client::$display->generic_heading('If desired, enter a new description below to better describe this result set / system configuration under test.' . PHP_EOL . 'Press ENTER to proceed without changes.');1149 echo 'Current Description: ' . $this->run_description . PHP_EOL . PHP_EOL . 'New Description: ';1150 $new_test_description = pts_user_io::read_user_input();1151 if(!empty($new_test_description))1152 {1153 $this->run_description = $new_test_description;1154 }1155 }1156 }1157 }1158 }1159 }1160 public function load_tests_to_run(&$to_run_objects)1161 {1162 // Determine what to run1163 $this->determine_tests_to_run($to_run_objects);1164 // Is there something to run?1165 return $this->get_test_count() > 0;1166 }1167 public function load_result_file_to_run($save_name, $result_identifier, &$result_file, $tests_to_complete = null)1168 {1169 // Determine what to run1170 $this->auto_save_results($save_name, $result_identifier);1171 $this->run_description = $result_file->get_description();1172 $result_objects = $result_file->get_result_objects();1173 // Unset result objects that shouldn't be run1174 if(is_array($tests_to_complete))1175 {1176 foreach(array_keys($result_objects) as $i)1177 {1178 if(!in_array($i, $tests_to_complete))1179 {1180 unset($result_objects[$i]);1181 }1182 }1183 }1184 if(count($result_objects) == 0)1185 {1186 return false;1187 }1188 foreach($result_objects as &$result_object)1189 {1190 if($this->validate_test_to_run($result_object->test_profile))1191 {1192 $test_result = new pts_test_result($result_object->test_profile);1193 $test_result->set_used_arguments($result_object->get_arguments());1194 $test_result->set_used_arguments_description($result_object->get_arguments_description());1195 $this->add_test_result_object($test_result);1196 }1197 }1198 // Is there something to run?1199 return $this->get_test_count() > 0;1200 }1201 public function load_test_run_requests_to_run($save_name, $result_identifier, &$result_file, &$test_run_requests)1202 {1203 // Determine what to run1204 $this->auto_save_results($save_name, $result_identifier);1205 $this->run_description = $result_file->get_description();1206 if(count($test_run_requests) == 0)1207 {1208 return false;1209 }1210 foreach($test_run_requests as &$test_run_request)1211 {1212 if($this->validate_test_to_run($test_run_request->test_profile) == false)1213 {1214 continue;1215 }1216 if($test_run_request->test_profile->get_override_values() != null)1217 {1218 $test_run_request->test_profile->set_override_values($test_run_request->test_profile->get_override_values());1219 }1220 $test_result = new pts_test_result($test_run_request->test_profile);1221 $test_result->set_used_arguments($test_run_request->get_arguments());1222 $test_result->set_used_arguments_description($test_run_request->get_arguments_description());1223 $this->add_test_result_object($test_result);1224 }1225 // Is there something to run?1226 return $this->get_test_count() > 0;1227 }1228 public function is_multi_test_stress_run()1229 {1230 return $this->multi_test_stress_run;1231 }1232 protected function test_prompts_to_result_objects(&$test_profile)1233 {1234 $result_objects = array();1235 if($this->batch_mode && $this->batch_mode['RunAllTestCombinations'])1236 {1237 list($test_arguments, $test_arguments_description) = pts_test_run_options::batch_user_options($test_profile);1238 }1239 else if($this->auto_mode == 2)1240 {1241 list($test_arguments, $test_arguments_description) = pts_test_run_options::default_user_options($test_profile);1242 }1243 else1244 {1245 list($test_arguments, $test_arguments_description) = pts_test_run_options::prompt_user_options($test_profile);1246 }1247 foreach(array_keys($test_arguments) as $i)1248 {1249 $test_result = new pts_test_result($test_profile);1250 $test_result->set_used_arguments($test_arguments[$i]);1251 $test_result->set_used_arguments_description($test_arguments_description[$i]);1252 $result_objects[] = $test_result;1253 }1254 return $result_objects;1255 }1256 public function determine_tests_to_run(&$to_run_objects)1257 {1258 $unique_test_count = count(array_unique($to_run_objects));1259 $run_contains_a_no_result_type = false;1260 $request_results_save = false;1261 foreach($to_run_objects as &$run_object)1262 {1263 // TODO: determine whether to print the titles of what's being run?1264 if($run_object instanceof pts_test_profile)1265 {1266 if($run_object->get_identifier() == null || $run_object->get_title() == null || $this->validate_test_to_run($run_object) == false)1267 {1268 continue;1269 }1270 if($run_contains_a_no_result_type == false && $run_object->get_display_format() == 'NO_RESULT')1271 {1272 $run_contains_a_no_result_type = true;1273 }1274 if($request_results_save == false && $run_object->do_auto_save_results())1275 {1276 $request_results_save = true;1277 }1278 foreach(self::test_prompts_to_result_objects($run_object) as $result_object)1279 {1280 $this->add_test_result_object($result_object);1281 }1282 }1283 else if($run_object instanceof pts_test_suite)1284 {1285 $this->pre_run_message = $run_object->get_pre_run_message();1286 $this->post_run_message = $run_object->get_post_run_message();1287 if($run_object->get_run_mode() == 'PCQS')1288 {1289 $this->is_pcqs = true;1290 }1291 foreach($run_object->get_contained_test_result_objects() as $result_object)1292 {1293 $this->add_test_result_object($result_object);1294 }1295 }1296 else if($run_object instanceof pts_virtual_test_queue)1297 {1298 foreach($run_object->get_contained_test_result_objects() as $result_object)1299 {1300 $this->add_test_result_object($result_object);1301 }1302 }1303 else if($run_object instanceof pts_result_file)1304 {1305 // Print the $to_run ?1306 $this->run_description = $run_object->get_description();1307 $preset_vars = $run_object->get_preset_environment_variables();1308 $result_objects = $run_object->get_result_objects();1309 $this->set_save_name($run_object->get_identifier(), false);1310 $this->file_name_title = $run_object->get_title();1311 pts_module_manager::process_environment_variables_string_to_set($preset_vars);1312 foreach($result_objects as &$result_object)1313 {1314 if($result_object->test_profile->get_identifier() == null)1315 {1316 continue;1317 }1318 $test_result = new pts_test_result($result_object->test_profile);1319 $test_result->set_used_arguments($result_object->get_arguments());1320 $test_result->set_used_arguments_description($result_object->get_arguments_description());1321 $this->add_test_result_object($test_result);1322 }1323 }1324 else if($run_object instanceof pts_virtual_test_suite)1325 {1326 $virtual_suite_tests = $run_object->get_contained_test_profiles();1327 foreach(array_keys($virtual_suite_tests) as $i)1328 {1329 if($virtual_suite_tests[$i]->is_supported(false) == false || $this->validate_test_to_run($virtual_suite_tests[$i]) == false)1330 {1331 unset($virtual_suite_tests[$i]);1332 }1333 }1334 sort($virtual_suite_tests);1335 if(count($virtual_suite_tests) > 1)1336 {1337 $virtual_suite_tests[] = 'All Tests In Suite';1338 }1339 if(!$this->auto_mode && !$this->batch_mode)1340 {1341 $run_index = explode(',', pts_user_io::prompt_text_menu('Select the tests in the virtual suite to run', $virtual_suite_tests, true, true));1342 }1343 else1344 {1345 $run_index = -1;1346 }1347 if((count($virtual_suite_tests) > 2 && is_array($run_index) && in_array((count($virtual_suite_tests) - 1), $run_index)) || $run_index == -1)1348 {1349 // The appended 'All Tests In Suite' was selected, so run all1350 }1351 else1352 {1353 foreach(array_keys($virtual_suite_tests) as $i)1354 {1355 if(!in_array($i, $run_index))1356 {1357 unset($virtual_suite_tests[$i]);1358 }1359 }1360 }1361 foreach($virtual_suite_tests as &$test_profile)1362 {1363 if($test_profile instanceof pts_test_profile)1364 {1365 // The user is to configure virtual suites manually1366 foreach(self::test_prompts_to_result_objects($test_profile) as $result_object)1367 {1368 $this->add_test_result_object($result_object);1369 }1370 }1371 }1372 }1373 else1374 {1375 trigger_error($run_object . ' is not recognized.', E_USER_ERROR);1376 continue;1377 }1378 }1379 // AlwaysUploadResultsToOpenBenchmarking AutoSortRunQueue1380 if(pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/AutoSortRunQueue', 'TRUE') && $this->force_save_results == false)1381 {1382 // Not that it matters much, but if $this->force_save_results is set that means likely running from a result file...1383 // so if running a result file, don't change the ordering of the existing results1384 // Sort the run order so that all tests that are similar are grouped together, etc1385 usort($this->tests_to_run, array('pts_test_run_manager', 'cmp_result_object_sort'));1386 }1387 if(pts_client::read_env('RUN_TESTS_IN_RANDOM_ORDER'))1388 {1389 shuffle($this->tests_to_run);1390 }1391 $this->prompt_save_results = $run_contains_a_no_result_type == false || $unique_test_count > 1;1392 $this->force_save_results = $this->force_save_results || $request_results_save;1393 }1394 public static function cmp_result_object_sort($a, $b)...

Full Screen

Full Screen

load_dynamic_result_viewer.php

Source:load_dynamic_result_viewer.php Github

copy

Full Screen

...72 // echo 'Port ' . $remote_access . ' chosen as random port for this instance. Change the default port via the Phoronix Test Suite user configuration file.' . PHP_EOL;73 }74 $remote_access = is_numeric($remote_access) && $remote_access > 1 ? $remote_access : false;75 $blocked_ports = array(2049, 3659, 4045, 6000, 9000);76 if(pts_config::read_bool_config('PhoronixTestSuite/Options/ResultViewer/LimitAccessToLocalHost', 'TRUE'))77 {78 $server_ip = 'localhost';79 }80 else81 {82 // Allows server to be web accessible83 $server_ip = '0.0.0.0';84 }85 if(($fp = fsockopen('127.0.0.1', $remote_access, $errno, $errstr, 5)) != false)86 {87 fclose($fp);88 //trigger_error('Port ' . $remote_access . ' is already in use by another server process. Close that process or change the Phoronix Test Suite server port via' . pts_config::get_config_file_location() . ' to proceed.', E_USER_ERROR);89 return false;90 }...

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1$my_config = new pts_config();2$my_config->read_bool_config('test_bool');3$my_config = new pts_config();4$my_config->read_bool_config('test_bool');5$my_config = new pts_config();6$my_config->read_bool_config('test_bool');7$my_config = new pts_config();8$my_config->read_bool_config('test_bool');9$my_config = new pts_config();10$my_config->read_bool_config('test_bool');

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1$read_bool_config = $config->read_bool_config('CONFIG_VAR');2$read_bool_config = $config->read_bool_config('CONFIG_VAR', 'default_value');3$read_bool_config = $config->read_bool_config('CONFIG_VAR', 'default_value', 'section_name');4$read_bool_config = pts_config::read_bool_config('CONFIG_VAR');5$read_bool_config = pts_config::read_bool_config('CONFIG_VAR', 'default_value');6$read_bool_config = pts_config::read_bool_config('CONFIG_VAR', 'default_value', 'section_name');7$read_bool_config = pts_config::read_bool_config('CONFIG_VAR', 'default_value', 'section_name', 'config_file_path');8$read_bool_config = pts_config::read_bool_config('CONFIG_VAR', 'default_value', 'section_name', 'config_file_path', 'config_file_name');9$read_bool_config = pts_config::read_bool_config('CONFIG_VAR', 'default_value', 'section_name', 'config_file_path', 'config_file_name', 'config_file_format');10$read_bool_config = pts_config::read_bool_config('CONFIG_VAR', 'default_value', 'section_name', 'config_file_path', 'config_file_name', 'config_file_format', 'config_file_extension');11$read_bool_config = pts_config::read_bool_config('CONFIG_VAR', 'default_value', 'section_name', 'config_file_path', 'config_file_name', 'config

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1$use_cache = pts_config::read_bool_config('use_cache', 'options');2if ($use_cache) {3} else {4}5$use_cache = pts_config::read_bool_config('use_cache', 'options');6if ($use_cache) {7} else {8}9$use_cache = pts_config::read_bool_config('use_cache', 'options');10if ($use_cache) {11} else {12}13$use_cache = pts_config::read_bool_config('use_cache', 'options');14if ($use_cache) {15} else {16}17$use_cache = pts_config::read_bool_config('use_cache', 'options');18if ($use_cache) {19} else {20}21$use_cache = pts_config::read_bool_config('use_cache', 'options');22if ($use_cache) {23} else {24}25$use_cache = pts_config::read_bool_config('use_cache', 'options');26if ($use_cache) {27} else {28}

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1$conf = new pts_config();2$conf->read_bool_config('config.ini','enable','enable');3$conf->read_bool_config('config.ini','disable','disable');4Recommended Posts: PHP | read_config() Method5PHP | read_int_config() Method6PHP | read_string_config() Method7PHP | read_float_config() Method8PHP | read_array_config() Method9PHP | read_config() Method10PHP | read_int_config() Method11PHP | read_string_config() Method12PHP | read_float_config() Method13PHP | read_array_config() Method14PHP | read_config() Method15PHP | read_int_config() Method16PHP | read_string_config() Method17PHP | read_float_config() Method18PHP | read_array_config() Method19PHP | read_config() Method20PHP | read_int_config() Method21PHP | read_string_config() Method22PHP | read_float_config() Method23PHP | read_array_config() Method24PHP | read_config() Method25PHP | read_int_config() Method26PHP | read_string_config() Method27PHP | read_float_config() Method28PHP | read_array_config() Method29PHP | read_config() Method30PHP | read_int_config() Method31PHP | read_string_config() Method32PHP | read_float_config() Method33PHP | read_array_config() Method34PHP | read_config() Method35PHP | read_int_config() Method36PHP | read_string_config() Method37PHP | read_float_config() Method38PHP | read_array_config() Method39PHP | read_config() Method40PHP | read_int_config() Method41PHP | read_string_config() Method42PHP | read_float_config() Method43PHP | read_array_config() Method44PHP | read_config() Method45PHP | read_int_config() Method46PHP | read_string_config() Method47PHP | read_float_config() Method48PHP | read_array_config() Method49PHP | read_config() Method50PHP | read_int_config() Method51PHP | read_string_config() Method52PHP | read_float_config() Method53PHP | read_array_config() Method54PHP | read_config() Method55PHP | read_int_config() Method56PHP | read_string_config() Method

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1$config = new pts_config('1.php');2$bool = $config->read_bool_config('bool');3echo $bool;4$config = new pts_config('1.php');5$bool = $config->read_bool_config('bool');6echo $bool;7$config = new pts_config('1.php');8$bool = $config->read_bool_config('bool');9echo $bool;10$config = new pts_config('1.php');11$bool = $config->read_bool_config('bool');12echo $bool;13$config = new pts_config('1.php');14$bool = $config->read_bool_config('bool');15echo $bool;16$config = new pts_config('1.php');17$bool = $config->read_bool_config('bool');18echo $bool;19$config = new pts_config('1.php');20$bool = $config->read_bool_config('bool');21echo $bool;

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1$test = new pts_config();2$test->read_bool_config("auto_save_results", "TRUE");3$test = new pts_config();4$test->read_bool_config("auto_save_results", "FALSE");5$test = new pts_config();6$test->read_bool_config("auto_save_results", "TRUE");7$test = new pts_config();8$test->read_bool_config("auto_save_results", "FALSE");9$test = new pts_config();10$test->read_bool_config("auto_save_results", "TRUE");11$test = new pts_config();12$test->read_bool_config("auto_save_results", "FALSE");13$test = new pts_config();14$test->read_bool_config("auto_save_results", "TRUE");15$test = new pts_config();16$test->read_bool_config("auto_save_results", "FALSE");17$test = new pts_config();18$test->read_bool_config("auto_save_results", "TRUE");

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1require_once('pts_config.php');2$conf_obj = new pts_config();3$conf_obj->read_bool_config('bool_option');4require_once('pts_config.php');5$conf_obj = new pts_config();6$conf_obj->read_int_config('int_option');7require_once('pts_config.php');8$conf_obj = new pts_config();9$conf_obj->read_float_config('float_option');10require_once('pts_config.php');11$conf_obj = new pts_config();12$conf_obj->read_string_config('string_option');13require_once('pts_config.php');14$conf_obj = new pts_config();15$conf_obj->read_array_config('array_option');16require_once('pts_config.php');17$conf_obj = new pts_config();18$conf_obj->read_config('config_option');19require_once('pts_config.php');20$conf_obj = new pts_config();21$conf_obj->read_config('config_option');22require_once('pts_config.php');23$conf_obj = new pts_config();24$conf_obj->read_config('config_option');

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1require_once('pts-config.php');2$read_bool_config = pts_config::read_bool_config('CONFIG_NAME');3if($read_bool_config)4{5echo 'CONFIG_NAME is set to true';6}7{8echo 'CONFIG_NAME is set to false';9}10require_once('pts-config.php');11$read_bool_config = pts_config::read_bool_config('CONFIG_NAME');12if($read_bool_config)13{14echo 'CONFIG_NAME is set to true';15}16{17echo 'CONFIG_NAME is set to false';18}19require_once('pts-config.php');20$read_bool_config = pts_config::read_bool_config('CONFIG_NAME');21if($read_bool_config)22{23echo 'CONFIG_NAME is set to true';24}25{26echo 'CONFIG_NAME is set to false';27}28require_once('pts-config.php');29$read_bool_config = pts_config::read_bool_config('CONFIG_NAME');30if($read_bool_config)31{32echo 'CONFIG_NAME is set to true';33}34{35echo 'CONFIG_NAME is set to false';36}37require_once('pts-config.php');38$read_bool_config = pts_config::read_bool_config('CONFIG_NAME');39if($read_bool_config)40{41echo 'CONFIG_NAME is set to true';42}43{44echo 'CONFIG_NAME is set to false';45}46require_once('pts-config.php');47$read_bool_config = pts_config::read_bool_config('CONFIG_NAME');48if($read_bool_config)49{50echo 'CONFIG_NAME is set to true';51}52{

Full Screen

Full Screen

read_bool_config

Using AI Code Generation

copy

Full Screen

1$read_bool_config = $config->read_bool_config('bool_var');2echo $read_bool_config;3$read_array_config = $config->read_array_config('array_var');4echo $read_array_config;5$read_config = $config->read_config('array_var');6echo $read_config;7$array_var = array(5,6,7,8);8$config->write_config('array_var', $array_var);9$config->write_config('bool_var', 0);10$config->write_config('string_var', 'string value');11$config->write_config('int_var', 10);

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 read_bool_config code on LambdaTest Cloud Grid

Execute automation tests with read_bool_config 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