Summary
Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Sun 9/5/10 11:56
Recent Commits
>
--git a/CHANGE-LOG b/CHANGE-LOG
index 9cb8b0e..20431bb 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -3,6 +3,7 @@ PHORONIX TEST SUITE CHANGE-LOG
Phoronix Test Suite (Git)
- phoromatic: Add phoromatic.clone-results option for cloning test results from a Phoromatic repository, when the clone option is enabled from the server side
+- phoromatic: Add phoromatic.system-schedule option for seeing the system's test schedule from the Phoromatic server
- pts: Drop MD5 hashes in the wine-* humus tests
Phoronix Test Suite 2.4.0
diff --git a/pts-core/library/pts-functions_basic.php b/pts-core/library/pts-functions_basic.php
index 00c005a..55bc7a8 100644
--- a/pts-core/library/pts-functions_basic.php
+++ b/pts-core/library/pts-functions_basic.php
@@ -144,6 +144,27 @@ function pts_trim_spaces($string)
return trim($string);
}
+function pts_parse_week_string($week_string, $delimiter = ' ')
+{
+ $return_array = array();
+
+ if($week_string[0] == 1)
+ array_push($return_array, 'S');
+ if($week_string[1] == 1)
+ array_push($return_array, 'M');
+ if($week_string[2] == 1)
+ array_push($return_array, 'T');
+ if($week_string[3] == 1)
+ array_push($return_array, 'W');
+ if($week_string[4] == 1)
+ array_push($return_array, 'TH');
+ if($week_string[5] == 1)
+ array_push($return_array, 'F');
+ if($week_string[6] == 1)
+ array_push($return_array, 'S');
+
+ return implode($delimiter, $return_array);
+}
function pts_version_comparable($old, $new)
{
// Checks if there's a major version difference between two strings, if so returns false.
diff --git a/pts-core/modules/phoromatic.php b/pts-core/modules/phoromatic.php
index 30fca60..9716239 100644
--- a/pts-core/modules/phoromatic.php
+++ b/pts-core/modules/phoromatic.php
@@ -27,6 +27,11 @@ define("M_PHOROMATIC_UPLOAD_TO_GLOBAL", "PhoronixTestSuite/Phoromatic/General/Up
define("M_PHOROMATIC_ARCHIVE_RESULTS_LOCALLY", "PhoronixTestSuite/Phoromatic/General/ArchiveResultsLocally");
define("M_PHOROMATIC_RUN_INSTALL_COMMAND", "PhoronixTestSuite/Phoromatic/General/RunInstallCommand");
+define("M_PHOROMATIC_SCHEDULE_TEST_TITLE", "PhoronixTestSuite/Phoromatic/Schedules/TestSchedule/Title");
+define("M_PHOROMATIC_SCHEDULE_TEST_DESCRIPTION", "PhoronixTestSuite/Phoromatic/Schedules/TestSchedule/Description");
+define("M_PHOROMATIC_SCHEDULE_TEST_ACTIVE_ON", "PhoronixTestSuite/Phoromatic/Schedules/TestSchedule/ActiveOn");
+define("M_PHOROMATIC_SCHEDULE_TEST_START", "PhoronixTestSuite/Phoromatic/Schedules/TestSchedule/RunAt");
+
define("M_PHOROMATIC_RESPONSE_IDLE", "idle");
define("M_PHOROMATIC_RESPONSE_EXIT", "exit");
define("M_PHOROMATIC_RESPONSE_RUN_TEST", "benchmark");
@@ -38,7 +43,7 @@ define("M_PHOROMATIC_RESPONSE_SETTING_DISABLED", "SETTING_DISABLED");
class phoromatic extends pts_module_interface
{
const module_name = "Phoromatic Client";
- const module_version = "0.2.0";
+ const module_version = "0.3.0";
const module_description = "The Phoromatic client is used for connecting to a Phoromatic server (Phoromatic.com or a locally run server) to facilitate the automatic running of tests, generally across multiple test nodes in a routine manner. For more details visit http://www.phoromatic.com/";
const module_author = "Phoronix Media";
@@ -88,7 +93,8 @@ class phoromatic extends pts_module_interface
"start" => "user_start",
"user_system_return" => "user_system_return",
"upload_results" => "upload_unscheduled_results",
- "clone_results" => "clone_results"
+ "clone_results" => "clone_results",
+ "system_schedule" => "system_schedule"
);
}
@@ -161,6 +167,39 @@ class phoromatic extends pts_module_interface
break;
}
}
+ public static function system_schedule()
+ {
+ if(!phoromatic::phoromatic_setup_module())
+ {
+ return false;
+ }
+
+ $server_response = phoromatic::upload_to_remote_server(array(
+ "r" => "system_schedule"
+ ));
+
+ $schedule_xml = new tandem_XmlReader($server_response);
+ $schedule_titles = $schedule_xml->getXmlArrayValues(M_PHOROMATIC_SCHEDULE_TEST_TITLE);
+ $schedule_description = $schedule_xml->getXmlArrayValues(M_PHOROMATIC_SCHEDULE_TEST_DESCRIPTION);
+ $schedule_active_on = $schedule_xml->getXmlArrayValues(M_PHOROMATIC_SCHEDULE_TEST_ACTIVE_ON);
+ $schedule_start_time = $schedule_xml->getXmlArrayValues(M_PHOROMATIC_SCHEDULE_TEST_START);
+
+ if(count($schedule_titles) == 0)
+ {
+ echo "\nNo test schedules for this system were found on Phoromatic.\n";
+ }
+ else
+ {
+ for($i = 0; $i < count($schedule_titles); $i++)
+ {
+ echo "\n" . $schedule_titles[$i] . ":\n";
+ echo "\t" . $schedule_description[$i] . "\n";
+ echo "\tRuns at " . $schedule_start_time[$i] . " on " . pts_parse_week_string($schedule_active_on[$i]) . ".\n";
+ }
+ }
+
+ echo "\n";
+ }
//
// Core Functions
<
Copyright © 2010 by Phoronix Media