Exemplo n.º 1
0
 def test_007_Network_Administrator_add_ap(self):
     u"""网络管理员-能添加ap"""
     log.debug("007")
     tmp1 = NetworkListBusiness(self.s)
     #使用用户名密码,带着cookie登录cloud,并返回响应数据
     tmp1.webLogin(data_basic['cloud_user'], data_basic['cloud_pwd'])
     #获取默认网络组default的id
     networkid = tmp1.get_network_id("default")
     time.sleep(60)
     tmp = UserBusiness(self.s)
     #修改测试用户为网络管理员
     tmp.set_user_authority(data_basic['Cloud_test_user'], \
         data_basic['Cloud_test_email'], "Network Administrator", [networkid])
     time.sleep(60)
     #admin用户退出登录
     tmp.webLogout()
     #使用测试用户登录
     tmp2 = APSBusiness(self.s)
     tmp2.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd'])
     #添加ap-7610
     #将ap复位,并将ap的hosts替换,指向本地cloud,然后将该ap添加到cloud中
     tmp2.add_ap_2_local_cloud(data_basic['7610_ip'], data_ap['7610_mac'], "autotest_7610")
     #cloud上获取该网络组的ssh密码
     tmp3 = SettingsBusiness(self.s)
     ssh_pwd = tmp3.get_ssh_pwd()
     #判断ap是否已经和cloud配对上
     result = tmp2.check_ap_pair_cloud(data_basic['7610_ip'],
                 data_basic['sshUser'], ssh_pwd)
     self.assertTrue(result)
Exemplo n.º 2
0
 def test_015_check_change_ssid_client_count(self):
     u"""将client切换ssid,验证network-概览-client数量"""
     log.debug("015")
     #选择进入group1网络组
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group1")
     tmp2 = OverViewBusiness(self.s)
     #AP 上传流量统计的准确性
     tmp3 = APSBusiness(self.s)
     #新增一个network
     tmp = SSIDSBusiness(self.s)
     tmp.add_ssid(data_ap['7600_mac'],
                  data_wireless['grou1_all_ssid'] + "-2",
                  data_wireless['short_wpa'])
     time.sleep(60)
     tmp3.run_AP_download_back(data_wireless['grou1_all_ssid'] + "-2",
                               data_wireless['short_wpa'],
                               data_basic['wlan_pc'], data_basic['lan_pc'])
     time.sleep(360)
     #AP 上传流量统计的准确性
     result = tmp.connect_DHCP_WPA_AP(
         data_wireless['grou1_all_ssid'] + "-2", data_wireless['short_wpa'],
         data_basic['wlan_pc'])
     tmp.dhcp_release_wlan_backup(data_basic['wlan_pc'])
     result1 = tmp2.get_overview_client_count()
     self.assertIn(data_wireless['grou1_all_ssid'] + "-2", result)
     self.assertEqual(result1, 1)
Exemplo n.º 3
0
 def test_013_edit_ssid_name(self):
     u"""修改group2的ssid名称,避免客户端数量被干扰"""
     log.debug('013')
     #选择进入group1网络组
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group2")
     #修改ssid
     tmp = SSIDSBusiness(self.s)
     encry_dict = {
         'ssid_encryption': "3",
         'ssid_wpa_encryption': "0",
         'ssid_wpa_key_mode': "0",
         'ssid_wpa_key': data_wireless['short_wpa']
     }
     data_dict = {
         'membership_macs': "%s" % (data_ap['7600lr_mac'].upper()),
         'ssid_ssid': data_wireless['grou1_all_ssid'] + "3"
     }
     tmp.edit_ssid(data_ap['7600lr_mac'], 'GWN-Cloud', encry_dict,
                   data_dict)
     time.sleep(60)
     #AP 上传流量统计的准确性
     tmp2 = APSBusiness(self.s)
     tmp2.run_AP_download_back(data_wireless['grou1_all_ssid'] + "3",
                               data_wireless['short_wpa'],
                               data_basic['wlan_pc'], data_basic['lan_pc'])
     time.sleep(360)
     #等待5分钟
     result = tmp.connect_DHCP_WPA_AP(data_wireless['grou1_all_ssid'] + "3",
                                      data_wireless['short_wpa'],
                                      data_basic['wlan_pc'])
     tmp.dhcp_release_wlan_backup(data_basic['wlan_pc'])
     self.assertIn(data_wireless['grou1_all_ssid'] + "3", result)
