still no jobs error
authorTamas Jung <tamasjung@gmail.com>
Wed, 5 Jan 2011 22:24:20 +0000 (23:24 +0100)
committerTamas Jung <tamasjung@gmail.com>
Wed, 5 Jan 2011 22:24:20 +0000 (23:24 +0100)
ext/arc_kill.cpp
ext/extconf.rb
lib/arc_client_r.rb
test/test_helper.rb
test/test_kill.rb

index 0f43583..f9aafdd 100644 (file)
@@ -83,16 +83,20 @@ int  arc_kill(int argc, char **argv) {
   if (timeout > 0)
     usercfg.Timeout(timeout);
 
-  if ((!joblist.empty() || !status.empty()) && jobs.empty() && clusters.empty())
+  if ((!joblist.empty() || !status.empty()) && jobs.empty() && clusters.empty()){
     all = true;
+    logger.msg(Arc::DEBUG, "Implicit all turned on");
+  }
 
   if (jobs.empty() && clusters.empty() && !all) {
     logger.msg(Arc::ERROR, "No jobs given");
     return 1;
   }
 
-  if (!jobs.empty() || all)
+  if (!jobs.empty() || all){
     usercfg.ClearSelectedServices();
+    logger.msg(Arc::DEBUG, "ClearSelectedServcies was invoked.");
+  }
 
   if (!clusters.empty()) {
     usercfg.ClearSelectedServices();
index cfa929f..3fba1ac 100644 (file)
@@ -26,8 +26,8 @@ end
   find_header "sigc++/slot.h", "#{prefix}/lib/sigc++-2.0/include"
 end
 
-
-
+#for debug info
+$CFLAGS << '-g'
 
 $LIBS << ' -larcclient -larccommon -larcdata2 -larcloader -larcmessage -lglibmm-2.4 -lsigc-2.0 -lxmlsec1-openssl -lxmlsec1'
 
index ce5dcf4..133b262 100644 (file)
@@ -44,7 +44,7 @@ class ArcClientR
   end
   
   def kill(the_args)
-    args = the_args.unshift
+    args = the_args.unshift##optparser cuts the first arg TODO
     args_pointer = ArcClientCWrapper::string_array_as_pointer(args)
     @wrapper.arc_kill(args.size, args_pointer)
   end
index 1548850..d03ee6c 100644 (file)
@@ -30,3 +30,33 @@ UNAME_JSDL = <<-EO_XML
   </JobDescription>
 </JobDefinition>
 EO_XML
+
+SLEEP_JSDL = <<-EO_XML
+<?xml version="1.0" encoding="UTF-8"?>
+<JobDefinition
+  xmlns="http://schemas.ggf.org/jsdl/2005/11/jsdl"
+  xmlns:posix="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix"
+  xmlns:arc="http://www.nordugrid.org/ws/schemas/jsdl-arc">
+  <JobDescription>
+    <JobIdentification>
+      <JobName>sleep</JobName>
+    </JobIdentification>
+    <Application>
+     <posix:POSIXApplication>
+        <posix:Executable>/bin/sleep</posix:Executable>
+             <posix:Argument>60</posix:Argument>
+        <posix:Output>out.txt</posix:Output>
+        <posix:Error>err.txt</posix:Error>
+      </posix:POSIXApplication>
+    </Application>
+    <DataStaging>
+      <FileName>out.txt</FileName>
+      <DeleteOnTermination>false</DeleteOnTermination>
+    </DataStaging>
+    <DataStaging>
+      <FileName>err.txt</FileName>
+      <DeleteOnTermination>false</DeleteOnTermination>
+    </DataStaging>
+  </JobDescription>
+</JobDefinition>
+EO_XML
index 0668215..1497117 100644 (file)
@@ -3,9 +3,19 @@ require 'arc_client_r'
 
 class TestGet < ::Test::Unit::TestCase
   
+  
+  
   def test_base
     arc_client = ArcClientR.new
-    result = arc_client.kill(["-j", "test_job_list.xml", "https://interop.grid.niif.hu:2010/arex-x509/218791288114550534117300"])
-    p result
+    #message, job_id = arc_client.submit(["-e", SLEEP_JSDL, "-j", "test_jobkill_list.xml"])
+    #p "job submitted: #{job_id}, message: #{message}"
+    
+    # delay = 45
+    # p "sleeping for #{delay} seconds"
+    # sleep delay
+    job_id = 'https://testce.grid.niif.hu:60000/arex/202691294184794230106886'
+    p 'waking and killing'
+    result = arc_client.kill(["-j", "test_jobkill_list.xml", job_id])
+    p "result #{result}"
   end
 end
\ No newline at end of file