if __name__ == '__main__':
    """Under video mode, video worker can record relative data and put the data into specified dir"""

    #####################<prerequisites>########################
    # caller pass the workdir pathname,test conf by commandline args
    workdir = sys.argv[1]
    conf = eval(sys.argv[2])
    os.chdir(workdir)

    # load TestModules
    sys.path.append(conf["test_lib_dir"])
    import interact

    # prepare files for vpn dp
    interact.prepare_file(conf, 'vpn')
    interact.prepare_file(conf, 'dp')

    # login to vpn,dp
    ssh_vpn_proc = pexpect.spawn("ssh %s" % (conf['vpns']['1st']['ssh']))
    interact.wait_server(conf, ssh_vpn_proc, 'vpn')
    ssh_dp_proc = pexpect.spawn("ssh %s" % (conf['dps']['1st']['ssh']))
    interact.wait_server(conf, ssh_dp_proc, 'dp')
    # if ./TestBench/ not exist on vpn&dp,then create it
    ssh_vpn_proc.sendline("if [ ! -d 'TestBench'  ];then mkdir TestBench;fi;cd TestBench")
    interact.wait_server(conf, ssh_vpn_proc, 'vpn')
    ssh_dp_proc.sendline("if [ ! -d 'TestBench'  ];then mkdir TestBench;fi;cd TestBench")
    interact.wait_server(conf, ssh_dp_proc, 'dp')
    # transmit scripts to vpn,dp
    newbash_proc = pexpect.spawn('bash')
    newbash_proc.sendline(
if __name__ == '__main__':
    DESCSTR="""When upload module detect that video worker havent generate data file for a while,and which is unexpected,It will add a event log."""

    #####################<prerequisites>########################
    # caller pass the WORKDIR pathname,test CONF by commandline args
    WORKDIR = sys.argv[1]
    CONF = eval(sys.argv[2])
    os.chdir(WORKDIR)

    # load TestModules
    sys.path.append(CONF["test_lib_dir"])
    import interact

    # prepare files for vpn dp
    interact.prepare_file(CONF, 'vpn')
    interact.prepare_file(CONF, 'dp')

    # login to vpn,dp
    ssh_vpn_proc = pexpect.spawn("ssh %s" % (CONF['vpns']['1st']['ssh']))
    interact.wait_server(CONF, ssh_vpn_proc, 'vpn')
    ssh_dp_proc = pexpect.spawn("ssh %s" % (CONF['dps']['1st']['ssh']))
    interact.wait_server(CONF, ssh_dp_proc, 'dp')
    # if ./TestBench/ not exist on vpn&dp,then create it
    ssh_vpn_proc.sendline("if [ ! -d 'TestBench'  ];then mkdir TestBench;fi;cd TestBench")
    interact.wait_server(CONF, ssh_vpn_proc, 'vpn')
    ssh_dp_proc.sendline("if [ ! -d 'TestBench'  ];then mkdir TestBench;fi;cd TestBench")
    interact.wait_server(CONF, ssh_dp_proc, 'dp')
    # transmit scripts to vpn,dp
    newbash_proc = pexpect.spawn('bash')
    newbash_proc.sendline(