Esempio n. 1
0
 def test_046_check_connection_m_time_function(self):
     u"""Connection Time单位选择m分钟,功能测试(testlink_ID:3202)"""
     log.debug("046")
     tmp = TimePolicyBusiness(self.driver)
     #断开无线网卡的连接
     tmp.disconnect_ap()
     #先修改ap的系统时间为01:00:00
     ssh = SSH(data_basic['DUT_ip'], data_login['all'])
     ssh.ssh_cmd(data_basic['sshUser'], "date -s 01:00:00")
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, u"时间策略1", "2", "23", "m")
     #进入网络组中选择客户端时间策略
     tmp1 = SSIDBusiness(self.driver)
     tmp1.change_client_time_policy_pagedown(1, u"时间策略1")
     #无线网卡连接
     tmp1.connect_DHCP_WPA_AP(data_wireless['all_ssid'],
         data_wireless['short_wpa'], data_basic['wlan_pc'])
     #等待3分钟
     time.sleep(240)
     #判断AP是否依然连接
     result1 = subprocess.check_output("iw dev %s link"%data_basic['wlan_pc'], shell=True)
     #释放无线网卡的ip
     tmp1.dhcp_release_wlan(data_basic['wlan_pc'])
     #获取禁止的客户端页面所有标题
     tmp2 = BannedClientsBusiness(self.driver)
     result2 = tmp2.get_bannedclients_title()
     wlan_mac = tmp2.get_wlan_mac(data_basic['wlan_pc']).upper()
     self.assertNotIn(data_wireless['all_ssid'], result1)
     self.assertIn(wlan_mac, result2),
     "check connection time function is min, test fail!"
     print "check connection time function is min, test pass!"
Esempio n. 2
0
 def test_008_check_enable_timepolicy(self):
     u"""Enable勾选(testlink_ID:3177)"""
     log.debug("008")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, u"时间策略1", "1", "1", "h")
     #判断页面上是否有Enable图标
     result = tmp.check_enbale_timepolicy()
     self.assertTrue(result), "check enable time policy, test fail!"
     print "check enable time policy, test pass!"
Esempio n. 3
0
 def test_004_check_name_length_1(self):
     u"""name字符长度等于1(testlink_ID:3173)"""
     log.debug("004")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, "a", "1", "1", "h")
     #判断页面上有新建的时间策略
     result = tmp.check_have_timepolicy()
     tmp.del_all_timepolicy()
     self.assertTrue(result), "check name's length is 1, test fail!"
     print "check name's length is 1, test pass!"
Esempio n. 4
0
 def test_028_check_timeout_daily_0_23(self):
     u"""Timeout Type选择Daily,填入0-23的数字(testlink_ID:3194)"""
     log.debug("028")
     tmp = TimePolicyBusiness(self.driver)
     #新建时间策略,输入相应的数据,检查页面上是否有提示
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, u"时间策略1", "1", "23", "h")
     #判断页面上有新建的时间策略
     result = tmp.check_have_timepolicy()
     self.assertTrue(result), "check timeout is hourly and input 0-23, test fail!"
     print "check timeout is hourly and input 0-23, test pass!"
Esempio n. 5
0
 def test_023_check_connection_time_d_99999999(self):
     u"""Connection Time选择m,填入数字1-99999999之间的数字-2(testlink_ID:3189-2)"""
     log.debug("023")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, u"时间策略1", "99999999", "1", "d")
     #判断页面上有新建的时间策略
     result = tmp.check_have_timepolicy()
     tmp.del_all_timepolicy()
     self.assertTrue(result), "check connection time is 99999999, test fail!"
     print "check connection time is 99999999, test pass!"
Esempio n. 6
0
 def test_006_check_name_chinese(self):
     u"""name为特殊字符或汉字(testlink_ID:3175)"""
     log.debug("006")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, u"时间策略1", "1", "1", "h")
     #判断页面上有新建的时间策略
     result = tmp.check_have_timepolicy()
     tmp.del_all_timepolicy()
     self.assertTrue(result), "check name is Chinese, test fail!"
     print "check name is Chinese, test pass!"
Esempio n. 7
0
 def test_005_check_name_length_32(self):
     u"""name字符长度等于1(testlink_ID:3174)"""
     log.debug("005")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, data_wireless['long_ssid'], "1", "1", "h")
     #判断页面上有新建的时间策略
     result = tmp.check_have_timepolicy()
     tmp.del_all_timepolicy()
     self.assertTrue(result), "check name's length is 32, test fail!"
     print "check name's length is 32, test pass!"
Esempio n. 8
0
 def test_025_check_timeout_hourly(self):
     u"""Timeout Type选择Reset Hourly(testlink_ID:3191)"""
     log.debug("025")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, u"时间策略1", "1", "1", "h")
     #编辑一个时间策略,修改客户端重连超时类型为每小时
     tmp.change_timeout_hourly(0)
     result = tmp.get_titlediv()
     tmp.del_all_timepolicy()
     self.assertIn(u"每小时", result), "check timeout is hourly, test fail!"
     print "check timeout is hourly, test pass!"
Esempio n. 9
0
 def test_007_check_same_name_policy(self):
     u"""添加两条相同name的策略(testlink_ID:3176)"""
     log.debug("007")
     tmp = TimePolicyBusiness(self.driver)
     #按照默认配置,新建一个时间策略
     tmp.new_timepolicy_default(0, "a", "1", "1", "h")
     #新建时间策略,输入相应的数据,检查页面上是否有提示
     result = tmp.check_new_timepolicy_tip(1, "a", "2", "2", u"此时间策略已经存在", "h")
     self.driver.refresh()
     self.driver.implicitly_wait(60)
     time.sleep(10)
     tmp.del_all_timepolicy()
     self.assertTrue(result), "check two same name time policys, test fail!"
     print "check two same name time policys, test pass!"