summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Larabel <michael@phx-laptop.(none)>2008-04-20 15:58:33 -0400
committerMichael Larabel <michael@phx-laptop.(none)>2008-04-20 15:58:33 -0400
commit4809b25227cbeaffbb3030e75e620982e1fad7e2 (patch)
treee95d87d7b09c68e6ebe2b562b13d1526d7a0c339
parent5bea4f26e9a701ca444600adc497b2a407631b58 (diff)
downloadphoronix-test-suite-upstream-4809b25227cbeaffbb3030e75e620982e1fad7e2.tar.gz
phoronix-test-suite-upstream-4809b25227cbeaffbb3030e75e620982e1fad7e2.tar.xz
phoronix-test-suite-upstream-4809b25227cbeaffbb3030e75e620982e1fad7e2.zip
Add log-in support for PTS Global accounts. Register for account at
global.phoronix-test-suite.com and then run "phoronix-test-suite login" to login information.
-rw-r--r--TODO1
-rwxr-xr-xphoronix-test-suite6
-rw-r--r--pts-core/functions/pts-functions.php2
-rw-r--r--pts-core/functions/pts-functions_config.php11
-rw-r--r--pts-core/pts-run-cmd.php16
5 files changed, 30 insertions, 6 deletions
diff --git a/TODO b/TODO
index 8a27538..894d3bd 100644
--- a/TODO
+++ b/TODO
@@ -7,7 +7,6 @@
- Choice of SH or PHP for all install scripts
- Use new (larger) Wav file for benchmarks... internal Phoronix WAV file used is copyrighted music. Current PTS One is too small for reliable results.
- Improved hardware detection (i.e. recognize multiple graphics cards)
-- Change all the echos to fwrite with using STDOUT or STDERR where relevant
- Support browsers aside from just Firefox launch. detect what's installed.
- "Optimization Tips"
- More MD5 checks in test scripts
diff --git a/phoronix-test-suite b/phoronix-test-suite
index 875a659..489390d 100755
--- a/phoronix-test-suite
+++ b/phoronix-test-suite
@@ -71,6 +71,9 @@ case "${task}" in
"initial-config")
php pts-core/pts-run-cmd.php INITIAL_CONFIG
;;
+"login")
+ php pts-core/pts-run-cmd.php LOGIN
+ ;;
*)
echo "\n================================="
echo "Phoronix Test Suite"
@@ -90,7 +93,8 @@ case "${task}" in
echo "list-saved-results: List all saved results"
echo "system-information: Dump detected software and hardware information detected by PTS"
echo "upload <Saved File>: Upload these results to be shared globally"
- echo "build-php: Build A Local Copy Of PHP For The Phoronix Test Suite"
+ echo "login: Enter in your PTS Global log-in information for uploading results"
+# echo "build-php: Build A Local Copy Of PHP For The Phoronix Test Suite"
echo "\n"
;;
esac
diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index 890c90a..dfec2ba 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -342,7 +342,7 @@ function pts_global_upload_result($result_file, $tags = "")
$Globalkey = pts_read_user_config("PhoronixTestSuite/GlobalDatabase/UploadKey", "");
$tags = rawurlencode(base64_encode($tags));
- return file_get_contents("http://www.phoronix-test-suite.com/global/user-upload.php?result_xml=$ToUpload&global_user=$GlobalUser&global_key=$Globalkey&tags=$tags"); // Rudimentary, but works
+ return @file_get_contents("http://www.phoronix-test-suite.com/global/user-upload.php?result_xml=$ToUpload&global_user=$GlobalUser&global_key=$Globalkey&tags=$tags"); // Rudimentary, but works
}
function pts_trim_double($double, $accuracy = 2)
{
diff --git a/pts-core/functions/pts-functions_config.php b/pts-core/functions/pts-functions_config.php
index 3f19e66..c770d51 100644
--- a/pts-core/functions/pts-functions_config.php
+++ b/pts-core/functions/pts-functions_config.php
@@ -2,7 +2,7 @@
// Phoronix Test Suite - User Config Functions
-function pts_user_config_init()
+function pts_user_config_init($UserName = NULL, $UploadKey = NULL)
{
if(!is_dir(PTS_USER_DIR))
mkdir(PTS_USER_DIR);
@@ -13,9 +13,14 @@ function pts_user_config_init()
$file = "";
$read_config = new tandem_XmlReader($file);
+ if($UserName == NULL)
+ $UserName = pts_read_user_config("PhoronixTestSuite/GlobalDatabase/UserName", "Default User", $read_config);
+ if($UploadKey == NULL)
+ $UploadKey = pts_read_user_config("PhoronixTestSuite/GlobalDatabase/UploadKey", "", $read_config);
+
$config = new tandem_XmlWriter();
- $config->addXmlObject("PhoronixTestSuite/GlobalDatabase/UserName", 0, pts_read_user_config("PhoronixTestSuite/GlobalDatabase/UserName", "Default User", $read_config));
- $config->addXmlObject("PhoronixTestSuite/GlobalDatabase/UploadKey", 0, pts_read_user_config("PhoronixTestSuite/GlobalDatabase/UploadKey", "", $read_config));
+ $config->addXmlObject("PhoronixTestSuite/GlobalDatabase/UserName", 0, $UserName);
+ $config->addXmlObject("PhoronixTestSuite/GlobalDatabase/UploadKey", 0, $UploadKey);
$config->addXmlObject("PhoronixTestSuite/Options/Results/Directory", 1, pts_read_user_config("PhoronixTestSuite/Options/Results/Directory", "~/pts-test-results/", $read_config));
diff --git a/pts-core/pts-run-cmd.php b/pts-core/pts-run-cmd.php
index fd92295..ac9980f 100644
--- a/pts-core/pts-run-cmd.php
+++ b/pts-core/pts-run-cmd.php
@@ -184,6 +184,22 @@ switch($COMMAND)
echo $var . " = " . $var_value . "\n";
echo "\n";
break;
+ case "LOGIN":
+ echo "\nIf you haven't already registered for your free PTS Global account, you can do so at http://global.phoronix-test-suite.com/\n\nOnce you have registered your account and clicked the link within the verification email, enter your log-in information below.\n\n";
+ echo "User-Name: ";
+ $username = trim(strtolower(fgets(STDIN)));
+ echo "Password: ";
+ $password = md5(trim(strtolower(fgets(STDIN))));
+ $uploadkey = @file_get_contents("http://www.phoronix-test-suite.com/global/account-verify.php?user_name=$username&user_md5_pass=$password");
+
+ if(!empty($uploadkey))
+ {
+ pts_user_config_init($username, $uploadkey);
+ echo "\nAccount: $uploadkey\nAccount information written to user-config.xml.\n\n";
+ }
+ else
+ echo "\nPTS Global Account Not Found.\n";
+ break;
case "REMOTE_COMPARISON":
echo "Now Use merge-results for remote comparison with integrated Global ID support.";
echo "merge-results <Saved File 1 OR Global ID> <Saved File 2 OR Global ID> <Save To>: Merge two saved result sets";