From b140a8104fc5694c0104fbd35127d2476b374189 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 11 Aug 2022 12:00:35 -0700 Subject: [PATCH] ssh: tests: functional: Keep service enabled after tests Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/ssh/tests/test_functional.py | 9 +++++++++ plinth/tests/functional/__init__.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/plinth/modules/ssh/tests/test_functional.py b/plinth/modules/ssh/tests/test_functional.py index 262d0918c..5c7e051bf 100644 --- a/plinth/modules/ssh/tests/test_functional.py +++ b/plinth/modules/ssh/tests/test_functional.py @@ -14,6 +14,15 @@ class TestSshApp(BaseAppTests): app_name = 'ssh' has_service = True has_web = False + disable_after_tests = False # TODO: Improve test_backup_restore to actually check that earlier # ssh certificate has been restored. + + def test_enable_disable(self, session_browser): + """Skip test for enabling and disabling the app.""" + pytest.skip('Avoid restarting SSH server') + + def test_backup_restore(self, session_browser): + """Skip test for backup and restore operations.""" + pytest.skip('Avoid restarting SSH server') diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index c36e6753b..325df70a3 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -609,6 +609,7 @@ class BaseAppTests: has_web = True check_diagnostics = True diagnostics_delay = 0 + disable_after_tests = True def assert_app_running(self, session_browser): """Assert that the app is running.""" @@ -634,7 +635,8 @@ class BaseAppTests: app_enable(session_browser, self.app_name) yield login(session_browser) - app_disable(session_browser, self.app_name) + if self.disable_after_tests: + app_disable(session_browser, self.app_name) def test_enable_disable(self, session_browser): """Test enabling and disabling the app."""