def open_session_cdr(params, topology): params.session_mgr = session_mgr = cafe.get_session_manager() #----------------------------------------------------------------------------------------------------- # CD Router SSH # print(topology['nodes']['cdrouter']['session_profile']['buddyweb']['ssh']) params['cdr_profile'] = topology['nodes']['cdrouter']['session_profile'][ 'buddyweb']['ssh'] params['cdr_session'] = CdrApiClass(params.session_mgr.create_session( "cdr", 'ssh', **params['cdr_profile']), eq_type="cdr") # print(params['cdr_profile']) params['cdr_session'].login() cdr = params['cdr_session']
def xconn_demo_test_suite(): # Initialize logging init_logging() # Start session manager # sm = cafe.get_session_manager() # Obtain test suite parameter file information # params = cafe.get_test_param() # params.reset() # cafe.load_ts_config(cafe.get_cfs().abspath("params/ts_xconn_demo_parms.ini")) params = cafe.Param({}) # TODO Modify to take filename directly from cafe config file params.load_ini("params/ts_xconn_demo_parms.ini") print("params : ", params) # Test bed topology information imported here topology = cafe.get_topology() # print("topo file : ",params['Topology']) topology.load(params.topology.file) # Start session manager params.session_mgr = session_mgr = cafe.get_session_manager() # Open Sessions Needed for Test Suite open_sessions(params, topology) # Register Test cases # cafe.register_test_case(e7gui_test_case, args=[params]) cafe.register_test_case(e7guifailure_test_case, args=[params]) # cafe.register_test_case(ixveriwave_test_case, args=[params]) # cafe.register_test_case(ixveriwave_buildfile, args=[params]) # cafe.register_test_case(e7_test_case, args=[dut2]) # Execute test cases cafe.run_test_cases() # Close Sessions Needed for Test Suite close_sessions(params, topology)
def open_sessions(params, topology): """ Description: Open sessions required for test suite. Args: params(dict) : Dictionary of test suite instance parameters topology(dict) : Dictionary of test suite equipment topology information Returns: """ # TODO: Convert over to using Cafe provided parameter usage # TODO: Need to extract returns from calls to verify success # Start session manager params.session_mgr = session_mgr = cafe.get_session_manager() # Open E7 Session(s) - opens sessions to all E7 DUTs in parameter file e7_nodename = params['e7']['e7'] params['e7']['e7_profile'] = topology['nodes'][e7_nodename][ 'session_profile']['mgmt_vlan']['telnet'] params['e7']['e7_session'] = E7ApiClass(params.session_mgr.create_session( e7_nodename, 'telnet', **params['e7']['e7_profile']), eq_type="e7") params['e7']['e7_session'].login()
def open_sessions(params, topology): """ Description: Open sessions required for test suite. Args: params(dict) : Dictionary of test suite instance parameters topology(dict) : Dictionary of test suite equipment topology information Returns: """ # TODO: Convert over to using Cafe provided parameter usage # TODO: Need to extract returns from calls to verify success # Start session manager params.session_mgr = session_mgr = cafe.get_session_manager() # Open E7 Session(s) - opens sessions to all E7 DUTs in parameter file e7_nodename = params['e7']['e7'] params['e7']['e7_profile'] = topology['nodes'][e7_nodename][ 'session_profile']['mgmt_vlan']['telnet'] params['e7']['e7_session'] = E7ApiClass(params.session_mgr.create_session( e7_nodename, 'telnet', **params['e7']['e7_profile']), eq_type="e7") params['e7']['e7_session'].login() # Open ONT GUI Session(s) params['ontgui']['ontgui_session'] = ONTGuiApiClass(sid="ONTMgmt") params['ontgui']['ontgui_session'].login(ontip=params.ontgui.ontgui, username="******", password="******") # Open remote TCL shell session to IxVeriwave Managing PC # TODO: Look at reducing timeout to low value params['ixvw']['ixvwpcsession'] = TCLRemoteShell( winhost=params['ixvw']['ixvwpcip'], winuser=params['ixvw']['ixvwpclogin'], winpassword=params['ixvw']['ixvwpcpassword'], timeout=300, tcl_shell="tclsh.exe") params['ixvw']['ixvwpcsession'].login()
# Load config.ini file when not executing from command prompt - default location for written test suites if not cafe.executing_in_runner(): # Get runner config file cafe.load_config_file("config/config.ini") params = cafe.Param({}) params.load_ini("params/cdrouter.ini") # print("params : ", params) # Test bed topology information imported here topology = cafe.get_topology() topology.load(params.topology.file) #print("topology : ", topology) params.session_mgr = session_mgr = cafe.get_session_manager() open_session_xc(params, topology) open_session_e7(params, topology) open_session_cdr(params, topology) # dev_type == ONT/Location_(multi|cdr) # eut == ONT Model (813G|844G|854G|etc...) # scenario == IPv6 SVC Model/Index (ds-1|dsl-1|6rd-1) # cdr_test == IPv6 SVC Model/Index (ds-1|dsl-1|6rd-1)_subIdx # dbglvl == (info|dbg|etc...) # Note: etc... is yet to be determined when specified