Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / teshsuite / msg / host_on_off_processes / host_on_off_processes.cpp
index fe7a2f2..8f278b2 100644 (file)
@@ -27,13 +27,9 @@ static int process_daemon(int /*argc*/, char** /*argv*/)
     msg_task_t task = MSG_task_create("daemon", MSG_host_get_speed(MSG_host_self()), 0, NULL);
     MSG_process_set_data(self, task);
     XBT_INFO("  Execute daemon");
-    msg_error_t res = MSG_task_execute(task);
+    MSG_task_execute(task);
     MSG_task_destroy(task);
     tasks_done++;
-    if (res == MSG_HOST_FAILURE) {
-      XBT_INFO("Host has died as expected, do nothing else");
-      return 0;
-    }
   }
   XBT_INFO("  daemon done. See you!");
   return 0;
@@ -61,7 +57,7 @@ static int commRX(int /*argc*/, char** /*argv*/)
   XBT_INFO("  Start RX");
   msg_error_t error = MSG_task_receive(&(task), mailbox);
   if (error == MSG_OK) {
-    XBT_INFO("  Receive message: %s", task->name);
+    XBT_INFO("  Receive message: %s", MSG_task_get_name(task));
     MSG_task_destroy(task);
   } else if (error == MSG_HOST_FAILURE) {
     XBT_INFO("  Receive message: HOST_FAILURE");
@@ -97,7 +93,7 @@ static int test_launcher(int /*argc*/, char** /*argv*/)
   }
 
   test = 2;
-  // Create a process that on a host that is turned off (this should not be possible)
+  // Create a process that on a host that is turned off (this is not allowed)
   if (xbt_dynar_search_or_negative(tests, &test) != -1) {
     XBT_INFO("Test 2:");
     XBT_INFO("  Turn off Jupiter");
@@ -108,17 +104,7 @@ static int test_launcher(int /*argc*/, char** /*argv*/)
     argvF[0] = xbt_strdup("process_daemon");
     MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, jupiter, 1, argvF);
     MSG_process_sleep(10);
-    XBT_INFO("  Test 2 does not crash as it should (number of Process : %d, it should be 1)", MSG_process_get_number());
-    XBT_INFO("  Ok so let's turn on/off the node to see whether the process is correctly bound to Jupiter");
-    MSG_host_on(jupiter);
-    XBT_INFO("  Turn off");
-    MSG_host_off(jupiter);
-    XBT_INFO("  sleep");
-    MSG_process_sleep(10);
-    XBT_INFO("number of Process : %d it should be 1. The daemon that has been created for test2 has been correctly "
-             "destroyed....ok at least it looks rigorous, cool ! You just have to disallow the possibility to create "
-             "a new process on a node when the node is off.)",
-             MSG_process_get_number());
+    XBT_INFO("  Test 2 does crash as it should. This message will not be displayed.");
   }
 
   test = 3;
@@ -170,7 +156,6 @@ static int test_launcher(int /*argc*/, char** /*argv*/)
   test = 6;
   if (xbt_dynar_search_or_negative(tests, &test) != -1) {
     XBT_INFO("Test 6: Turn on Jupiter, assign a VM on Jupiter, launch a process inside the VM, and turn off the node");
-    MSG_process_set_data_cleanup(nullptr); // If set for test 6, cleanup handler gives double-free errors.
 
     // Create VM0
     msg_vm_t vm0 = MSG_vm_create_core(jupiter, "vm0");