def start_test(module): print fi.execute( "python %s.tac" % ( os.path.join(fi.ROOT_DIRECTORY, 'fi', slash), dot ) )
def doLogs(action): if os.path.exists('logs'): print "Deleting logs directory..." fi.execute('rm -rf logs') if action == 'install': print "Creating logs directory..." fi.execute("mkdir logs")
def start(module): fi.execute("twistd -y %s.tac --pidfile=%s.pid --logfile=logs/%s" % ( os.path.join(fi.ROOT_DIRECTORY, 'fi', slash), module, module, )) pid = open(module + ".pid", 'r').read().strip() print "%s started with pid %s" % (module, pid)
def stop(module): pid_file = dot + ".pid" if not os.path.exists(pid_file): return pid = open(pid_file, 'r').read().strip() fi.execute("kill " + pid) print "%s killed with pid %s" % (dot, pid)
def start(module): fi.execute( "twistd -y %s.tac --pidfile=%s.pid --logfile=logs/%s" % ( os.path.join(fi.ROOT_DIRECTORY, 'fi', slash), module, module, ) ) pid = open(module + ".pid", 'r').read().strip() print "%s started with pid %s" % (module, pid)
def doDatabase(action): if os.path.exists(fi.model.DATABASE_PATH): print "Deleting old database..." fi.execute("rm -f " + fi.model.DATABASE_PATH) # Install if action == 'install': print "Creating tables..." fi.model.createDatabaseTables() fi.job.model.setup() fi.throttle.model.setup()
def stop(module): pid_file = dot + ".pid" if not os.path.exists(pid_file): return pid = open(pid_file, 'r').read().strip() fi.execute("kill " + pid) print "%s killed with pid %s" % ( dot, pid )
def doPathload(action): print "Setting up pathload..." BINARIES = ( "fi/throttle/pathload/pathload_rcv", "fi/throttle/pathload/pathload_snd", ) for filename in BINARIES: if os.path.exists(filename): os.remove(filename) if action == "install": fi.execute("cd fi/throttle/pathload/ && ./configure &> /dev/null && make &> /dev/null") if not all(map(os.path.exists, BINARIES)): print "Failed" exit(1)
def doPathload(action): print "Setting up pathload..." BINARIES = ( "fi/throttle/pathload/pathload_rcv", "fi/throttle/pathload/pathload_snd", ) for filename in BINARIES: if os.path.exists(filename): os.remove(filename) if action == "install": fi.execute( "cd fi/throttle/pathload/ && ./configure &> /dev/null && make &> /dev/null" ) if not all(map(os.path.exists, BINARIES)): print "Failed" exit(1)
def test_execute(self): self.assertEqual( fi.execute("echo 'eee'").strip(), 'eee' )
def start_test(module): print fi.execute("python %s.tac" % (os.path.join(fi.ROOT_DIRECTORY, 'fi', slash), dot))