simpletestauto_server_testPatch
Definition
simpletestauto_server_testPatch($password, $nid)
simpletestauto_server.module, line 135
Description
XML-rpc handler used on testserver side. It receives request to test a patch. It adds test node id into queue and runs test_it.php script
Parameters
$password Password which is needed to authenticate that server sending the request is valid.
$nid Id of the node we wish to test.
Code
<?php
function simpletestauto_server_testPatch($password, $nid) {
global $base_url;
watchdog('test_it', "Test request for " . $nid, WATCHDOG_NOTICE);
$path = drupal_get_path('module', 'simpletestauto');
if (file_exists("$path/simpletestauto_settings.php")) {
require_once "$path/simpletestauto_settings.php";
}
if ( $password == sha1(variable_get('simpletestauto_server_pwd', ''))) {
$test_it_path = drupal_get_path('module', 'simpletestauto_server');
stq_add($nid);
exec($bins['phpExec'] . " $test_it_path/test_it.php > /dev/null &");
return TRUE;
}
else {
return "Error: Wrong simpletestauto server password please check your settings";
}
}
?> 