def __init__(self, test_case, test_env, timeout=45, log_path=TCActionBase.LOG_PATH): TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path) self.send_len = 1460 self.server_port = random.randint(10000, 50000) self.server_port_2 = random.randint(10000, 50000) self.server_echo = True self.test_time = 12 * 60 self.sta_number = 3 self.send_delay = 50 # load param from excel cmd_set = test_case["cmd set"] for i in range(1, len(cmd_set)): if cmd_set[i][0] != "dummy": cmd_string = "self." + cmd_set[i][0] exec cmd_string self.result_cntx = TCActionBase.ResultCheckContext( self, test_env, self.tc_name) pass
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH): TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path) # load param from excel cmd_set = test_case["cmd set"] for i in range(1, len(cmd_set)): if cmd_set[i][0] != "dummy": cmd_string = "self." + cmd_set[i][0] exec cmd_string self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name) pass
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH): TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path) self.performance_folder_path = log_path # default value for optional configurable params self.test_method = ["ssid_hidden", "ssid_broadcast"] self.bssid = "ff:ff:ff:ff:ff:ff" self.ht_ap = dict( zip(HT, [("<ht20_ap_ssid>", "<ht20_ap_password>"), ("<ht40_ap_ssid>", "<ht40_ap_password>")])) self.ap_channel = {"ht20": 1, "ht40": 1} self.delay_time = 3 # default 3s, wait for scan done # load param from excel cmd_set = test_case["cmd set"] for i in range(1, len(cmd_set)): if cmd_set[i][0] != "dummy" and cmd_set[i][0] != "": cmd_string = "self." + cmd_set[i][0] exec cmd_string folder_path = MakeFolder.make_folder(self.performance_folder_path + "\\" + LOG_FOLDER) file_name = "SmartConfig_log_%s.log" % (time.strftime( "%m%d%H%M%S", time.localtime())) self._performance_log_file = os.path.join(folder_path, file_name) # type self.target_type = [ "SSC" if test_env.get_port_by_name("AT1") is None else "AT" ] self.target_type.append( "SSC" if test_env.get_port_by_name("AT2") is None else "AT") # test statistics # better ways to create? _test_stat = dict.fromkeys(TEST_STAT, 0) _test_method = dict.fromkeys(TEST_METHOD) _test_ht = dict.fromkeys(HT) self.test_stat = dict.fromkeys(SMART_TYPE) for i in SMART_TYPE: self.test_stat[i] = copy.deepcopy(_test_ht) for j in HT: self.test_stat[i][j] = copy.deepcopy(_test_method) for k in TEST_METHOD: self.test_stat[i][j][k] = copy.deepcopy(_test_stat) self.result_cntx = TCActionBase.ResultCheckContext( self, test_env, self.tc_name) pass
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH): TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path) # default value for optional configurable params self.performance_folder_path = log_path self.pwd_len = [8, 64] self.step_config = [0x03, 0x01, 0x02, 0x0B, 0x0F] self.join_test_method = ["Normal"] self.join_delay = [[1.5, 5], [1.5, 5]] self.reconnect_test_method = ["OFF_ON"] self.reconnect_delay = [[1.5, 5], [1.5, 6]] # load param from excel cmd_set = test_case["cmd set"] for i in range(1, len(cmd_set)): if cmd_set[i][0] != "dummy" and cmd_set[i][0] != "": cmd_string = "self." + cmd_set[i][0] exec cmd_string # read AP list self.ap_list = [] for i in range(1, len(cmd_set)): for j in range(len(cmd_set[i][1])): if cmd_set[i][1][j] != "": cmd_string = "self.ap_list.append(dict(zip(AP_PROP, " + cmd_set[ i][1][j] + ")))" exec cmd_string folder_path = MakeFolder.make_folder(self.performance_folder_path + "\\" + LOG_FOLDER) file_name = "JAP_log_%s.log" % (time.strftime("%m%d%H%M%S", time.localtime())) self._performance_log_file = os.path.join(folder_path, file_name) # test statistics self._succeed_count = self._fail_count = self._time_cost_count = 0 self._total_time = self._longest_time = 0 self.result_cntx = TCActionBase.ResultCheckContext( self, test_env, self.tc_name) # get target type "SSC" or "AT" self.target_type = [ "SSC" if test_env.get_port_by_name("AT1") is None else "AT" ] self.target_type.append( "SSC" if test_env.get_port_by_name("AT2") is None else "AT") self._utility = WifiConnUtility.WifiConnUtility(self) pass
def __init__(self, test_case, test_env, timeout, log_path): PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env, timeout, log_path) self.interval_list = [] self.deviation = 0 # load param from excel cmd_set = test_case["cmd set"] for i in range(1, len(cmd_set)): if cmd_set[i][0] != "dummy": cmd_string = "self." + cmd_set[i][0] exec cmd_string self.result_cntx = TCActionBase.ResultCheckContext( self, test_env, self.tc_name) pass
def __init__(self, test_case, test_env, cmd_set, timeout=30, log_path=TCActionBase.LOG_PATH): PerformanceTCBase.PerformanceTCBase.__init__(self, test_case, test_env, cmd_set=cmd_set, timeout=timeout, log_path=log_path) self.case = cmd_set[1][0] self.test_timeout = 20 self.reset_reason = test_case['reset'] self.result_cntx = TCActionBase.ResultCheckContext( self, test_env, self.tc_name)
def __init__(self, test_case, test_env, timeout=30, log_path=TCActionBase.LOG_PATH): TCActionBase.CommonTCActionBase.__init__(self, test_case, test_env, timeout=timeout, log_path=log_path) self.att_test_list = range(60) self.performance_folder_path = log_path # load param from excel cmd_set = test_case["cmd set"] for i in range(1, len(cmd_set)): if cmd_set[i][0] != "dummy": cmd_string = "self." + cmd_set[i][0] exec cmd_string self.ap_list = self.get_parameter("shield_box_ap_list") self.performance = dict([(ap_prop["ssid"], Performance()) for ap_prop in self.ap_list]) # create log file folder_path = MakeFolder.make_folder(self.performance_folder_path + "\\" + LOG_FOLDER) self.performance_log = os.path.join(folder_path, "JAP_Att_%s.log" % time.strftime("%d%H%M%S", time.localtime())) self.result_cntx = TCActionBase.ResultCheckContext(self, test_env, self.tc_name) pass
def __init__(self, name, test_env, cmd_set, timeout=30, log_path=TCActionBase.LOG_PATH): PerformanceTCBase.PerformanceTCBase.__init__(self, name, test_env, cmd_set=cmd_set, timeout=timeout, log_path=log_path) self.test_case = None self.test_timeout = 20 # load param from excel for i in range(1, len(cmd_set)): if cmd_set[i][0] != "dummy": cmd_string = "self." + cmd_set[i][0] exec cmd_string self.result_cntx = TCActionBase.ResultCheckContext( self, test_env, self.tc_name) pass