[Openvas-commits] r3421 - in trunk/openvas-manager: . src/tests

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue May 19 12:06:47 CEST 2009


Author: mattm
Date: 2009-05-19 12:06:42 +0200 (Tue, 19 May 2009)
New Revision: 3421

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/tests/omp_delete_task_2.c
Log:
	* src/tests/omp_delete_task_2.c: Add check of whether removal has been
	requested.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog	2009-05-19 10:05:50 UTC (rev 3420)
+++ trunk/openvas-manager/ChangeLog	2009-05-19 10:06:42 UTC (rev 3421)
@@ -1,5 +1,10 @@
 2009-05-18  Matthew Mundell <mmundell at intevation.de>
 
+	* src/tests/omp_delete_task_2.c: Add check of whether removal has been
+	requested.
+
+2009-05-18  Matthew Mundell <mmundell at intevation.de>
+
 	* src/manage.c (create_report_file): Use stored start time.
 
 2009-05-18  Matthew Mundell <mmundell at intevation.de>
@@ -10,7 +15,7 @@
 
 2009-05-18  Matthew Mundell <mmundell at intevation.de>
 
-	Bring FS base tasks up to date.
+	Bring FS based tasks up to date.
 
 	* src/tasks_sql.h (init_manage_process): New function, was init_manage.
 	(init_manage): Move body to init_manage_process.  Replace with placeholder

Modified: trunk/openvas-manager/src/tests/omp_delete_task_2.c
===================================================================
--- trunk/openvas-manager/src/tests/omp_delete_task_2.c	2009-05-19 10:05:50 UTC (rev 3420)
+++ trunk/openvas-manager/src/tests/omp_delete_task_2.c	2009-05-19 10:06:42 UTC (rev 3421)
@@ -120,14 +120,31 @@
 
   status = entity_child (entity, "status");
   if (status == NULL
-      || strcmp (entity_name (entity), "status_response")
-      || strcmp (entity_text (status), "407"))
+      || strcmp (entity_name (entity), "status_response"))
     {
       free_entity (entity);
       close_manager_connection (socket, session);
       return EXIT_FAILURE;
     }
+  if (strcmp (entity_text (status), "407"))
+    {
+      const char* status_text = task_status (entity);
 
+      /* It may be that the server is still busy stopping the task. */
+      if (status_text && strcmp (status_text, "Delete requested"))
+        {
+          free_entity (entity);
+          close_manager_connection (socket, session);
+          return EXIT_SUCCESS;
+        }
+      else
+        {
+          free_entity (entity);
+          close_manager_connection (socket, session);
+          return EXIT_FAILURE;
+        }
+    }
+
   free_entity (entity);
   close_manager_connection (socket, session);
   return EXIT_SUCCESS;



More information about the Openvas-commits mailing list