Exemplo n.º 4
0
 def test_012_check_change_network_client_count(self):
     u"""修改group1下面ssid,使用无线client连接,并打流"""
     log.debug("012")
     #选择进入group1网络组
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group1")
     #修改ssid
     tmp = SSIDSBusiness(self.s)
     encry_dict = {
         'ssid_encryption': "3",
         'ssid_wpa_encryption': "0",
         'ssid_wpa_key_mode': "0",
         'ssid_wpa_key': data_wireless['short_wpa']
     }
     data_dict = {
         'membership_macs': "%s" % (data_ap['7600_mac'].upper()),
         'ssid_ssid': data_wireless['grou1_all_ssid']
     }
     tmp.edit_ssid(data_ap['7600_mac'], 'GWN-Cloud', encry_dict, data_dict)
     time.sleep(60)
     #AP 上传流量统计的准确性
     tmp2 = APSBusiness(self.s)
     tmp2.run_AP_download_back(data_wireless['grou1_all_ssid'],
                               data_wireless['short_wpa'],
                               data_basic['wlan_pc'], data_basic['lan_pc'])
     #等待5分钟
     result = tmp.connect_DHCP_WPA_AP(data_wireless['grou1_all_ssid'],
                                      data_wireless['short_wpa'],
                                      data_basic['wlan_pc'])
     time.sleep(360)
     tmp.dhcp_release_wlan_backup(data_basic['wlan_pc'])
     self.assertIn(data_wireless['grou1_all_ssid'], result)
Exemplo n.º 5
0
 def test_014_get_network_overview_client_count(self):
     u"""检查network-概览--client数量"""
     log.debug("014")
     tmp = OverViewBusiness(self.s)
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group1")
     result = tmp.get_overview_client_count()
     self.assertEqual(result, 1)
Exemplo n.º 6
0
 def test_043_check_network_list_name(self):
     u"""检查network list中network的名称"""
     log.debug("043")
     tmp = NetworkListBusiness(self.s)
     network_name = tmp.get_network_name()
     self.assertIn("default", network_name)
     self.assertIn("group1", network_name)
     self.assertIn("group2", network_name)
Exemplo n.º 7
0
 def test_039_check_network_2h_overview_top_ssids_usage(self):
     u"""验证group1最近两小时监控面板-概览-Top SSIDs的usage"""
     log.debug("039")
     tmp = OverViewBusiness(self.s)
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network('group1')
     usage = tmp.get_overview_top_ssids_usage("2h", menu=9)
     self.assertGreater(usage[0], usage[1])
Exemplo n.º 8
0
 def test_017_check_network_1d_overview_last_clientcount(self):
     u"""验证default network最近1天监控面板-概览-客户端数量,返回最后一条客户端在线数量"""
     log.debug("017")
     tmp = OverViewBusiness(self.s)
     #选择进入group1网络组
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group1")
     clientcount = tmp.get_overview_last_clientcount("1d", menu=9)
     self.assertEqual(clientcount, 1)
Exemplo n.º 9
0
 def test_005_check_network_overview(self):
     u"""获取某个network的AP总数"""
     log.debug("005")
     tmp = OverViewBusiness(self.s)
     #选择进入group1网络组
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group1")
     result = tmp.get_network_overview_ap_count()
     self.assertEqual(result, 1)
Exemplo n.º 10
0
 def test_049_check_network_country_timezone(self):
     u"""检查group2 network的国家代码和时区"""
     log.debug("049")
     tmp = NetworkListBusiness(self.s)
     id = tmp.get_network_id('group2')
     network_country, network_timezone = tmp.get_networkitem_country_timezone(
         id)
     self.assertEqual('US', network_country)
     self.assertEqual("Etc/GMT", network_timezone)
