[Ocfs2-test-devel] [PATCH 06/11] ocfs2-test: changed to accept an alternate NIC to be used by the test.

Marcos E. Matsunaga Marcos.Matsunaga at oracle.com
Sat Jun 12 06:44:55 PDT 2010


Tristan,

See my comments inline

Regards,

Marcos Eduardo Matsunaga

Oracle USA
Linux Engineering

“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”


On 06/03/2010 11:19 PM, tristan wrote:
> Marcos Matsunaga wrote:
>> - Made some changes trying to prevent write_torture script from waiting
>>   indefinetely for the return from openmpi.
>>
>> Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga at oracle.com>
>> ---
>>  programs/write_torture/run_write_torture.py |   43
>> +++++++++++---------------
>>  programs/write_torture/write_torture.c      |   10 +++++-
>>  2 files changed, 26 insertions(+), 27 deletions(-)
>>
>> diff --git a/programs/write_torture/run_write_torture.py
>> b/programs/write_torture/run_write_torture.py
>> index aac64a6..6f4a7d0 100755
>> --- a/programs/write_torture/run_write_torture.py
>> +++ b/programs/write_torture/run_write_torture.py
>> @@ -54,6 +54,7 @@ Usage = '\n     %prog [-b|--blocksize] \
>>  [-c | --count count] \
>>  [-d | --directory directory] \
>>  [-f | --filename <filename>] \
>> +[-i | --if <Network Interface>] \
>>  [-l | --logfile logfile] \
>>  [-n | --nodelist nodelist] \
>>  [-p | --procs procs] \
>> @@ -95,6 +96,12 @@ if __name__=='__main__':
>>                  If specified, a single file will be used by \
>>                  instances of the test.')
>>  #
>> +        parser.add_option('-i',
>> +                '--if',
>> +                dest='interface',
>> +                type='string',
>> +                help='Network interface to be used by the test.')
>> +#
>>      parser.add_option('-l',          '--logfile',         
>> dest='logfile',
>> @@ -122,9 +129,7 @@ if __name__=='__main__':
>>      (options, args) = parser.parse_args()
>>      if len(args) != 0:
>>          o2tf.printlog('args left %s' % len(args), -             
>> logfile, -        0, -        '')
>> +              logfile, 0, '')
>>          parser.error('incorrect number of arguments')
>>  #
>>      if options.blocksize:
>> @@ -132,9 +137,7 @@ if __name__=='__main__':
>>          blockvalues = blocksize.split(',')
>>          if len(blockvalues) != 2:
>>              o2tf.printlog('Blocksize must be specified in format
>> xxx,yyy\n\n', -            logfile, -            0, -            '')
>> +            logfile, 0, '')
>>              parser.error('Invalid format.')
>>      else:
>>          parser.error('Blocksize parameter needs to be specified.')
>> @@ -142,16 +145,12 @@ if __name__=='__main__':
>>      if int(blockvalues[0]) < MINBLOCKSIZE or int(blockvalues[1]) >
>> MAXBLOCKSIZE:
>>          o2tf.printlog('Blocksize must be between %s and %s\n\n' %
>>          (MINBLOCKSIZE, MAXBLOCKSIZE), -        logfile, -        0,
>> -        '')
>> +        logfile, 0, '')
>>          parser.error('Invalid range.')
>>      if DEBUGON:
>>          o2tf.printlog('Blocksize range from %s to %s\n\n' %       
>> (str(blockvalues[0]), str(blockvalues[1])), -        logfile,
>> -        0, -        '')
>> +        logfile, 0, '')
>>  #
>>      if options.count:
>>          count = options.count
>> @@ -175,7 +174,8 @@ if __name__=='__main__':
>>              nodelist = nodelist.add(options.nodelist)
>>          else:
>>              nodelist = options.nodelist.split(',')
>> -
>> +#
>> +    interface = options.interface
>>  #
>>      if options.procs:
>>          procs = options.procs
>> @@ -190,23 +190,15 @@ else:
>>  #
>>  if DEBUGON:
>>      o2tf.printlog('run_write_torture: main - current directory %s' %
>> os.getcwd(),
>> -        logfile, -        0, -        '')
>> +        logfile, 0, '')
>>      o2tf.printlog('run_write_torture: main - cmd = %s' % cmd,
>> -        logfile, -        0, -        '')
>> +        logfile, 0, '')
>>      o2tf.printlog('run_write_torture: main - blocksize = %s' %
>> options.blocksize,
>> -        logfile, -        0, -        '')
>> +        logfile, 0, '')
>>  #
>>  for z in range(options.count):
>>      o2tf.printlog('run_write_torture: Running test# %s' % z, -   
>> logfile, -    0, -    '')
>> +    logfile, 0, '')
>>  #
>>      o2tf.OpenMPIInit(DEBUGON, options.nodelist, logfile, 'ssh')
>>      ret = o2tf.openmpi_run(DEBUGON, options.procs,
>> @@ -217,6 +209,7 @@ for z in range(options.count):
>>          os.path.join(options.directory, filename) ) ),         
>> options.nodelist,          'ssh',
>> +        options.interface,
>>          options.logfile,
>>          'WAIT')
>>      if not ret:
>> diff --git a/programs/write_torture/write_torture.c
>> b/programs/write_torture/write_torture.c
>> index de5abcf..7b93306 100644
>> --- a/programs/write_torture/write_torture.c
>> +++ b/programs/write_torture/write_torture.c
>> @@ -94,6 +94,9 @@ static int launch_child(char *fname, int
>> open_flags, int (*newmain)(void))
>>          mypid = getpid();
>>          srand(mypid);
>>          ret = newmain();
>> +        fprintf(stderr,
>> +            "%s: Error %d launch child \n", hostn, +            ret);
>>          exit(ret);
>>      }
>>      if (pid == -1) {
>> @@ -395,7 +398,7 @@ int main(int argc, char **argv)
>>      if (signal(SIGINT, signal_handler) == SIG_ERR) {
>>          fprintf(stderr, "%s: Couldn't setup parent signal handler!\n",
>>                  hostn);
>> -        return 1;
>> +        exit(1);
>
> It makes no sense here, we didn't fork any children yet.
Right.. I was just testing. This was not to be in the patch. I'll remove
the next. It didn't help anyway.
>
>>      }
>>  
>>      /* We don't care. Getting back a short write is just fine. */
>> @@ -486,5 +489,8 @@ kill_all:
>>          dprintf("%s: Killed children\n", hostn);
>>      }
>>  
>> -    return ret == -ECHILD ? ret : 0;
>> +    fprintf(stderr, "%s: kill_all %d \n", hostn, ret);
>> +    exit(0);
>
> Why we need to always return '0' from the binary? a 'none-zero' return
> from binary cause the openmpi waiting indefinitely?
I was just trying to see if openmpi would close, but it seems to be
waiting indefinitely. Need to do more tests. Removing this too.
>
>> +/*    return ret == -ECHILD ? ret : 0;
>> + */
>>  }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-test-devel/attachments/20100612/23d7cdc4/attachment.html 


More information about the Ocfs2-test-devel mailing list