def run (self): while not self.navel._terminate: i= select ([self.socket],[],[], 5)[0] if len (i)>0: (data, client)= self.socket.recvfrom (1024) debugPrint (1, '%s shouted %s!' % (client, data)) self.socket.sendto (csvPrettyPrint ([self.navel.params ()]), client) else: self.debug (5, 'chal timeout!') self.socket.close () self.debug (1, 'finished')
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 ()
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()
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 ()
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()
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 # server.multithreaded= 1; server.main () server.saveLog ()