Exemplo n.º 11
0
 def test_047_check_default_network_country_timezone(self):
     u"""检查default network的国家代码和时区(默认"""
     log.debug("047")
     tmp = NetworkListBusiness(self.s)
     id = tmp.get_network_id('default')
     network_country, network_timezone = tmp.get_networkitem_country_timezone(
         id)
     self.assertEqual('US', network_country)
     self.assertEqual("Etc/GMT", network_timezone)
Exemplo n.º 12
0
 def test_052_check_group2_network_uesr(self):
     u"""检查group2 network的网络管理员"""
     log.debug("052")
     tmp = NetworkListBusiness(self.s)
     id = tmp.get_network_id('group1')
     count, user = tmp.get_networkitem_all_user(id)
     self.assertEqual(2, count)
     self.assertIn(data_basic['cloud_user'], user)
     self.assertIn(data_basic['Cloud_test_user'], user)
Exemplo n.º 13
0
 def test_006_check_network_ap_online_offline_count(self):
     u"""获取某个network概览-AP在线和离线数量"""
     log.debug("006")
     tmp = OverViewBusiness(self.s)
     #选择进入group1网络组
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group2")
     result, result1 = tmp.get_network_overview_ap_online_offline_count()
     self.assertEqual(result, 1)
     self.assertEqual(result1, 0)
Exemplo n.º 14
0
 def test_008_delete_newNetwork(self):
     u"""删除新建的网络组"""
     log.debug("008")
     #删除网络组group1
     tmp = NetworkListBusiness(self.s)
     tmp.delete_network("group1")
     time.sleep(60)
     #获取网络组对应的id--监控面板--网络列表
     network_id = tmp.get_network_id("group1")
     self.assertEqual(network_id, None)
Exemplo n.º 15
0
 def test_026_check_network_2h_overview_top_ap_mac(self):
     u"""验证最近两小时监控面板-概览-top ap的mac"""
     log.debug("026")
     tmp = OverViewBusiness(self.s)
     #选择进入group1网络组
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network("group1")
     ap_mac = tmp.get_overview_top_aps_mac("2h", menu=9)
     mac1 = data_ap['7600_mac'].upper()
     self.assertIn(mac1, ap_mac)
Exemplo n.º 16
0
 def test_041_check_network_2h_overview_top_ssids(self):
     u"""验证group1 network中最近两小时监控面板-概览-Top SSIDs ssid与netwrok之间的对应关系"""
     log.debug("041")
     tmp = OverViewBusiness(self.s)
     tmp1 = NetworkListBusiness(self.s)
     tmp1.goin_network('group1')
     network1 = tmp.get_overview_top_ssids_network(
         "2h", data_wireless['grou1_all_ssid'], menu=9)
     network2 = tmp.get_overview_top_ssids_network(
         "2h", data_wireless['grou1_all_ssid'] + "-2", menu=9)
     self.assertEqual(network1, 'group1')
     self.assertEqual(network2, 'group1')
Exemplo n.º 17
0
 def test_011_Network_Administrator_add_network(self):
     u"""网络管理员-不能添加网络组"""
     log.debug("011")
     #获取登录名对应的id
     tmp1 =UserBusiness(self.s)
     #使用测试用户登录
     tmp1.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd'])
     user_id = tmp1.get_network_id(data_basic['Cloud_test_user'])
     tmp = NetworkListBusiness(self.s)
     #添加网络组
     result = tmp.add_network("group1", user_id, "")
     self.assertFalse(result)
Exemplo n.º 18
0
 def test_002_newNetwork_add_ap(self):
     u"""新建的网络组添加ap"""
     log.debug("002")
     tmp = NetworkListBusiness(self.s)
     #选择进入group1网络组
     tmp.goin_network("group1")
     #将ap复位,并将ap的hosts替换,指向本地cloud,然后将该ap添加到cloud中
     tmp1 = APSBusiness(self.s)
     tmp1.add_ap_2_local_cloud(data_basic['7610_ip'], data_ap['7610_mac'], "autotest_7610")
     time.sleep(60)
     #获取ap列表ap的网络组名
     tmp2 = AllApListBusiness(self.s)
     network_name = tmp2.get_ap_info(data_ap['7610_mac'])['network']
     self.assertEqual(network_name, "group1")
