tturney | 1bdf77d | 2015-12-28 17:46:13 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python3.4 |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 2 | # |
tturney | 1bdf77d | 2015-12-28 17:46:13 -0800 | [diff] [blame] | 3 | # Copyright 2016 - The Android Open Source Project |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | import pprint |
Ang Li | 8e76718 | 2015-12-09 17:29:24 -0800 | [diff] [blame] | 18 | import random |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 19 | import time |
| 20 | |
Ang Li | c2d4521 | 2016-03-10 18:38:53 -0800 | [diff] [blame] | 21 | from acts import asserts |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 22 | from acts import signals |
Girish Moturu | 03a2e4d | 2017-06-12 10:46:51 +0530 | [diff] [blame] | 23 | from acts.test_decorators import test_tracker_info |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 24 | from acts.test_utils.net.net_test_utils import start_tcpdump |
| 25 | from acts.test_utils.net.net_test_utils import stop_tcpdump |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 26 | from acts.test_utils.wifi import wifi_test_utils as wutils |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 27 | from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest |
Ang Li | c2d4521 | 2016-03-10 18:38:53 -0800 | [diff] [blame] | 28 | |
Ang Li | e8ed2b3 | 2015-12-11 12:30:20 -0800 | [diff] [blame] | 29 | WifiEnums = wutils.WifiEnums |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 30 | |
| 31 | # EAP Macros |
| 32 | EAP = WifiEnums.Eap |
| 33 | EapPhase2 = WifiEnums.EapPhase2 |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 34 | # Enterprise Config Macros |
| 35 | Ent = WifiEnums.Enterprise |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 36 | |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 37 | |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 38 | class WifiEnterpriseTest(WifiBaseTest): |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 39 | def setup_class(self): |
Xianyuan Jia | 168103b | 2019-09-06 12:22:52 -0700 | [diff] [blame] | 40 | super().setup_class() |
| 41 | |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 42 | self.dut = self.android_devices[0] |
Ang Li | 8e76718 | 2015-12-09 17:29:24 -0800 | [diff] [blame] | 43 | wutils.wifi_test_device_init(self.dut) |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 44 | # If running in a setup with attenuators, set attenuation on all |
| 45 | # channels to zero. |
| 46 | if getattr(self, "attenuators", []): |
| 47 | for a in self.attenuators: |
| 48 | a.set_atten(0) |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 49 | required_userparam_names = ( |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 50 | "ca_cert", "client_cert", "client_key", "passpoint_ca_cert", |
| 51 | "passpoint_client_cert", "passpoint_client_key", "eap_identity", |
| 52 | "eap_password", "invalid_ca_cert", "invalid_client_cert", |
| 53 | "invalid_client_key", "fqdn", "provider_friendly_name", "realm", |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 54 | "device_password", "ping_addr", "radius_conf_2g", "radius_conf_5g", |
| 55 | "radius_conf_pwd") |
Ang Li | 5cd6d3c | 2016-02-01 11:29:14 -0800 | [diff] [blame] | 56 | self.unpack_userparams(required_userparam_names, |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 57 | roaming_consortium_ids=None, |
Jimmy Chen | 7baec62 | 2020-06-23 19:00:33 +0800 | [diff] [blame^] | 58 | plmn=None, |
| 59 | ocsp=0) |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 60 | |
| 61 | if "AccessPoint" in self.user_params: |
| 62 | self.legacy_configure_ap_and_start( |
| 63 | ent_network=True, |
| 64 | radius_conf_2g=self.radius_conf_2g, |
| 65 | radius_conf_5g=self.radius_conf_5g, |
| 66 | ent_network_pwd=True, |
| 67 | radius_conf_pwd=self.radius_conf_pwd,) |
| 68 | self.ent_network_2g = self.ent_networks[0]["2g"] |
| 69 | self.ent_network_5g = self.ent_networks[0]["5g"] |
| 70 | self.ent_network_pwd = self.ent_networks_pwd[0]["2g"] |
| 71 | |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 72 | # Default configs for EAP networks. |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 73 | self.config_peap0 = { |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 74 | Ent.EAP: int(EAP.PEAP), |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 75 | Ent.CA_CERT: self.ca_cert, |
| 76 | Ent.IDENTITY: self.eap_identity, |
| 77 | Ent.PASSWORD: self.eap_password, |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 78 | Ent.PHASE2: int(EapPhase2.MSCHAPV2), |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 79 | WifiEnums.SSID_KEY: self.ent_network_5g[WifiEnums.SSID_KEY], |
Jimmy Chen | 7baec62 | 2020-06-23 19:00:33 +0800 | [diff] [blame^] | 80 | Ent.OCSP: self.ocsp, |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 81 | } |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 82 | self.config_peap1 = dict(self.config_peap0) |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 83 | self.config_peap1[WifiEnums.SSID_KEY] = \ |
| 84 | self.ent_network_2g[WifiEnums.SSID_KEY] |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 85 | self.config_tls = { |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 86 | Ent.EAP: int(EAP.TLS), |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 87 | Ent.CA_CERT: self.ca_cert, |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 88 | WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY], |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 89 | Ent.CLIENT_CERT: self.client_cert, |
| 90 | Ent.PRIVATE_KEY_ID: self.client_key, |
| 91 | Ent.IDENTITY: self.eap_identity, |
Jimmy Chen | 7baec62 | 2020-06-23 19:00:33 +0800 | [diff] [blame^] | 92 | Ent.OCSP: self.ocsp, |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 93 | } |
| 94 | self.config_ttls = { |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 95 | Ent.EAP: int(EAP.TTLS), |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 96 | Ent.CA_CERT: self.ca_cert, |
| 97 | Ent.IDENTITY: self.eap_identity, |
| 98 | Ent.PASSWORD: self.eap_password, |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 99 | Ent.PHASE2: int(EapPhase2.MSCHAPV2), |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 100 | WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY], |
Jimmy Chen | 7baec62 | 2020-06-23 19:00:33 +0800 | [diff] [blame^] | 101 | Ent.OCSP: self.ocsp, |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 102 | } |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 103 | self.config_pwd = { |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 104 | Ent.EAP: int(EAP.PWD), |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 105 | Ent.IDENTITY: self.eap_identity, |
| 106 | Ent.PASSWORD: self.eap_password, |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 107 | WifiEnums.SSID_KEY: self.ent_network_pwd[WifiEnums.SSID_KEY], |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 108 | } |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 109 | self.config_sim = { |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 110 | Ent.EAP: int(EAP.SIM), |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 111 | WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY], |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 112 | } |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 113 | self.config_aka = { |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 114 | Ent.EAP: int(EAP.AKA), |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 115 | WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY], |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 116 | } |
| 117 | self.config_aka_prime = { |
Girish Moturu | 150d32f | 2017-02-14 12:27:07 -0800 | [diff] [blame] | 118 | Ent.EAP: int(EAP.AKA_PRIME), |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 119 | WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY], |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 120 | } |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 121 | |
| 122 | # Base config for passpoint networks. |
| 123 | self.config_passpoint = { |
| 124 | Ent.FQDN: self.fqdn, |
| 125 | Ent.FRIENDLY_NAME: self.provider_friendly_name, |
| 126 | Ent.REALM: self.realm, |
| 127 | Ent.CA_CERT: self.passpoint_ca_cert |
| 128 | } |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 129 | if self.plmn: |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 130 | self.config_passpoint[Ent.PLMN] = self.plmn |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 131 | if self.roaming_consortium_ids: |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 132 | self.config_passpoint[ |
| 133 | Ent.ROAMING_IDS] = self.roaming_consortium_ids |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 134 | |
| 135 | # Default configs for passpoint networks. |
| 136 | self.config_passpoint_tls = dict(self.config_tls) |
| 137 | self.config_passpoint_tls.update(self.config_passpoint) |
| 138 | self.config_passpoint_tls[Ent.CLIENT_CERT] = self.passpoint_client_cert |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 139 | self.config_passpoint_tls[ |
| 140 | Ent.PRIVATE_KEY_ID] = self.passpoint_client_key |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 141 | del self.config_passpoint_tls[WifiEnums.SSID_KEY] |
| 142 | self.config_passpoint_ttls = dict(self.config_ttls) |
| 143 | self.config_passpoint_ttls.update(self.config_passpoint) |
| 144 | del self.config_passpoint_ttls[WifiEnums.SSID_KEY] |
| 145 | # Set screen lock password so ConfigStore is unlocked. |
Ang Li | a9d188f | 2016-02-17 18:03:01 -0800 | [diff] [blame] | 146 | self.dut.droid.setDevicePassword(self.device_password) |
Girish Moturu | 90f7484 | 2017-10-16 11:29:08 -0700 | [diff] [blame] | 147 | self.tcpdump_pid = None |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 148 | |
| 149 | def teardown_class(self): |
Ang Li | 8e76718 | 2015-12-09 17:29:24 -0800 | [diff] [blame] | 150 | wutils.reset_wifi(self.dut) |
Hsiu-Chang Chen | 3492edd | 2019-03-27 10:28:58 +0800 | [diff] [blame] | 151 | self.dut.droid.disableDevicePassword(self.device_password) |
Ang Li | a9d188f | 2016-02-17 18:03:01 -0800 | [diff] [blame] | 152 | self.dut.ed.clear_all_events() |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 153 | |
| 154 | def setup_test(self): |
Ang Li | a9d188f | 2016-02-17 18:03:01 -0800 | [diff] [blame] | 155 | self.dut.droid.wifiStartTrackingStateChange() |
| 156 | self.dut.droid.wakeLockAcquireBright() |
| 157 | self.dut.droid.wakeUpNow() |
Ang Li | 8e76718 | 2015-12-09 17:29:24 -0800 | [diff] [blame] | 158 | wutils.reset_wifi(self.dut) |
Ang Li | a9d188f | 2016-02-17 18:03:01 -0800 | [diff] [blame] | 159 | self.dut.ed.clear_all_events() |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 160 | self.tcpdump_pid = start_tcpdump(self.dut, self.test_name) |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 161 | |
| 162 | def teardown_test(self): |
Girish Moturu | f1ce420 | 2018-10-20 21:33:00 -0700 | [diff] [blame] | 163 | stop_tcpdump(self.dut, self.tcpdump_pid, self.test_name) |
Ang Li | a9d188f | 2016-02-17 18:03:01 -0800 | [diff] [blame] | 164 | self.dut.droid.wakeLockRelease() |
| 165 | self.dut.droid.goToSleepNow() |
| 166 | self.dut.droid.wifiStopTrackingStateChange() |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 167 | |
Ang Li | 20377aa | 2016-02-26 13:19:51 -0800 | [diff] [blame] | 168 | def on_fail(self, test_name, begin_time): |
Hsiu-Chang Chen | 0f7d7ae | 2019-06-04 14:26:04 +0800 | [diff] [blame] | 169 | self.dut.take_bug_report(test_name, begin_time) |
Ang Li | 20377aa | 2016-02-26 13:19:51 -0800 | [diff] [blame] | 170 | self.dut.cat_adb_log(test_name, begin_time) |
| 171 | |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 172 | """Helper Functions""" |
| 173 | |
| 174 | def eap_negative_connect_logic(self, config, ad): |
| 175 | """Tries to connect to an enterprise network with invalid credentials |
| 176 | and expect a failure. |
| 177 | |
| 178 | Args: |
| 179 | config: A dict representing an invalid EAP credential. |
| 180 | |
| 181 | Returns: |
| 182 | True if connection failed as expected, False otherwise. |
| 183 | """ |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 184 | with asserts.assert_raises(signals.TestFailure, extras=config): |
Bindu Mahadev | 50374df | 2017-01-04 11:03:32 -0800 | [diff] [blame] | 185 | verdict = wutils.wifi_connect(ad, config) |
Ang Li | 8252281 | 2016-06-02 13:57:21 -0700 | [diff] [blame] | 186 | asserts.explicit_pass("Connection failed as expected.") |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 187 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 188 | def gen_negative_configs(self, config, neg_params): |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 189 | """Generic function used to generate negative configs. |
| 190 | |
| 191 | For all the valid configurations, if a param in the neg_params also |
| 192 | exists in a config, a copy of the config is made with an invalid value |
| 193 | of the param. |
| 194 | |
| 195 | Args: |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 196 | config: A valid configuration. |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 197 | neg_params: A dict that has all the invalid values. |
| 198 | |
| 199 | Returns: |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 200 | An invalid configurations generated based on the valid |
| 201 | configuration. Each invalid configuration has a different invalid |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 202 | field. |
| 203 | """ |
Girish Moturu | c4a2984 | 2017-10-24 07:37:26 -0700 | [diff] [blame] | 204 | negative_config = dict(config) |
| 205 | if negative_config in [self.config_sim, self.config_aka, |
| 206 | self.config_aka_prime]: |
| 207 | negative_config[WifiEnums.SSID_KEY] = 'wrong_hostapd_ssid' |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 208 | for k, v in neg_params.items(): |
| 209 | # Skip negative test for TLS's identity field since it's not |
| 210 | # used for auth. |
| 211 | if config[Ent.EAP] == EAP.TLS and k == Ent.IDENTITY: |
| 212 | continue |
| 213 | if k in config: |
Girish Moturu | c4a2984 | 2017-10-24 07:37:26 -0700 | [diff] [blame] | 214 | negative_config[k] = v |
| 215 | negative_config["invalid_field"] = k |
| 216 | return negative_config |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 217 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 218 | def gen_negative_eap_configs(self, config): |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 219 | """Generates invalid configurations for different EAP authentication |
| 220 | types. |
| 221 | |
| 222 | For all the valid EAP configurations, if a param that is part of the |
| 223 | authentication info exists in a config, a copy of the config is made |
| 224 | with an invalid value of the param. |
| 225 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 226 | Args: |
| 227 | A valid network configration |
| 228 | |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 229 | Returns: |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 230 | An invalid EAP configuration. |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 231 | """ |
| 232 | neg_params = { |
| 233 | Ent.CLIENT_CERT: self.invalid_client_cert, |
| 234 | Ent.CA_CERT: self.invalid_ca_cert, |
| 235 | Ent.PRIVATE_KEY_ID: self.invalid_client_key, |
| 236 | Ent.IDENTITY: "fake_identity", |
| 237 | Ent.PASSWORD: "wrong_password" |
| 238 | } |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 239 | return self.gen_negative_configs(config, neg_params) |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 240 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 241 | def gen_negative_passpoint_configs(self, config): |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 242 | """Generates invalid configurations for different EAP authentication |
| 243 | types with passpoint support. |
| 244 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 245 | Args: |
| 246 | A valid network configration |
| 247 | |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 248 | Returns: |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 249 | An invalid EAP configuration with passpoint fields. |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 250 | """ |
| 251 | neg_params = { |
| 252 | Ent.CLIENT_CERT: self.invalid_client_cert, |
| 253 | Ent.CA_CERT: self.invalid_ca_cert, |
| 254 | Ent.PRIVATE_KEY_ID: self.invalid_client_key, |
| 255 | Ent.IDENTITY: "fake_identity", |
| 256 | Ent.PASSWORD: "wrong_password", |
| 257 | Ent.FQDN: "fake_fqdn", |
| 258 | Ent.REALM: "where_no_one_has_gone_before", |
| 259 | Ent.PLMN: "fake_plmn", |
| 260 | Ent.ROAMING_IDS: [1234567890, 9876543210] |
| 261 | } |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 262 | return self.gen_negative_configs(config, neg_params) |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 263 | |
| 264 | def eap_connect_toggle_wifi(self, |
| 265 | config, |
| 266 | *args): |
| 267 | """Connects to an enterprise network, toggles wifi state and ensures |
| 268 | that the device reconnects. |
| 269 | |
| 270 | This logic expect the enterprise network to have Internet access. |
| 271 | |
| 272 | Args: |
| 273 | config: A dict representing a wifi enterprise configuration. |
| 274 | args: args to be passed to |wutils.eap_connect|. |
| 275 | |
| 276 | Returns: |
| 277 | True if the connection is successful and Internet access works. |
| 278 | """ |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 279 | ad = args[0] |
Bindu Mahadev | 50374df | 2017-01-04 11:03:32 -0800 | [diff] [blame] | 280 | wutils.wifi_connect(ad, config) |
| 281 | wutils.toggle_wifi_and_wait_for_reconnection(ad, config, num_of_tries=5) |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 282 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 283 | """ Tests """ |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 284 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 285 | # EAP connect tests |
| 286 | """ Test connecting to enterprise networks of different authentication |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 287 | types. |
| 288 | |
| 289 | The authentication types tested are: |
| 290 | EAP-TLS |
| 291 | EAP-PEAP with different phase2 types. |
| 292 | EAP-TTLS with different phase2 types. |
| 293 | |
| 294 | Procedures: |
| 295 | For each enterprise wifi network |
| 296 | 1. Connect to the network. |
| 297 | 2. Send a GET request to a website and check response. |
| 298 | |
| 299 | Expect: |
| 300 | Successful connection and Internet access through the enterprise |
| 301 | networks. |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 302 | """ |
| 303 | @test_tracker_info(uuid="4e720cac-ea17-4de7-a540-8dc7c49f9713") |
| 304 | def test_eap_connect_with_config_tls(self): |
| 305 | wutils.wifi_connect(self.dut, self.config_tls) |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 306 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 307 | @test_tracker_info(uuid="10e3a5e9-0018-4162-a9fa-b41500f13340") |
| 308 | def test_eap_connect_with_config_pwd(self): |
| 309 | wutils.wifi_connect(self.dut, self.config_pwd) |
| 310 | |
| 311 | @test_tracker_info(uuid="b4513f78-a1c4-427f-bfc7-2a6b3da714b5") |
| 312 | def test_eap_connect_with_config_sim(self): |
| 313 | wutils.wifi_connect(self.dut, self.config_sim) |
| 314 | |
| 315 | @test_tracker_info(uuid="7d390e30-cb67-4b55-bf00-567adad2d9b0") |
| 316 | def test_eap_connect_with_config_aka(self): |
| 317 | wutils.wifi_connect(self.dut, self.config_aka) |
| 318 | |
| 319 | @test_tracker_info(uuid="742f921b-27c3-4b68-a3ca-88e64fe79c1d") |
| 320 | def test_eap_connect_with_config_aka_prime(self): |
| 321 | wutils.wifi_connect(self.dut, self.config_aka_prime) |
| 322 | |
| 323 | @test_tracker_info(uuid="d34e30f3-6ef6-459f-b47a-e78ed90ce4c6") |
| 324 | def test_eap_connect_with_config_ttls_none(self): |
| 325 | config = dict(self.config_ttls) |
| 326 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.NONE.value |
| 327 | wutils.wifi_connect(self.dut, config) |
| 328 | |
| 329 | @test_tracker_info(uuid="0dca3a15-472e-427c-8e06-4e38088ee973") |
| 330 | def test_eap_connect_with_config_ttls_pap(self): |
| 331 | config = dict(self.config_ttls) |
| 332 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.PAP.value |
| 333 | wutils.wifi_connect(self.dut, config) |
| 334 | |
| 335 | @test_tracker_info(uuid="47c4b459-2cb1-4fc7-b4e7-82534e8e090e") |
| 336 | def test_eap_connect_with_config_ttls_mschap(self): |
| 337 | config = dict(self.config_ttls) |
| 338 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAP.value |
| 339 | wutils.wifi_connect(self.dut, config) |
| 340 | |
| 341 | @test_tracker_info(uuid="fdb286c7-8069-481d-baf0-c5dd7a31ff03") |
| 342 | def test_eap_connect_with_config_ttls_mschapv2(self): |
| 343 | config = dict(self.config_ttls) |
| 344 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 345 | wutils.wifi_connect(self.dut, config) |
| 346 | |
| 347 | @test_tracker_info(uuid="d9315962-7987-4ee7-905d-6972c78ce8a1") |
| 348 | def test_eap_connect_with_config_ttls_gtc(self): |
| 349 | config = dict(self.config_ttls) |
| 350 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 351 | wutils.wifi_connect(self.dut, config) |
| 352 | |
| 353 | @test_tracker_info(uuid="90a67bd3-30da-4daf-8ab0-d964d7ad19be") |
| 354 | def test_eap_connect_with_config_peap0_mschapv2(self): |
| 355 | config = dict(self.config_peap0) |
| 356 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 357 | wutils.wifi_connect(self.dut, config) |
| 358 | |
| 359 | @test_tracker_info(uuid="3c451ba4-0c83-4eef-bc95-db4c21893008") |
| 360 | def test_eap_connect_with_config_peap0_gtc(self): |
| 361 | config = dict(self.config_peap0) |
| 362 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 363 | wutils.wifi_connect(self.dut, config) |
| 364 | |
| 365 | @test_tracker_info(uuid="6b45157d-0325-417a-af18-11af5d240d79") |
| 366 | def test_eap_connect_with_config_peap1_mschapv2(self): |
| 367 | config = dict(self.config_peap1) |
| 368 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 369 | wutils.wifi_connect(self.dut, config) |
| 370 | |
| 371 | @test_tracker_info(uuid="1663decc-71ae-4f95-a027-8a6dbf9c337f") |
| 372 | def test_eap_connect_with_config_peap1_gtc(self): |
| 373 | config = dict(self.config_peap1) |
| 374 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 375 | wutils.wifi_connect(self.dut, config) |
| 376 | |
| 377 | # EAP connect negative tests |
| 378 | """ Test connecting to enterprise networks. |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 379 | |
| 380 | Procedures: |
| 381 | For each enterprise wifi network |
| 382 | 1. Connect to the network with invalid credentials. |
| 383 | |
| 384 | Expect: |
| 385 | Fail to establish connection. |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 386 | """ |
| 387 | @test_tracker_info(uuid="b2a91f1f-ccd7-4bd1-ab81-19aab3d8ee38") |
| 388 | def test_eap_connect_negative_with_config_tls(self): |
| 389 | config = self.gen_negative_eap_configs(self.config_tls) |
| 390 | self.eap_negative_connect_logic(config, self.dut) |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 391 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 392 | @test_tracker_info(uuid="6466abde-1d16-4168-9dd8-1e7a0a19889b") |
| 393 | def test_eap_connect_negative_with_config_pwd(self): |
| 394 | config = self.gen_negative_eap_configs(self.config_pwd) |
| 395 | self.eap_negative_connect_logic(config, self.dut) |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 396 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 397 | @test_tracker_info(uuid="d7742a2a-85b0-409a-99d8-47711ddc5612") |
| 398 | def test_eap_connect_negative_with_config_sim(self): |
| 399 | config = self.gen_negative_eap_configs(self.config_sim) |
| 400 | self.eap_negative_connect_logic(config, self.dut) |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 401 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 402 | @test_tracker_info(uuid="0ec0de93-cab3-4f41-960b-c0af64ff48c4") |
| 403 | def test_eap_connect_negative_with_config_aka(self): |
| 404 | config = self.gen_negative_eap_configs(self.config_aka) |
| 405 | self.eap_negative_connect_logic(config, self.dut) |
| 406 | |
| 407 | @test_tracker_info(uuid="bb640ea4-32a6-48ea-87c9-f7128fffbbf6") |
| 408 | def test_eap_connect_negative_with_config_aka_prime(self): |
| 409 | config = self.gen_negative_eap_configs(self.config_aka_prime) |
| 410 | self.eap_negative_connect_logic(config, self.dut) |
| 411 | |
| 412 | @test_tracker_info(uuid="86336ada-0ced-45a4-8a22-c4aa23c81111") |
| 413 | def test_eap_connect_negative_with_config_ttls_none(self): |
| 414 | config = dict(self.config_ttls) |
| 415 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.NONE.value |
| 416 | config = self.gen_negative_eap_configs(config) |
| 417 | self.eap_negative_connect_logic(config, self.dut) |
| 418 | |
| 419 | @test_tracker_info(uuid="71e0498d-9973-4958-94bd-79051c328920") |
| 420 | def test_eap_connect_negative_with_config_ttls_pap(self): |
| 421 | config = dict(self.config_ttls) |
| 422 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.PAP.value |
| 423 | config = self.gen_negative_eap_configs(config) |
| 424 | self.eap_negative_connect_logic(config, self.dut) |
| 425 | |
| 426 | @test_tracker_info(uuid="c04142a8-b204-4d2d-98dc-150b16c8397e") |
| 427 | def test_eap_connect_negative_with_config_ttls_mschap(self): |
| 428 | config = dict(self.config_ttls) |
| 429 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAP.value |
| 430 | config = self.gen_negative_eap_configs(config) |
| 431 | self.eap_negative_connect_logic(config, self.dut) |
| 432 | |
| 433 | @test_tracker_info(uuid="625e7aa5-e3e6-4bbe-98c0-5aad8ca1555b") |
| 434 | def test_eap_connect_negative_with_config_ttls_mschapv2(self): |
| 435 | config = dict(self.config_ttls) |
| 436 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 437 | config = self.gen_negative_eap_configs(config) |
| 438 | self.eap_negative_connect_logic(config, self.dut) |
| 439 | |
| 440 | @test_tracker_info(uuid="24ea0d80-0a3f-41c2-8e05-d6387e589058") |
| 441 | def test_eap_connect_negative_with_config_ttls_gtc(self): |
| 442 | config = dict(self.config_ttls) |
| 443 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 444 | config = self.gen_negative_eap_configs(config) |
| 445 | self.eap_negative_connect_logic(config, self.dut) |
| 446 | |
| 447 | @test_tracker_info(uuid="b7c1f0f8-6338-4501-8e1d-c9b136aaba88") |
| 448 | def test_eap_connect_negative_with_config_peap0_mschapv2(self): |
| 449 | config = dict(self.config_peap0) |
| 450 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 451 | config = self.gen_negative_eap_configs(config) |
| 452 | self.eap_negative_connect_logic(config, self.dut) |
| 453 | |
| 454 | @test_tracker_info(uuid="9cf83dcb-38ad-4f75-9ea9-98de1cfaf7f3") |
| 455 | def test_eap_connect_negative_with_config_peap0_gtc(self): |
| 456 | config = dict(self.config_peap0) |
| 457 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 458 | config = self.gen_negative_eap_configs(config) |
| 459 | self.eap_negative_connect_logic(config, self.dut) |
| 460 | |
| 461 | @test_tracker_info(uuid="89bb2b6b-d073-402a-bdc1-68ac5f8752a3") |
| 462 | def test_eap_connect_negative_with_config_peap1_mschapv2(self): |
| 463 | config = dict(self.config_peap1) |
| 464 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 465 | config = self.gen_negative_eap_configs(config) |
| 466 | self.eap_negative_connect_logic(config, self.dut) |
| 467 | |
| 468 | @test_tracker_info(uuid="2252a864-9ff7-43b5-82d9-afe57d1f5e5f") |
| 469 | def test_eap_connect_negative_with_config_peap1_gtc(self): |
| 470 | config = dict(self.config_peap1) |
| 471 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 472 | config = self.gen_negative_eap_configs(config) |
| 473 | self.eap_negative_connect_logic(config, self.dut) |
| 474 | |
| 475 | # EAP connect config store tests |
| 476 | """ Test connecting to enterprise networks of different authentication |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 477 | types after wifi toggle. |
| 478 | |
| 479 | The authentication types tested are: |
| 480 | EAP-TLS |
| 481 | EAP-PEAP with different phase2 types. |
| 482 | EAP-TTLS with different phase2 types. |
| 483 | |
| 484 | Procedures: |
| 485 | For each enterprise wifi network |
| 486 | 1. Connect to the network. |
| 487 | 2. Send a GET request to a website and check response. |
| 488 | 3. Toggle wifi. |
| 489 | 4. Ensure that the device reconnects to the same network. |
| 490 | |
| 491 | Expect: |
| 492 | Successful connection and Internet access through the enterprise |
| 493 | networks. |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 494 | """ |
| 495 | @test_tracker_info(uuid="2a933b7f-27d7-4201-a34f-25b9d8072a8c") |
| 496 | def test_eap_connect_config_store_with_config_tls(self): |
| 497 | self.eap_connect_toggle_wifi(self.config_tls, self.dut) |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 498 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 499 | @test_tracker_info(uuid="08dc071b-9fea-408a-a3f6-d3493869f6d4") |
| 500 | def test_eap_connect_config_store_with_config_pwd(self): |
| 501 | self.eap_connect_toggle_wifi(self.config_pwd, self.dut) |
| 502 | |
| 503 | @test_tracker_info(uuid="230cb03e-58bc-41cb-b9b3-7215c2ab2325") |
| 504 | def test_eap_connect_config_store_with_config_sim(self): |
| 505 | self.eap_connect_toggle_wifi(self.config_sim, self.dut) |
| 506 | |
| 507 | @test_tracker_info(uuid="dfc3e59c-2309-4598-8c23-bb3fe95ef89f") |
| 508 | def test_eap_connect_config_store_with_config_aka(self): |
| 509 | self.eap_connect_toggle_wifi(self.config_aka, self.dut) |
| 510 | |
| 511 | @test_tracker_info(uuid="6050a1d1-4f3a-476d-bf93-638abd066790") |
| 512 | def test_eap_connect_config_store_with_config_aka_prime(self): |
| 513 | self.eap_connect_toggle_wifi(self.config_aka_prime, self.dut) |
| 514 | |
| 515 | @test_tracker_info(uuid="03108057-cc44-4a80-8331-77c93694099c") |
| 516 | def test_eap_connect_config_store_with_config_ttls_none(self): |
| 517 | config = dict(self.config_ttls) |
| 518 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.NONE.value |
| 519 | self.eap_connect_toggle_wifi(config, self.dut) |
| 520 | |
| 521 | @test_tracker_info(uuid="53dd8195-e272-4589-a261-b8fa3607ad8d") |
| 522 | def test_eap_connect_config_store_with_config_ttls_pap(self): |
| 523 | config = dict(self.config_ttls) |
| 524 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.PAP.value |
| 525 | self.eap_connect_toggle_wifi(config, self.dut) |
| 526 | |
| 527 | @test_tracker_info(uuid="640f697b-9c62-4b19-bd76-53b236a152e0") |
| 528 | def test_eap_connect_config_store_with_config_ttls_mschap(self): |
| 529 | config = dict(self.config_ttls) |
| 530 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAP.value |
| 531 | self.eap_connect_toggle_wifi(config, self.dut) |
| 532 | |
| 533 | @test_tracker_info(uuid="f0243684-fae0-46f3-afbd-bf525fc712e2") |
| 534 | def test_eap_connect_config_store_with_config_ttls_mschapv2(self): |
| 535 | config = dict(self.config_ttls) |
| 536 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 537 | self.eap_connect_toggle_wifi(config, self.dut) |
| 538 | |
| 539 | @test_tracker_info(uuid="49ec7202-3b00-49c3-970a-201360888c74") |
| 540 | def test_eap_connect_config_store_with_config_ttls_gtc(self): |
| 541 | config = dict(self.config_ttls) |
| 542 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 543 | self.eap_connect_toggle_wifi(config, self.dut) |
| 544 | |
| 545 | @test_tracker_info(uuid="1c6abfa3-f344-4e28-b891-5481ab79efcf") |
| 546 | def test_eap_connect_config_store_with_config_peap0_mschapv2(self): |
| 547 | config = dict(self.config_peap0) |
| 548 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 549 | self.eap_connect_toggle_wifi(config, self.dut) |
| 550 | |
| 551 | @test_tracker_info(uuid="2815bc76-49fa-43a5-a4b6-84788f9809d5") |
| 552 | def test_eap_connect_config_store_with_config_peap0_gtc(self): |
| 553 | config = dict(self.config_peap0) |
| 554 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 555 | self.eap_connect_toggle_wifi(config, self.dut) |
| 556 | |
| 557 | @test_tracker_info(uuid="e93f7472-6895-4e36-bff2-9b2dcfd07ad0") |
| 558 | def test_eap_connect_config_store_with_config_peap1_mschapv2(self): |
| 559 | config = dict(self.config_peap1) |
| 560 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 561 | self.eap_connect_toggle_wifi(config, self.dut) |
| 562 | |
| 563 | @test_tracker_info(uuid="6da72fa0-b858-4475-9559-46fe052d0d64") |
| 564 | def test_eap_connect_config_store_with_config_peap1_gtc(self): |
| 565 | config = dict(self.config_peap1) |
| 566 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 567 | self.eap_connect_toggle_wifi(config, self.dut) |
| 568 | |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 569 | # Removing 'test_' for all passpoint based testcases as we want to disable |
| 570 | # them. Adding the valid test cases to self.tests make them run in serial |
| 571 | # (TODO): gmoturu - Update the passpoint tests to test the valid scenario |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 572 | # Passpoint connect tests |
| 573 | """ Test connecting to enterprise networks of different authentication |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 574 | types with passpoint support. |
| 575 | |
| 576 | The authentication types tested are: |
| 577 | EAP-TLS |
| 578 | EAP-TTLS with MSCHAPV2 as phase2. |
| 579 | |
| 580 | Procedures: |
| 581 | For each enterprise wifi network |
| 582 | 1. Connect to the network. |
| 583 | 2. Send a GET request to a website and check response. |
| 584 | |
| 585 | Expect: |
| 586 | Successful connection and Internet access through the enterprise |
| 587 | networks with passpoint support. |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 588 | """ |
| 589 | @test_tracker_info(uuid="0b942524-bde9-4fc6-ac6a-fef1c247cb8e") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 590 | def passpoint_connect_with_config_passpoint_tls(self): |
Ang Li | c2d4521 | 2016-03-10 18:38:53 -0800 | [diff] [blame] | 591 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 592 | "Passpoint is not supported on %s" % self.dut.model) |
| 593 | wutils.wifi_connect(self.dut, self.config_passpoint_tls) |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 594 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 595 | @test_tracker_info(uuid="33a014aa-99e7-4612-b732-54fabf1bf922") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 596 | def passpoint_connect_with_config_passpoint_ttls_none(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 597 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 598 | "Passpoint is not supported on %s" % self.dut.model) |
| 599 | config = dict(self.config_passpoint_ttls) |
| 600 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.NONE.value |
| 601 | wutils.wifi_connect(self.dut, config) |
| 602 | |
| 603 | @test_tracker_info(uuid="1aba8bf9-2b09-4956-b418-c3f4dadab330") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 604 | def passpoint_connect_with_config_passpoint_ttls_pap(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 605 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 606 | "Passpoint is not supported on %s" % self.dut.model) |
| 607 | config = dict(self.config_passpoint_ttls) |
| 608 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.PAP.value |
| 609 | wutils.wifi_connect(self.dut, config) |
| 610 | |
| 611 | @test_tracker_info(uuid="cd978fc9-a393-4b1e-bba3-1efc52224500") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 612 | def passpoint_connect_with_config_passpoint_ttls_mschap(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 613 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 614 | "Passpoint is not supported on %s" % self.dut.model) |
| 615 | config = dict(self.config_passpoint_ttls) |
| 616 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAP.value |
| 617 | wutils.wifi_connect(self.dut, config) |
| 618 | |
| 619 | @test_tracker_info(uuid="bc311ee7-ba64-4c76-a629-b916701bf6a5") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 620 | def passpoint_connect_with_config_passpoint_ttls_mschapv2(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 621 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 622 | "Passpoint is not supported on %s" % self.dut.model) |
| 623 | config = dict(self.config_passpoint_ttls) |
| 624 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 625 | wutils.wifi_connect(self.dut, config) |
| 626 | |
| 627 | @test_tracker_info(uuid="357e5162-5081-4149-bedd-ef2c0f88b97e") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 628 | def passpoint_connect_with_config_passpoint_ttls_gtc(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 629 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 630 | "Passpoint is not supported on %s" % self.dut.model) |
| 631 | config = dict(self.config_passpoint_ttls) |
| 632 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 633 | wutils.wifi_connect(self.dut, config) |
| 634 | |
| 635 | # Passpoint connect negative tests |
| 636 | """ Test connecting to enterprise networks. |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 637 | |
| 638 | Procedures: |
| 639 | For each enterprise wifi network |
| 640 | 1. Connect to the network with invalid credentials. |
| 641 | |
| 642 | Expect: |
| 643 | Fail to establish connection. |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 644 | """ |
| 645 | @test_tracker_info(uuid="7b6b44a0-ff70-49b4-94ca-a98bedc18f92") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 646 | def passpoint_connect_negative_with_config_passpoint_tls(self): |
Ang Li | c2d4521 | 2016-03-10 18:38:53 -0800 | [diff] [blame] | 647 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 648 | "Passpoint is not supported on %s" % self.dut.model) |
| 649 | config = self.gen_negative_passpoint_configs(self.config_passpoint_tls) |
| 650 | self.eap_negative_connect_logic(config, self.dut) |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 651 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 652 | @test_tracker_info(uuid="3dbde40a-e88c-4166-b932-163663a10a41") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 653 | def passpoint_connect_negative_with_config_passpoint_ttls_none(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 654 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 655 | "Passpoint is not supported on %s" % self.dut.model) |
| 656 | config = dict(self.config_passpoint_ttls) |
| 657 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.NONE.value |
| 658 | config = self.gen_negative_passpoint_configs(config) |
| 659 | self.eap_negative_connect_logic(config, self.dut) |
Ang Li | 8154905 | 2016-06-09 18:51:14 -0700 | [diff] [blame] | 660 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 661 | @test_tracker_info(uuid="8ee22ad6-d561-4ca2-a808-9f372fce56b4") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 662 | def passpoint_connect_negative_with_config_passpoint_ttls_pap(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 663 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 664 | "Passpoint is not supported on %s" % self.dut.model) |
| 665 | config = dict(self.config_passpoint_ttls) |
| 666 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.PAP.value |
| 667 | config = self.gen_negative_passpoint_configs(config) |
| 668 | self.eap_negative_connect_logic(config, self.dut) |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 669 | |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 670 | @test_tracker_info(uuid="db5cefe7-9cb8-47a6-8635-006c80b97012") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 671 | def passpoint_connect_negative_with_config_passpoint_ttls_mschap(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 672 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 673 | "Passpoint is not supported on %s" % self.dut.model) |
| 674 | config = dict(self.config_passpoint_ttls) |
| 675 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAP.value |
| 676 | config = self.gen_negative_passpoint_configs(config) |
| 677 | self.eap_negative_connect_logic(config, self.dut) |
| 678 | |
| 679 | @test_tracker_info(uuid="8f49496e-80df-48ce-9c51-42f0c6b81aff") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 680 | def passpoint_connect_negative_with_config_passpoint_ttls_mschapv2(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 681 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 682 | "Passpoint is not supported on %s" % self.dut.model) |
| 683 | config = dict(self.config_passpoint_ttls) |
| 684 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 685 | config = self.gen_negative_passpoint_configs(config) |
| 686 | self.eap_negative_connect_logic(config, self.dut) |
| 687 | |
| 688 | @test_tracker_info(uuid="6561508f-598e-408d-96b6-15b631664be6") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 689 | def passpoint_connect_negative_with_config_passpoint_ttls_gtc(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 690 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 691 | "Passpoint is not supported on %s" % self.dut.model) |
| 692 | config = dict(self.config_passpoint_ttls) |
| 693 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 694 | config = self.gen_negative_passpoint_configs(config) |
| 695 | self.eap_negative_connect_logic(config, self.dut) |
| 696 | |
| 697 | # Passpoint connect config store tests |
| 698 | """ Test connecting to enterprise networks of different authentication |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 699 | types with passpoint support after wifi toggle. |
| 700 | |
| 701 | The authentication types tested are: |
| 702 | EAP-TLS |
| 703 | EAP-TTLS with MSCHAPV2 as phase2. |
| 704 | |
| 705 | Procedures: |
| 706 | For each enterprise wifi network |
| 707 | 1. Connect to the network. |
| 708 | 2. Send a GET request to a website and check response. |
| 709 | 3. Toggle wifi. |
| 710 | 4. Ensure that the device reconnects to the same network. |
| 711 | |
| 712 | Expect: |
| 713 | Successful connection and Internet access through the enterprise |
| 714 | networks with passpoint support. |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 715 | """ |
| 716 | @test_tracker_info(uuid="5d5e6bb0-faea-4a6e-a6bc-c87de997a4fd") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 717 | def passpoint_connect_config_store_with_config_passpoint_tls(self): |
Roshan Pius | 58916a3 | 2016-06-16 16:26:44 -0700 | [diff] [blame] | 718 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 719 | "Passpoint is not supported on %s" % self.dut.model) |
| 720 | self.eap_connect_toggle_wifi(self.config_passpoint_tls, self.dut) |
| 721 | |
| 722 | @test_tracker_info(uuid="0c80262d-23c1-439f-ad64-7b8ada5d1962") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 723 | def passpoint_connect_config_store_with_config_passpoint_ttls_none(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 724 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 725 | "Passpoint is not supported on %s" % self.dut.model) |
| 726 | config = dict(self.config_passpoint_ttls) |
| 727 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.NONE.value |
| 728 | self.eap_connect_toggle_wifi(config, self.dut) |
| 729 | |
| 730 | @test_tracker_info(uuid="786e424c-b5a6-4fe9-a951-b3de16ebb6db") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 731 | def passpoint_connect_config_store_with_config_passpoint_ttls_pap(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 732 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 733 | "Passpoint is not supported on %s" % self.dut.model) |
| 734 | config = dict(self.config_passpoint_ttls) |
| 735 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.PAP.value |
| 736 | self.eap_connect_toggle_wifi(config, self.dut) |
| 737 | |
| 738 | @test_tracker_info(uuid="22fd61bf-722a-4016-a778-fc33e94ed211") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 739 | def passpoint_connect_config_store_with_config_passpoint_ttls_mschap(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 740 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 741 | "Passpoint is not supported on %s" % self.dut.model) |
| 742 | config = dict(self.config_passpoint_ttls) |
| 743 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAP.value |
| 744 | self.eap_connect_toggle_wifi(config, self.dut) |
| 745 | |
| 746 | @test_tracker_info(uuid="2abd348c-9c66-456b-88ad-55f971717620") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 747 | def passpoint_connect_config_store_with_config_passpoint_ttls_mschapv2(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 748 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 749 | "Passpoint is not supported on %s" % self.dut.model) |
| 750 | config = dict(self.config_passpoint_ttls) |
| 751 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.MSCHAPV2.value |
| 752 | self.eap_connect_toggle_wifi(config, self.dut) |
| 753 | |
| 754 | @test_tracker_info(uuid="043e8cdd-db95-4f03-b308-3c8cecf874b1") |
Girish Moturu | 89d8c7f | 2017-09-05 11:52:54 -0700 | [diff] [blame] | 755 | def passpoint_connect_config_store_with_config_passpoint_ttls_gtc(self): |
Girish Moturu | 9cc1cd1 | 2017-07-24 13:27:57 +0530 | [diff] [blame] | 756 | asserts.skip_if(not self.dut.droid.wifiIsPasspointSupported(), |
| 757 | "Passpoint is not supported on %s" % self.dut.model) |
| 758 | config = dict(self.config_passpoint_ttls) |
| 759 | config[WifiEnums.Enterprise.PHASE2] = WifiEnums.EapPhase2.GTC.value |
| 760 | self.eap_connect_toggle_wifi(config, self.dut) |