gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r28273 - in gnunet-planetlab/gplmt: contrib/tasklists/plane


From: gnunet
Subject: [GNUnet-SVN] r28273 - in gnunet-planetlab/gplmt: contrib/tasklists/planetlab gplmt
Date: Tue, 23 Jul 2013 17:20:46 +0200

Author: wachs
Date: 2013-07-23 17:20:46 +0200 (Tue, 23 Jul 2013)
New Revision: 28273

Modified:
   
gnunet-planetlab/gplmt/contrib/tasklists/planetlab/planetlab_check_libgcrypt_version.xml
   gnunet-planetlab/gplmt/gplmt/Notifications.py
   gnunet-planetlab/gplmt/gplmt/Worker.py
Log:
fixed notifications


Modified: 
gnunet-planetlab/gplmt/contrib/tasklists/planetlab/planetlab_check_libgcrypt_version.xml
===================================================================
--- 
gnunet-planetlab/gplmt/contrib/tasklists/planetlab/planetlab_check_libgcrypt_version.xml
    2013-07-23 14:35:37 UTC (rev 28272)
+++ 
gnunet-planetlab/gplmt/contrib/tasklists/planetlab/planetlab_check_libgcrypt_version.xml
    2013-07-23 15:20:46 UTC (rev 28273)
@@ -17,12 +17,12 @@
 
        <sequence name="Check libgcrypt version" enabled="true">
                <run id="91" name="Checking version">
-                   <command>libgcrypt-config --version | grep 1.5; echo 
$?</command> 
+                   <command>libgcrypt-config --version</command> 
                    <arguments></arguments> 
                    <timeout>0</timeout> 
                    <expected_return_code>0</expected_return_code>
-                   <expected_output></expected_output>
-                   <stop_on_fail>false</stop_on_fail>
+                   <expected_output>1.6.0-</expected_output>
+                   <stop_on_fail>true</stop_on_fail>
                </run>  
     </sequence>
 </tasklist>

Modified: gnunet-planetlab/gplmt/gplmt/Notifications.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Notifications.py       2013-07-23 14:35:37 UTC 
(rev 28272)
+++ gnunet-planetlab/gplmt/gplmt/Notifications.py       2013-07-23 15:20:46 UTC 
(rev 28273)
@@ -60,6 +60,7 @@
         
 class Task:
     def __init__ (self, task):
+        self.fail = True
         self.task = task
         self.msg = ""
         self.output = ""
@@ -137,24 +138,31 @@
                 if(tlLen > maxTasklistLen):
                     maxTasklistLen = tlLen
         # Sort output (success then fail)
-        self.node_results.node_results.sort(key=lambda x: not 
x.tasklists.tasklists[0].success)
+        #self.node_results.node_results.sort(key=lambda x: not 
x.tasklists.tasklists[0].success)
         # Print organized output
         for nres in self.node_results.node_results:            
             sys.stdout.write(nres.node.hostname)
             diff = maxNodeLen - len(nres.node.hostname)
             sys.stdout.write(' ' * diff + ' | ')
+            fail_in = ""
+            if (False == nres.connectSuccess):
+                print 'failed in: connecting: ' + nres.error_msg
+                return
             for tl in nres.tasklists.tasklists:
                 sys.stdout.write(tl.name)
                 diff = maxTasklistLen - len(tl.name)
                 sys.stdout.write(' ' * diff + ' | ')
-                print 'success' if (tl.success == Tasklist.Taskresult.success) 
else 'failed in: '
+                fail_in = ""
+                for t in nres.tasks:                    
+                    if (t.fail == True):
+                        fail_in = fail_in + " " +  t.task.name                 
+            print 'success' if (tl.success == Tasklist.Taskresult.success) 
else 'failed in: ' +fail_in 
             for t in nres.tasks:
+                
                 if (t.fail == True):