Exemplo n.º 19
0
 def test_004_Platform_Administrator_add_network(self):
     u"""平台管理员-添加网络组"""
     log.debug("004")
     #获取登录名对应的id
     tmp1 =UserBusiness(self.s)
     #使用测试用户登录
     tmp1.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd'])
     user_id = tmp1.get_network_id(data_basic['Cloud_test_user'])
     tmp = NetworkListBusiness(self.s)
     #添加网络组
     tmp.add_network("group1", user_id, "")
     time.sleep(60)
     #获取网络组对应的id--监控面板--网络列表
     network_id = tmp.get_network_id("group1")
     self.assertNotEqual(network_id, None)
Exemplo n.º 20
0
 def test_005_remove_ap2(self):
     u"""移动ap-从group1移动到default"""
     log.debug("005")
     #获取default的id
     tmp = NetworkListBusiness(self.s)
     network_id = tmp.get_network_id("default")
     #选择进入group1网络组
     tmp.goin_network("group1")
     #移动该ap到group1中
     tmp1 = APSBusiness(self.s)
     tmp1.move_aps(data_ap['7600lr_mac'].upper(), network_id)
     time.sleep(60)
     #获取ap列表ap的网络组名
     tmp2 = AllApListBusiness(self.s)
     network_name = tmp2.get_ap_info(data_ap['7600lr_mac'])['network']
     self.assertEqual(network_name, "default")
Exemplo n.º 21
0
 def test_057_reset_cloud(self):
     u"""删除ap,并恢复cloud的初始环境"""
     log.debug("057")
     #测试完后恢复初始环境
     #1.修改ap的ssid为GWN-Cloud
     tmp1 = SSIDSBusiness(self.s)
     tmp1.dhcp_release_wlan(data_basic['wlan_pc'])
     tmp1.disconnect_ap()
     encry_dict = {
         'ssid_encryption': "3",
         'ssid_wpa_encryption': "0",
         'ssid_wpa_key_mode': "0",
         'ssid_wpa_key': data_wireless['short_wpa']
     }
     data_dict = {'ssid_ssid': "GWN-Cloud", 'ssid_ssid_band': ""}
     tmp1.edit_ssid("", data_wireless['all_ssid'], encry_dict, data_dict)
     time.sleep(120)
     #删除三个ap
     tmp = APSBusiness(self.s)
     tmp1 = NetworkListBusiness(self.s)
     tmp.delete_ap(data_ap['7610_mac'])
     tmp1.goin_network('group1')
     tmp.delete_ap(data_ap['7600_mac'])
     tmp1.goin_network('group2')
     tmp.delete_ap(data_ap['7600lr_mac'])
     tmp1.delete_network('group1')
     tmp1.delete_network('group2')
     time.sleep(360)
Exemplo n.º 22
0
 def test_014_Guest_Editor_add_network(self):
     u"""访客管理员-不能添加网络组"""
     log.debug("014")
     #获取登录名对应的id
     tmp1 =UserBusiness(self.s)
     #使用admin登录
     tmp1.webLogin(data_basic['cloud_user'], data_basic['cloud_pwd'])
     time.sleep(60)
     user_id = tmp1.get_network_id(data_basic['Cloud_test_user'])
     #admin用户退出登录
     tmp1.webLogout()
     #使用测试用户登录
     tmp1.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd'])
     tmp = NetworkListBusiness(self.s)
     #添加网络组
     result = tmp.add_network("group1", user_id, "")
     self.assertFalse(result)
