Ejemplo n.º 1
0
def tearDown():
    ret = common.check_core()
    nose.tools.assert_equal(ret, 0)
    common.bfs_stop_all()
    print "stop nameserver, chunkserver and status is ok"
    
    '''
def test_nameserver_restart_normal():

    common.bfs_stop_all()

    cmd = "cd %s/nameserver0 && ./bin/nameserver 1>nlog 2>&1 &" % const.work_dir
    print time.strftime("%Y%m%d-%H%M%S") + " command: " + cmd
    ret = os.system(cmd)
    nose.tools.assert_equal(ret, 0)
    time.sleep(3)
    ret1 = common.check_process(type="nameserver")
    '''
def test_nameserver_start_conf_not_exist():

    common.bfs_stop_all()

    (ret, out,
     err) = common.runcmd("cd nameserver0 && mv bfs.flag bfs.flag.bak")
    assert (ret == 0)

    cmd = "cd %s/nameserver0 && ./bin/nameserver 1>nlog 2>&1 &" % const.work_dir
    print time.strftime("%Y%m%d-%H%M%S") + " command: " + cmd
    ret = os.system(cmd)
    nose.tools.assert_not_equal(ret, 0)
    time.sleep(3)
    ret1 = common.check_process(type="nameserver")
    nose.tools.assert_equal(ret1, 1)

    (ret, out,
     err) = common.runcmd("cd nameserver0 && mv bfs.flag.bak bfs.flag")
    assert (ret == 0)
def tearDown():
    ret = common.check_core()
    nose.tools.assert_equal(ret, 0)
    common.bfs_stop_all()
    print "stop nameserver, chunkserver and status is ok"
    '''