-                    print "\tFAIL: " + t.task.name + " with '" +t.msg+ "' and 
'" +t.output+ "'"
-                else:
-                    print "\tSUC " + t.task.name + " with '" +t.msg+ "' and '" 
+t.output+ "'"                     
-                 
-                
+                    print "\tFailed Task: '" + t.task.name + "' with '" 
+t.msg+ "' and '" + t.output.rstrip() + "'"
+                #else:
+                    #print "\tSuccessful Task: '" + t.task.name + "' with '" 
+t.msg+ "' and '" +t.output.rstrip()+ "'"                                 
         #    tsk_str = ""
         #    for t in nres.tasks:
         #        tsk_f = "[e]"
@@ -216,8 +224,10 @@
         for t in nodeObj.tasks:
             if t.task is task:
                 if (result != Tasklist.Taskresult.success):
+                    #print "\tTASK FAIL: Task '" + t.task.name + "' with '" 
+t.msg+ "' and '" +t.output+ "'"
                     t.finished (result, True, message, output)
                 else:
+                    #print "\tTASK SUC: Task '" + t.task.name + "' with '" 
+t.msg+ "' and '" +t.output+ "'"
                     t.finished (result, False, message, output)
         return         
 

Modified: gnunet-planetlab/gplmt/gplmt/Worker.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Worker.py      2013-07-23 14:35:37 UTC (rev 
28272)
+++ gnunet-planetlab/gplmt/gplmt/Worker.py      2013-07-23 15:20:46 UTC (rev 
28273)
@@ -242,6 +242,7 @@
         found = False
         try:
             output = subprocess.check_output(task.command + " " + 
task.arguments, shell=True)
+            output = output.rstrip()
         except subprocess.CalledProcessError as e:
             returncode = e.returncode
         except Exception as e:
@@ -253,8 +254,8 @@
                 if (task.expected_output in l):
                     found = True
             if (False == found):
-                return 
TaskExecutionResult(Tasks.Taskresult.return_value_did_not_match, "Expected 
return code " + str(task.expected_return_code) +" but got " +str(returncode) 
+"", output)        
-        return TaskExecutionResult(result, "succesful", output)                
+                return 
TaskExecutionResult(Tasks.Taskresult.return_value_did_not_match, "Expected 
output should contain '" + str(task.expected_output) +"' but got '" + output 
+"'", output)
+        return TaskExecutionResult(result, "successful", output)               
 
     def exec_put (self, task):
         raise NotImplementedError (inspect.stack()[0][3]) 
     def exec_get (self, task):
@@ -414,14 +415,14 @@
                     data = r[0].recv(4096)
                     if data:
                         got_data = True
-                        g_logger.log (self.node.hostname + " : " + data)
+                        g_logger.log (self.node.hostname + " : '" + data + "'")
                         output += data
                         stdout_data += data
                 if channel.recv_stderr_ready():
                     data = r[0].recv_stderr(4096)
                     if data:
                         got_data = True
-                        g_logger.log (self.node.hostname + " : " + data)
+                        g_logger.log (self.node.hostname + " : '" + data + 
"'")    
                         output += data
                         stderr_data += data
                 if not got_data:
@@ -436,7 +437,7 @@
                     #g_logger.log (stderr_data)
                     result = Tasks.Taskresult.return_value_did_not_match
                 else:
-                    g_logger.log (self.node.hostname + " : Task '"+ task.name 
+ "' completed after "+ str(time.time() - start_time) +" sec, exit code " 
+str(exit_status)+ " was as expected " + str(task.expected_return_code))        
    
+                    g_logger.log (self.node.hostname + " : Task '"+ task.name 
+ "' completed after "+ str(time.time() - start_time) +" sec, exit code " 
+str(exit_status)+ " was as expected " + str(task.expected_return_code))       
             if (task.expected_output != None):
                 output_contained = False
                 if (task.expected_output in stdout_data):




reply via email to

[Prev in Thread] Current Thread [Next in Thread]