Exemplo n.º 23
0
 def test_004_remove_ap1(self):
     u"""移动ap-从default移动到group1"""
     log.debug("004")
     #获取group1的id
     tmp = NetworkListBusiness(self.s)
     network_id = tmp.get_network_id("group1")
     #将ap复位,并将ap的hosts替换,指向本地cloud,然后将该ap添加到cloud中
     tmp1 = APSBusiness(self.s)
     tmp1.add_ap_2_local_cloud(data_basic['7600lr_ip'], data_ap['7600lr_mac'], "autotest_7600lr")
     time.sleep(60)
     #移动该ap到group1中
     tmp1.move_aps(data_ap['7600lr_mac'].upper(), network_id)
     time.sleep(60)
     #获取ap列表ap的网络组名
     tmp2 = AllApListBusiness(self.s)
     network_name = tmp2.get_ap_info(data_ap['7600lr_mac'])['network']
     self.assertEqual(network_name, "group1")
Exemplo n.º 24
0
    def test_001_add_network(self):
        u"""创建新的网络组并判断是否添加成功"""
        log.debug("001")
        #获取登录名对应的id
        tmp1 =UserBusiness(self.s)

        #描述:启用无线网卡
        tmp1.wlan_enable(data_basic['wlan_pc'])
        tmp1.dhcp_release_wlan(data_basic['wlan_pc'])

        user_id = tmp1.get_network_id(data_basic['cloud_user'])
        tmp = NetworkListBusiness(self.s)
        #添加网络组
        tmp.add_network("group1", user_id, "")
        time.sleep(60)
        #获取网络组对应的id--监控面板--网络列表
        network_id = tmp.get_network_id("group1")
        self.assertNotEqual(network_id, None)
Exemplo n.º 25
0
 def test_003_client_connect_newNetwork_ap(self):
     u"""无线连接该ap"""
     log.debug("003")
     tmp = NetworkListBusiness(self.s)
     #选择进入group1网络组
     tmp.goin_network("group1")
     #修改新网络组的ssid
     tmp1 = SSIDSBusiness(self.s)
     encry_dict = {'ssid_encryption': "3",
                 'ssid_wpa_encryption': "0",
                 'ssid_wpa_key_mode': "0",
                 'ssid_wpa_key': data_wireless['short_wpa']}
     data_dict = {'ssid_ssid': data_wireless['all_ssid']+"-group1"
                  }
     tmp1.edit_ssid(data_ap['7610_mac'], 'GWN-Cloud',
                    encry_dict, data_dict)
     time.sleep(120)
     #无线网卡连接ap
     result = tmp.connect_WPA_AP(data_wireless['all_ssid']+"-group1",
                                 data_wireless['short_wpa'], data_basic["wlan_pc"])
     self.assertIn(data_wireless['all_ssid'], result)
Exemplo n.º 26
0
 def test_002_add_3_model_aps_2_cloud(self):
     u"""三个netwrok分别添加不同的ap,并判断是否添加成功"""
     log.debug("002")
     tmp = APSBusiness(self.s)
     tmp1 = NetworkListBusiness(self.s)
     tmp2 = SettingsBusiness(self.s)
     #将ap复位,并将ap的hosts替换,指向本地cloud,然后将该ap添加到cloud中
     tmp.add_ap_2_local_cloud(data_basic['7610_ip'], data_ap['7610_mac'],
                              "autotest_7610")
     #cloud上获取该网络组的ssh密码
     ssh_pwd = tmp2.get_ssh_pwd()
     #选择进入group1网络组
     tmp1.goin_network("group1")
     tmp.add_ap_2_local_cloud(data_basic['7600_ip'], data_ap['7600_mac'],
                              "autotest_7600")
     #cloud上获取该网络组的ssh密码
     ssh_pwd1 = tmp2.get_ssh_pwd()
     #选择进入group2网络组
     tmp1.goin_network("group2")
     tmp.add_ap_2_local_cloud(data_basic['7600lr_ip'],
                              data_ap['7600lr_mac'], "autotest_7600lr")
     #cloud上获取该网络组的ssh密码
     ssh_pwd2 = tmp2.get_ssh_pwd()
     #判断ap是否已经和cloud配对上
     result1 = tmp.check_ap_pair_cloud(data_basic['7610_ip'],
                                       data_basic['sshUser'], ssh_pwd)
     result2 = tmp.check_ap_pair_cloud(data_basic['7600_ip'],
                                       data_basic['sshUser'], ssh_pwd1)
     result3 = tmp.check_ap_pair_cloud(data_basic['7600lr_ip'],
                                       data_basic['sshUser'], ssh_pwd2)
     self.assertTrue(result1)
     self.assertTrue(result2)
     self.assertTrue(result3)
     print("add 3 model aps to cloud pass!")
