From b1745aca797f089f6a5faf7e1e7adb47cb2c006f Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Wed, 3 Jan 2018 16:08:45 -0800 Subject: [PATCH] auto-t: stop AuthCenter on failures --- autotests/testEAP-AKA-ofono/connection_test.py | 7 +++++-- autotests/testEAP-AKA-prime-ofono/connection_test.py | 7 ++++++- autotests/testEAP-AKA-prime/connection_test.py | 7 +++++-- autotests/testEAP-AKA/connection_test.py | 7 +++++-- autotests/testEAP-SIM-ofono/connection_test.py | 7 +++++-- autotests/testEAP-SIM/connection_test.py | 7 +++++-- 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/autotests/testEAP-AKA-ofono/connection_test.py b/autotests/testEAP-AKA-ofono/connection_test.py index 3e94af44..688aeb1d 100644 --- a/autotests/testEAP-AKA-ofono/connection_test.py +++ b/autotests/testEAP-AKA-ofono/connection_test.py @@ -6,7 +6,6 @@ import sys sys.path.append('../util') import iwd from iwd import IWD -from iwd import PSKAgent from iwd import NetworkType from hlrauc import AuthCenter from ofono import Ofono @@ -43,7 +42,11 @@ class Test(unittest.TestCase): condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) - ordered_network.network_object.connect() + try: + ordered_network.network_object.connect() + except: + auth.stop() + raise condition = 'obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) diff --git a/autotests/testEAP-AKA-prime-ofono/connection_test.py b/autotests/testEAP-AKA-prime-ofono/connection_test.py index 3e94af44..8d621d4d 100644 --- a/autotests/testEAP-AKA-prime-ofono/connection_test.py +++ b/autotests/testEAP-AKA-prime-ofono/connection_test.py @@ -43,7 +43,11 @@ class Test(unittest.TestCase): condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) - ordered_network.network_object.connect() + try: + ordered_network.network_object.connect() + except: + auth.stop() + raise condition = 'obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) @@ -54,6 +58,7 @@ class Test(unittest.TestCase): wd.wait_for_object_condition(ordered_network.network_object, condition) auth.stop() + @classmethod def setUpClass(cls): IWD.copy_to_storage('ssidEAP-AKA.8021x') diff --git a/autotests/testEAP-AKA-prime/connection_test.py b/autotests/testEAP-AKA-prime/connection_test.py index dd8ae13d..5717ecbc 100644 --- a/autotests/testEAP-AKA-prime/connection_test.py +++ b/autotests/testEAP-AKA-prime/connection_test.py @@ -6,7 +6,6 @@ import sys sys.path.append('../util') import iwd from iwd import IWD -from iwd import PSKAgent from iwd import NetworkType from hlrauc import AuthCenter @@ -38,7 +37,11 @@ class Test(unittest.TestCase): condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) - ordered_network.network_object.connect() + try: + ordered_network.network_object.connect() + except: + auth.stop() + raise condition = 'obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) diff --git a/autotests/testEAP-AKA/connection_test.py b/autotests/testEAP-AKA/connection_test.py index dd8ae13d..5717ecbc 100644 --- a/autotests/testEAP-AKA/connection_test.py +++ b/autotests/testEAP-AKA/connection_test.py @@ -6,7 +6,6 @@ import sys sys.path.append('../util') import iwd from iwd import IWD -from iwd import PSKAgent from iwd import NetworkType from hlrauc import AuthCenter @@ -38,7 +37,11 @@ class Test(unittest.TestCase): condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) - ordered_network.network_object.connect() + try: + ordered_network.network_object.connect() + except: + auth.stop() + raise condition = 'obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) diff --git a/autotests/testEAP-SIM-ofono/connection_test.py b/autotests/testEAP-SIM-ofono/connection_test.py index 46bfd499..b35a6e26 100644 --- a/autotests/testEAP-SIM-ofono/connection_test.py +++ b/autotests/testEAP-SIM-ofono/connection_test.py @@ -6,7 +6,6 @@ import sys sys.path.append('../util') import iwd from iwd import IWD -from iwd import PSKAgent from iwd import NetworkType from hlrauc import AuthCenter from ofono import Ofono @@ -43,7 +42,11 @@ class Test(unittest.TestCase): condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) - ordered_network.network_object.connect() + try: + ordered_network.network_object.connect() + except: + auth.stop() + raise condition = 'obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) diff --git a/autotests/testEAP-SIM/connection_test.py b/autotests/testEAP-SIM/connection_test.py index c0305913..678e88b4 100644 --- a/autotests/testEAP-SIM/connection_test.py +++ b/autotests/testEAP-SIM/connection_test.py @@ -6,7 +6,6 @@ import sys sys.path.append('../util') import iwd from iwd import IWD -from iwd import PSKAgent from iwd import NetworkType from hlrauc import AuthCenter @@ -38,7 +37,11 @@ class Test(unittest.TestCase): condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) - ordered_network.network_object.connect() + try: + ordered_network.network_object.connect() + except: + auth.stop() + raise condition = 'obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition)