summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXianyuan Jia <xianyuanjia@google.com>2019-10-08 12:24:00 -0700
committerXianyuan Jia <xianyuanjia@google.com>2019-10-08 14:04:31 -0700
commit821cf57a483dd68c65ac06cb5216f63aab8d254e (patch)
tree216b9c0ba00e4bfed6198db3f8438d1ab8983d9f
parenta985509c5e2aae8e5bd3f81272006029a09b0566 (diff)
downloadplatform_tools_test_connectivity-821cf57a483dd68c65ac06cb5216f63aab8d254e.tar.gz
platform_tools_test_connectivity-821cf57a483dd68c65ac06cb5216f63aab8d254e.tar.bz2
platform_tools_test_connectivity-821cf57a483dd68c65ac06cb5216f63aab8d254e.zip
Replace defunct TestSkipClass signal with TestAbortClass
The TestAbortClass signal, when raised in setup_class, will immediately trigger class teardown, without logging the skipped test cases. This behavior will be addressed in a follow-up change Bug: 142158264 Test: local Change-Id: Ib2cfe8a08595675d741469b74757c08a0c84c250
-rwxr-xr-xacts/framework/acts/base_test.py2
-rw-r--r--acts/framework/acts/test_utils/tel/tel_test_utils.py4
-rw-r--r--acts/tests/google/ble/bt5/AdvertisingSetTest.py2
-rw-r--r--acts/tests/google/ble/bt5/Bt5ScanTest.py4
-rw-r--r--acts/tests/google/ble/bt5/PhyTest.py4
-rw-r--r--acts/tests/google/bt/ota/BtOtaTest.py4
-rw-r--r--acts/tests/google/fuchsia/examples/Sl4fSanityTest.py2
-rwxr-xr-xacts/tests/google/net/CoreNetworkingOTATest.py2
-rw-r--r--acts/tests/google/tel/live/TelLiveImsSettingsTest.py4
-rw-r--r--acts/tests/google/tel/live/TelLiveStressTest.py8
-rwxr-xr-xacts/tests/google/wifi/WifiAutoUpdateTest.py2
-rw-r--r--acts/tests/google/wifi/WifiCrashStressTest.py2
-rwxr-xr-xacts/tests/google/wifi/WifiTethering2GOpenOTATest.py2
-rwxr-xr-xacts/tests/google/wifi/WifiTethering2GPskOTATest.py2
-rwxr-xr-xacts/tests/google/wifi/WifiTethering5GOpenOTATest.py2
-rwxr-xr-xacts/tests/google/wifi/WifiTethering5GPskOTATest.py2
16 files changed, 25 insertions, 23 deletions
diff --git a/acts/framework/acts/base_test.py b/acts/framework/acts/base_test.py
index a0002acb66..4e3c4def61 100755
--- a/acts/framework/acts/base_test.py
+++ b/acts/framework/acts/base_test.py
@@ -893,6 +893,7 @@ class BaseTestClass(MoblyBaseTest):
self._block_all_test_cases(tests)
setup_fail = True
except signals.TestAbortClass:
+ self.log.exception('Test class %s aborted' % self.TAG)
setup_fail = True
except Exception as e:
self.log.exception("Failed to setup %s.", self.TAG)
@@ -911,6 +912,7 @@ class BaseTestClass(MoblyBaseTest):
self.exec_one_testcase(test_name, test_func, self.cli_args)
return self.results
except signals.TestAbortClass:
+ self.log.exception('Test class %s aborted' % self.TAG)
return self.results
except signals.TestAbortAll as e:
# Piggy-back test results on this exception object so we don't lose
diff --git a/acts/framework/acts/test_utils/tel/tel_test_utils.py b/acts/framework/acts/test_utils/tel/tel_test_utils.py
index be9ef847db..a4cb3f2248 100644
--- a/acts/framework/acts/test_utils/tel/tel_test_utils.py
+++ b/acts/framework/acts/test_utils/tel/tel_test_utils.py
@@ -3219,7 +3219,7 @@ def trigger_modem_crash_by_modem(ad, timeout=120):
def phone_switch_to_msim_mode(ad, retries=3, timeout=60):
result = False
if not ad.is_apk_installed("com.google.mdstest"):
- raise signals.TestSkipClass("mdstest is not installed")
+ raise signals.TestAbortClass("mdstest is not installed")
mode = ad.droid.telephonyGetPhoneCount()
if mode == 2:
ad.log.info("Device already in MSIM mode")
@@ -3262,7 +3262,7 @@ def phone_switch_to_msim_mode(ad, retries=3, timeout=60):
def phone_switch_to_ssim_mode(ad, retries=3, timeout=30):
result = False
if not ad.is_apk_installed("com.google.mdstest"):
- raise signals.TestSkipClass("mdstest is not installed")
+ raise signals.TestAbortClass("mdstest is not installed")
mode = ad.droid.telephonyGetPhoneCount()
if mode == 1:
ad.log.info("Device already in SSIM mode")
diff --git a/acts/tests/google/ble/bt5/AdvertisingSetTest.py b/acts/tests/google/ble/bt5/AdvertisingSetTest.py
index da54b1d88d..de4192f125 100644
--- a/acts/tests/google/ble/bt5/AdvertisingSetTest.py
+++ b/acts/tests/google/ble/bt5/AdvertisingSetTest.py
@@ -67,7 +67,7 @@ class AdvertisingSetTest(BluetoothBaseTest):
self.adv_ad = self.android_devices[0]
if not self.adv_ad.droid.bluetoothIsLeExtendedAdvertisingSupported():
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Advertiser does not support LE Extended Advertising")
def teardown_test(self):
diff --git a/acts/tests/google/ble/bt5/Bt5ScanTest.py b/acts/tests/google/ble/bt5/Bt5ScanTest.py
index 4caa376422..e2c9c83cc3 100644
--- a/acts/tests/google/ble/bt5/Bt5ScanTest.py
+++ b/acts/tests/google/ble/bt5/Bt5ScanTest.py
@@ -66,11 +66,11 @@ class Bt5ScanTest(BluetoothBaseTest):
self.adv_ad = self.android_devices[1]
if not self.scn_ad.droid.bluetoothIsLeExtendedAdvertisingSupported():
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Scanner does not support LE Extended Advertising")
if not self.adv_ad.droid.bluetoothIsLeExtendedAdvertisingSupported():
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Advertiser does not support LE Extended Advertising")
def teardown_test(self):
diff --git a/acts/tests/google/ble/bt5/PhyTest.py b/acts/tests/google/ble/bt5/PhyTest.py
index 9b95ead0f5..0b1ecfade8 100644
--- a/acts/tests/google/ble/bt5/PhyTest.py
+++ b/acts/tests/google/ble/bt5/PhyTest.py
@@ -42,11 +42,11 @@ class PhyTest(GattConnectedBaseTest):
def setup_class(self):
super(PhyTest, self).setup_class()
if not self.cen_ad.droid.bluetoothIsLe2MPhySupported():
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Central device does not support LE 2M PHY")
if not self.per_ad.droid.bluetoothIsLe2MPhySupported():
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Peripheral device does not support LE 2M PHY")
# Some controllers auto-update PHY to 2M, and both client and server
diff --git a/acts/tests/google/bt/ota/BtOtaTest.py b/acts/tests/google/bt/ota/BtOtaTest.py
index 91e51bb7f7..86e3098c19 100644
--- a/acts/tests/google/bt/ota/BtOtaTest.py
+++ b/acts/tests/google/bt/ota/BtOtaTest.py
@@ -32,14 +32,14 @@ class BtOtaTest(BluetoothBaseTest):
# Pairing devices
if not pair_pri_to_sec(self.dut, self.android_devices[1]):
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed to bond devices prior to update")
#Run OTA below, if ota fails then abort all tests
try:
ota_updater.update(self.dut)
except Exception as err:
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed up apply OTA update. Aborting tests")
@BluetoothBaseTest.bt_test_wrap
diff --git a/acts/tests/google/fuchsia/examples/Sl4fSanityTest.py b/acts/tests/google/fuchsia/examples/Sl4fSanityTest.py
index a66e1f2c9c..d2116a9b32 100644
--- a/acts/tests/google/fuchsia/examples/Sl4fSanityTest.py
+++ b/acts/tests/google/fuchsia/examples/Sl4fSanityTest.py
@@ -39,7 +39,7 @@ class Sl4fSanityTest(BaseTestClass):
if len(self.fuchsia_devices) > 0:
self.log.info(success_str)
else:
- raise signals.TestSkipClass("err_str")
+ raise signals.TestAbortClass("err_str")
def test_example(self):
self.log.info("Congratulations! You've run your first test.")
diff --git a/acts/tests/google/net/CoreNetworkingOTATest.py b/acts/tests/google/net/CoreNetworkingOTATest.py
index 2444971a87..5b350f88f9 100755
--- a/acts/tests/google/net/CoreNetworkingOTATest.py
+++ b/acts/tests/google/net/CoreNetworkingOTATest.py
@@ -84,7 +84,7 @@ class CoreNetworkingOTATest(BaseTestClass):
for ad in self.android_devices:
ota_updater.update(ad)
except Exception as err:
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed up apply OTA update. Aborting tests")
def on_fail(self, test_name, begin_time):
diff --git a/acts/tests/google/tel/live/TelLiveImsSettingsTest.py b/acts/tests/google/tel/live/TelLiveImsSettingsTest.py
index 64f81cad33..7a6d384f4b 100644
--- a/acts/tests/google/tel/live/TelLiveImsSettingsTest.py
+++ b/acts/tests/google/tel/live/TelLiveImsSettingsTest.py
@@ -86,9 +86,9 @@ class TelLiveImsSettingsTest(TelephonyBaseTest):
subid].get("capabilities", [])
self.dut.log.info("DUT capabilities: %s", self.dut_capabilities)
if CAPABILITY_VOLTE not in self.dut_capabilities:
- raise signals.TestSkipClass("VoLTE is not supported")
+ raise signals.TestAbortClass("VoLTE is not supported")
if CAPABILITY_WFC not in self.dut_capabilities:
- raise signals.TestSkipClass("WFC is not supported")
+ raise signals.TestAbortClass("WFC is not supported")
self.default_volte = (CAPABILITY_VOLTE in self.dut_capabilities) and (
self.carrier_configs[CarrierConfigs.
diff --git a/acts/tests/google/tel/live/TelLiveStressTest.py b/acts/tests/google/tel/live/TelLiveStressTest.py
index 28b03b08f8..6a4276d357 100644
--- a/acts/tests/google/tel/live/TelLiveStressTest.py
+++ b/acts/tests/google/tel/live/TelLiveStressTest.py
@@ -1103,7 +1103,7 @@ class TelLiveStressTest(TelephonyBaseTest):
def test_lte_volte_parallel_stress(self):
""" VoLTE on stress test"""
if CAPABILITY_VOLTE not in self.dut_capabilities:
- raise signals.TestSkipClass("VoLTE is not supported")
+ raise signals.TestAbortClass("VoLTE is not supported")
return self.parallel_tests(
setup_func=self._setup_lte_volte_enabled,
call_verification_func=is_phone_in_call_volte)
@@ -1121,7 +1121,7 @@ class TelLiveStressTest(TelephonyBaseTest):
def test_wfc_parallel_stress(self):
""" Wifi calling APM mode off stress test"""
if CAPABILITY_WFC not in self.dut_capabilities:
- raise signals.TestSkipClass("WFC is not supported")
+ raise signals.TestAbortClass("WFC is not supported")
if WFC_MODE_WIFI_PREFERRED not in self.dut_wfc_modes:
raise signals.TestSkip("WFC_MODE_WIFI_PREFERRED is not supported")
return self.parallel_tests(
@@ -1133,7 +1133,7 @@ class TelLiveStressTest(TelephonyBaseTest):
def test_wfc_apm_parallel_stress(self):
""" Wifi calling in APM mode on stress test"""
if CAPABILITY_WFC not in self.dut_capabilities:
- raise signals.TestSkipClass("WFC is not supported")
+ raise signals.TestAbortClass("WFC is not supported")
return self.parallel_tests(
setup_func=self._setup_wfc_apm,
call_verification_func=is_phone_in_call_iwlan)
@@ -1159,7 +1159,7 @@ class TelLiveStressTest(TelephonyBaseTest):
def test_volte_modeprefchange_parallel_stress(self):
""" VoLTE Mode Pref call stress test"""
if CAPABILITY_VOLTE not in self.dut_capabilities:
- raise signals.TestSkipClass("VoLTE is not supported")
+ raise signals.TestAbortClass("VoLTE is not supported")
return self.parallel_with_network_change_tests(
setup_func=self._setup_lte_volte_enabled)
diff --git a/acts/tests/google/wifi/WifiAutoUpdateTest.py b/acts/tests/google/wifi/WifiAutoUpdateTest.py
index 04fb85055f..33369a2775 100755
--- a/acts/tests/google/wifi/WifiAutoUpdateTest.py
+++ b/acts/tests/google/wifi/WifiAutoUpdateTest.py
@@ -93,7 +93,7 @@ class WifiAutoUpdateTest(WifiBaseTest):
try:
ota_updater.update(self.dut)
except Exception as err:
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed up apply OTA update. Aborting tests")
def setup_test(self):
diff --git a/acts/tests/google/wifi/WifiCrashStressTest.py b/acts/tests/google/wifi/WifiCrashStressTest.py
index bf17ada37e..837112a62c 100644
--- a/acts/tests/google/wifi/WifiCrashStressTest.py
+++ b/acts/tests/google/wifi/WifiCrashStressTest.py
@@ -41,7 +41,7 @@ class WifiCrashStressTest(WifiBaseTest):
wutils.wifi_test_device_init(self.dut)
wutils.wifi_test_device_init(self.dut_client)
if not self.dut.is_apk_installed("com.google.mdstest"):
- raise signals.TestSkipClass("mdstest is not installed")
+ raise signals.TestAbortClass("mdstest is not installed")
req_params = ["dbs_supported_models", "stress_count"]
opt_param = ["reference_networks"]
self.unpack_userparams(
diff --git a/acts/tests/google/wifi/WifiTethering2GOpenOTATest.py b/acts/tests/google/wifi/WifiTethering2GOpenOTATest.py
index a603e017fa..0716158327 100755
--- a/acts/tests/google/wifi/WifiTethering2GOpenOTATest.py
+++ b/acts/tests/google/wifi/WifiTethering2GOpenOTATest.py
@@ -52,7 +52,7 @@ class WifiTethering2GOpenOTATest(BaseTestClass):
try:
ota_updater.update(self.hotspot_device)
except Exception as err:
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed up apply OTA update. Aborting tests")
def on_fail(self, test_name, begin_time):
diff --git a/acts/tests/google/wifi/WifiTethering2GPskOTATest.py b/acts/tests/google/wifi/WifiTethering2GPskOTATest.py
index e9fedcd24c..7399e32879 100755
--- a/acts/tests/google/wifi/WifiTethering2GPskOTATest.py
+++ b/acts/tests/google/wifi/WifiTethering2GPskOTATest.py
@@ -52,7 +52,7 @@ class WifiTethering2GPskOTATest(BaseTestClass):
try:
ota_updater.update(self.hotspot_device)
except Exception as err:
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed up apply OTA update. Aborting tests")
def on_fail(self, test_name, begin_time):
diff --git a/acts/tests/google/wifi/WifiTethering5GOpenOTATest.py b/acts/tests/google/wifi/WifiTethering5GOpenOTATest.py
index 6648d0e461..985e7a759a 100755
--- a/acts/tests/google/wifi/WifiTethering5GOpenOTATest.py
+++ b/acts/tests/google/wifi/WifiTethering5GOpenOTATest.py
@@ -52,7 +52,7 @@ class WifiTethering5GOpenOTATest(BaseTestClass):
try:
ota_updater.update(self.hotspot_device)
except Exception as err:
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed up apply OTA update. Aborting tests")
def on_fail(self, test_name, begin_time):
diff --git a/acts/tests/google/wifi/WifiTethering5GPskOTATest.py b/acts/tests/google/wifi/WifiTethering5GPskOTATest.py
index 74505787ff..9e68f2200a 100755
--- a/acts/tests/google/wifi/WifiTethering5GPskOTATest.py
+++ b/acts/tests/google/wifi/WifiTethering5GPskOTATest.py
@@ -52,7 +52,7 @@ class WifiTethering5GPskOTATest(BaseTestClass):
try:
ota_updater.update(self.hotspot_device)
except Exception as err:
- raise signals.TestSkipClass(
+ raise signals.TestAbortClass(
"Failed up apply OTA update. Aborting tests")
def on_fail(self, test_name, begin_time):