Exemplo n.º 27
0
 def test_012_Guest_Editor_add_ap(self):
     u"""访客管理员-不能添加ap"""
     log.debug("012")
     tmp1 = NetworkListBusiness(self.s)
     #使用用户名密码,带着cookie登录cloud,并返回响应数据
     tmp1.webLogin(data_basic['cloud_user'], data_basic['cloud_pwd'])
     time.sleep(60)
     #获取默认网络组default的id
     networkid = tmp1.get_network_id("default")
     tmp = UserBusiness(self.s)
     #修改测试用户为访客管理员
     tmp.set_user_authority(data_basic['Cloud_test_user'], \
         data_basic['Cloud_test_email'], "Guest Editor", [networkid])
     time.sleep(60)
     #admin用户退出登录
     tmp.webLogout()
     #使用测试用户登录
     tmp2 = APSBusiness(self.s)
     tmp2.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd'])
     #添加ap-7610
     result = tmp2.add_ap_2_local_cloud(data_basic['7610_ip'], data_ap['7610_mac'], "autotest_7610")
     self.assertFalse(result)
Exemplo n.º 28
0
 def test_007_remove_many_aps2(self):
     u"""移动多ap-从group1移动到default"""
     log.debug("007")
     #获取default的id
     tmp = NetworkListBusiness(self.s)
     network_id = tmp.get_network_id("default")
     #选择进入group1网络组
     tmp.goin_network("group1")
     #移动三个ap(7600,7600lr,7610)到group1中
     tmp1 = APSBusiness(self.s)
     tmp1.move_aps(data_ap['7600lr_mac'].upper(), network_id)
     tmp1.move_aps(data_ap['7600_mac'].upper(), network_id)
     tmp1.move_aps(data_ap['7610_mac'].upper(), network_id)
     time.sleep(60)
     #获取ap列表ap的网络组名
     tmp2 = AllApListBusiness(self.s)
     network_name_7600lr = tmp2.get_ap_info(data_ap['7600lr_mac'])['network']
     network_name_7600 = tmp2.get_ap_info(data_ap['7600_mac'])['network']
     network_name_7610 = tmp2.get_ap_info(data_ap['7610_mac'])['network']
     self.assertEqual(network_name_7600lr, "default")
     self.assertEqual(network_name_7600, "default")
     self.assertEqual(network_name_7610, "default")
Exemplo n.º 29
0
 def test_005_Platform_Administrator_delete_network(self):
     u"""平台管理员-删除网路组"""
     log.debug("005")
     #删除网络组group1
     tmp = NetworkListBusiness(self.s)
     #使用测试用户登录
     tmp.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd'])
     tmp.delete_network("group1")
     time.sleep(60)
     #获取网络组对应的id--监控面板--网络列表
     network_id = tmp.get_network_id("group1")
     self.assertEqual(network_id, None)
Exemplo n.º 30
0
 def test_001_add_2_network_cloud(self):
     u"""cloud中添加两个netwrok,并且判断是否成功"""
     log.debug("001")
     tmp = APSBusiness(self.s)
     #描述:启用无线网卡
     tmp.wlan_enable(data_basic['wlan_pc'])
     tmp.dhcp_release_wlan(data_basic['wlan_pc'])
     #获取登录名对应的id
     tmp1 = UserBusiness(self.s)
     user_id = tmp1.get_network_id(data_basic['cloud_user'])
     tmp2 = NetworkListBusiness(self.s)
     #添加2个网络组
     result = tmp2.add_network("group1", user_id, "")
     result1 = tmp2.add_network("group2", user_id, "")
     #获取网络组对应的id--监控面板--网络列表
     network_id = tmp2.get_network_id("group1")
     network_id1 = tmp2.get_network_id("group2")
     self.assertEqual(network_id, int(result['data']['value']))
     self.assertEqual(network_id1, int(result1['data']['value']))