Revision 99036060

b/man/gnt-debug.sgml
146 146
      <cmdsynopsis>
147 147
        <command>submit-job</command>
148 148

  
149
        <arg choice="req">opcodes_file</arg>
149
        <arg choice="req" rep="repeat">opcodes_file</arg>
150 150
      </cmdsynopsis>
151 151

  
152 152
      <para>
153
        This command builds a list of opcodes from a JSON-format file
154
        and submits them as a single job to the master daemon. It can
153
        This command builds a list of opcodes from JSON-format files
154
        and submits for each file a job to the master daemon. It can
155 155
        be used to test some options that are not available via the
156 156
        command line.
157 157
      </para>
b/scripts/gnt-debug
71 71

  
72 72
  """
73 73
  cl = cli.GetClient()
74
  fname = args[0]
75
  op_data = simplejson.loads(open(fname).read())
76
  op_list = [opcodes.OpCode.LoadOpCode(val) for val in op_data]
77
  jid = cli.SendJob(op_list, cl=cl)
78
  ToStdout("Job id: %s", jid)
79
  cli.PollJob(jid, cl=cl)
74
  job_data = []
75
  job_ids = []
76
  for fname in args:
77
    op_data = simplejson.loads(open(fname).read())
78
    op_list = [opcodes.OpCode.LoadOpCode(val) for val in op_data]
79
    job_data.append((fname, op_list))
80
  for fname, op_list in job_data:
81
    jid = cli.SendJob(op_list, cl=cl)
82
    ToStdout("File '%s', job id: %s", fname, jid)
83
    job_ids.append(jid)
84
  for jid in job_ids:
85
    ToStdout("Waiting for job id %s", jid)
86
    cli.PollJob(jid, cl=cl)
80 87
  return 0
81 88

  
82 89

  
......
139 146
                         help="Select nodes to sleep on"),
140 147
             ],
141 148
            "[opts...] <duration>", "Executes a TestDelay OpCode"),
142
  'submit-job': (GenericOpCodes, ARGS_ONE,
149
  'submit-job': (GenericOpCodes, ARGS_ATLEAST(1),
143 150
                 [DEBUG_OPT,
144 151
                  ],
145
                 "<op_list_file>", "Submits a job built from a json-file"
146
                 " with a list of serialized opcodes"),
152
                 "<op_list_file...>", "Submits jobs built from json files"
153
                 " containing a list of serialized opcodes"),
147 154
  'allocator': (TestAllocator, ARGS_ONE,
148 155
                [DEBUG_OPT,
149 156
                 make_option("--dir", dest="direction",

Also available in: Unified diff