summaryrefslogtreecommitdiffstats
path: root/provision-tests
diff options
context:
space:
mode:
authorHerman van Rink2016-02-11 22:31:53 (GMT)
committerHerman van Rink2016-02-11 22:31:53 (GMT)
commit9fa4808e2f50ce5246a077009fc650cb70180466 (patch)
tree2141787182e410e1ee32ba65e2729139c374ea96 /provision-tests
parent39672d5ce0c43581077ab60c22c45ea51a6dbaad (diff)
Issue #2666926 by helmo: Add a test to create a custom verify task for the hostmaster site and place it in the queue.
Diffstat (limited to 'provision-tests')
-rw-r--r--provision-tests/provision_tests.drush.inc38
1 files changed, 36 insertions, 2 deletions
diff --git a/provision-tests/provision_tests.drush.inc b/provision-tests/provision_tests.drush.inc
index 22c0b98..bbe592f 100644
--- a/provision-tests/provision_tests.drush.inc
+++ b/provision-tests/provision_tests.drush.inc
@@ -85,6 +85,8 @@ function drush_provision_tests_run() {
drush_die(dt("Cannot acquire lock on task queue after waiting :wait seconds. A longer wait time can be set with the --lock-wait option.", array(':wait' => $lock_wait)));
}
+ drush_provision_tests_add_custom_test_task();
+
drush_provision_tests_install_platform('drupal6');
drush_provision_tests_install_platform('drupal7');
@@ -391,8 +393,40 @@ function drush_provision_tests_migrate_site($site, $target) {
}
/**
+ * Create a custom verify task for the hostmaster site and place it in the queue.
+ */
+function drush_provision_tests_add_custom_test_task() {
+ drush_log(dt("Create a custom verify task for the hostmaster site and place it in the queue."), 'ok');
+
+ $node = new stdClass();
+
+ // Admin
+ $node->uid = 1;
+
+ $node->type = 'task';
+
+ // The site, platform or server node ID that is subject to the task.
+ // 10 usually is the node ID for the hostmaster site itself.
+ $node->rid = 10;
+
+ // Published status == 1
+ $node->status = 1;
+
+ $node->task_type = 'verify';
+
+ // Setting status to HOSTING_TASK_QUEUED == 0
+ $node->task_status = 0;
+
+ node_save($node);
+
+ drush_provision_tests_run_remaining_tasks(TRUE);
+
+ drush_log(dt("Finished running a custom verify task for the hostmaster site."), 'ok');
+}
+
+/**
* Run all remaining hosting tasks.
*/
-function drush_provision_tests_run_remaining_tasks() {
- provision_backend_invoke('@hostmaster', "hosting-tasks", array(), array('force' => TRUE));
+function drush_provision_tests_run_remaining_tasks($debug = FALSE) {
+ provision_backend_invoke('@hostmaster', "hosting-tasks", array(), array('force' => TRUE, 'debug' => $debug));
}