コード例 #1
0
ファイル: mm.py プロジェクト: StyXman/Trieste
def main ():
  debugPrint (1, "args: %s" % str(argv))
  (opts, args)= parseOpts ([
    Option ('b', 'broadcast-to', True, default=''),
    Option ('c', 'connect-to', True, default=''),
    Option ('n', 'column', True, default=0),
    Option ('p', 'port', True),
    Option ('s', 'simulated-values', default=0),
    Option ('l', 'log-file', True),
  ], argv[1:])

  debugPrint (1, 'parsed args: %s, left args: %s' % (
    ", ".join (
      map (
        lambda x: "%s: %s" % (x, opts[x].value),
        opts.keys ()
      ))
    , args))

  if opts['p'].asInteger ():
    debugPrint (1, 'using port %s' % opts['p'].asString ())
    localPort= opts['p'].asInteger ()
  else:
    debugPrint (1, 'using default port %d' % consts.umbiePort)
    localPort= consts.umbiePort
  serverUrl= opts['c'].asString ()
  net= opts['b'].asString ()
  column= opts['n'].asInteger ()
  simVals= opts['s'].asInteger ()

  hostName= getfqdn ()
  # hostName= 'tempest.fsl.org.ar'

  a= Navel ("umbie://%s:%d/" % (hostName, localPort), column, fileName=opts['l'].asString ())
  if not net:
    # keep old opts so tests can still be performed on one machine
    a.init ()
    if serverUrl:
      a.joinTo (serverUrl)
    else:
      # we're supposed to be alone
      a.createRing (simVals)
  else:
    a.init (net)
  a.run ()
  debugPrint (1, 'finished: saving log')
  a.saveLog ()
コード例 #2
0
ファイル: mm.py プロジェクト: Cloudxtreme/Trieste
def main():
    debugPrint(1, "args: %s" % str(argv))
    (opts, args) = parseOpts([
        Option('b', 'broadcast-to', True, default=''),
        Option('c', 'connect-to', True, default=''),
        Option('n', 'column', True, default=0),
        Option('p', 'port', True),
        Option('s', 'simulated-values', default=0),
        Option('l', 'log-file', True),
    ], argv[1:])

    debugPrint(
        1, 'parsed args: %s, left args: %s' %
        (", ".join(map(lambda x: "%s: %s" %
                       (x, opts[x].value), opts.keys())), args))

    if opts['p'].asInteger():
        debugPrint(1, 'using port %s' % opts['p'].asString())
        localPort = opts['p'].asInteger()
    else:
        debugPrint(1, 'using default port %d' % consts.umbiePort)
        localPort = consts.umbiePort
    serverUrl = opts['c'].asString()
    net = opts['b'].asString()
    column = opts['n'].asInteger()
    simVals = opts['s'].asInteger()

    hostName = getfqdn()
    # hostName= 'tempest.fsl.org.ar'

    a = Navel("umbie://%s:%d/" % (hostName, localPort),
              column,
              fileName=opts['l'].asString())
    if not net:
        # keep old opts so tests can still be performed on one machine
        a.init()
        if serverUrl:
            a.joinTo(serverUrl)
        else:
            # we're supposed to be alone
            a.createRing(simVals)
    else:
        a.init(net)
    a.run()
    debugPrint(1, 'finished: saving log')
    a.saveLog()
コード例 #3
0
ファイル: sm.py プロジェクト: StyXman/Trieste
def main ():
  (opts, args)= parseOpts ([
    Option ('a', 'append', False),
    Option ('b', 'broadcast-to', True, default=''),
    Option ('c', 'connect-to', True, default=''),
    Option ('n', 'column', True, default=0),
    Option ('p', 'port', True, default=consts.vicePort),
    Option ('s', 'space', True),
    Option ('d', 'data-dir', True, default='data'),
    Option ('l', 'log-file', True),
  ], argv[1:])

  debugPrint (1, 'parsed args: %s, left args: %s' % (
    ", ".join (
      map (
        lambda x: "%s: %s" % (x, opts[x].value),
        opts.keys ()
      ))
    , args))

  localPort= opts['p'].asInteger ()
  serverUrl= opts['c'].asString ()
  net= opts['b'].asString ()
  column= opts['n'].asInteger ()
  space= opts['s'].asInteger ()
  dataDir= opts['d'].asString ()
  append= opts['a'].asBoolean ()

  hostName= getfqdn ()
  # hostName= 'tempest.fsl.org.ar'

  a= Vice ("vice://%s:%d/" % (hostName, localPort), space=space, path=dataDir, fileName=opts['l'].asString ())
  if net:
    if not a.init (net=net):
      exit (1)
  else:
    # keep old opts so tests can still be performed on one machine
    a.init (url=serverUrl)

  a.run ()
  debugPrint (1, 'finished: saving log')
  a.saveLog ()
コード例 #4
0
def main():
    (opts, args) = parseOpts([
        Option('a', 'append', False),
        Option('b', 'broadcast-to', True, default=''),
        Option('c', 'connect-to', True, default=''),
        Option('n', 'column', True, default=0),
        Option('p', 'port', True, default=consts.vicePort),
        Option('s', 'space', True),
        Option('d', 'data-dir', True, default='data'),
        Option('l', 'log-file', True),
    ], argv[1:])

    debugPrint(
        1, 'parsed args: %s, left args: %s' %
        (", ".join(map(lambda x: "%s: %s" %
                       (x, opts[x].value), opts.keys())), args))

    localPort = opts['p'].asInteger()
    serverUrl = opts['c'].asString()
    net = opts['b'].asString()
    column = opts['n'].asInteger()
    space = opts['s'].asInteger()
    dataDir = opts['d'].asString()
    append = opts['a'].asBoolean()

    hostName = getfqdn()
    # hostName= 'tempest.fsl.org.ar'

    a = Vice("vice://%s:%d/" % (hostName, localPort),
             space=space,
             path=dataDir,
             fileName=opts['l'].asString())
    if net:
        if not a.init(net=net):
            exit(1)
    else:
        # keep old opts so tests can still be performed on one machine
        a.init(url=serverUrl)

    a.run()
    debugPrint(1, 'finished: saving log')
    a.saveLog()
コード例 #5
0
ファイル: virtue.py プロジェクト: Cloudxtreme/Trieste
        blocks+= fsstat[0]
        free+= fsstat[1]
        files+= fsstat[2]
      except:
        # don't count it
        pass

    ffree= consts.maxIno-files
    # f_blocks, f_bfree, f_bavail, f_files, f_ffree, f_namemax
    self.log ("sftats!")
    return (consts.fragmentSize, blocks, free, consts.maxIno, ffree, 255)

if __name__ == '__main__':
  (opts, args)= parseOpts ([
    Option ('b', 'broadcast-to', True, default=''),
    Option ('c', 'connect-to', True),
    Option ('l', 'log-file', True, default='virtue.log'),
  ], argv[1:])
  debugPrint (1, 'parsed args: %s, left args: %s' % (
    ", ".join (
      map (
        lambda x: "%s: %s" % (x, opts[x].value),
        opts.keys ()
      ))
    , args))

  net= opts['b'].asString ()
  url= opts['c'].asString ()

  server= Virtue (url, net, fileName=opts['l'].asString ())
  server.flags= 0