def test_all_pipeline():
    global brother
    for plid in range(7, 14):
        print "RUN PIPELINE", plid
        mario_run(plid)
        print "mario_run has returned"

        while (1 != libitat.mario_is_done(brother)):
            time.sleep(1)

        print "killing mario ..."
        libitat.kill_mario(brother)
        print "killed", plid
def mario_run():
    print brother
    libitat.initial(brother, 1, 'test_transfers', 0, 0)
    libitat.run_mario(brother, 0, 1)


def mario_pause():
    for i in range(0, 15):
        print "pause ", i
        libitat.pause_mario(brother)
        time.sleep(10)
        print "go on ", i
        libitat.go_on(brother)
        time.sleep(10)


# mario_thread = threading.Thread(target=mario_run)
# mario_thread.start()

#threading.Timer(30, mario_pause())

mario_run()
time.sleep(30)
mario_pause()

while (1 != libitat.mario_is_done(brother)):
    time.sleep(1)

libitat.kill_mario(brother)
print "killed"