Beispiel #1
0
def start_test(module):
    print fi.execute(
        "python %s.tac" % (
            os.path.join(fi.ROOT_DIRECTORY, 'fi', slash),
            dot
        )
    )
Beispiel #2
0
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")
Beispiel #3
0
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")
Beispiel #4
0
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)
Beispiel #5
0
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)
Beispiel #6
0
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)
Beispiel #7
0
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()
Beispiel #8
0
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()
Beispiel #9
0
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
    )
Beispiel #10
0
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)
Beispiel #11
0
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)
Beispiel #12
0
 def test_execute(self):
     self.assertEqual(
         fi.execute("echo 'eee'").strip(),
         'eee'
     )
Beispiel #13
0
def start_test(module):
    print fi.execute("python %s.tac" %
                     (os.path.join(fi.ROOT_DIRECTORY, 'fi', slash), dot))