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