From 43b60b1bd30b96c09bb2b8e78cf31e6216296b81 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Wed, 19 Apr 2023 15:21:09 +0530 Subject: [PATCH 1/2] Marked newly added test cases for smoke test --- tests/searchcommands/test_csc_apps.py | 4 +++- tests/test_binding.py | 2 ++ tests/test_job.py | 2 ++ tests/test_saved_search.py | 3 +++ tests/test_service.py | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/searchcommands/test_csc_apps.py b/tests/searchcommands/test_csc_apps.py index b15574d1c..7115bcb7a 100755 --- a/tests/searchcommands/test_csc_apps.py +++ b/tests/searchcommands/test_csc_apps.py @@ -15,10 +15,12 @@ # under the License. import unittest +import pytest + from tests import testlib from splunklib import results - +@pytest.mark.smoke class TestCSC(testlib.SDKTestCase): def test_eventing_app(self): diff --git a/tests/test_binding.py b/tests/test_binding.py index 2af294cfd..5303713ec 100755 --- a/tests/test_binding.py +++ b/tests/test_binding.py @@ -641,6 +641,7 @@ def test_got_updated_cookie_with_get(self): self.assertEqual(list(new_cookies.values())[0], list(old_cookies.values())[0]) self.assertTrue(found) + @pytest.mark.smoke def test_login_fails_with_bad_cookie(self): # We should get an error if using a bad cookie try: @@ -649,6 +650,7 @@ def test_login_fails_with_bad_cookie(self): except AuthenticationError as ae: self.assertEqual(str(ae), "Login failed.") + @pytest.mark.smoke def test_login_with_multiple_cookies(self): # We should get an error if using a bad cookie new_context = binding.Context() diff --git a/tests/test_job.py b/tests/test_job.py index 18f3189a9..d96b6ae43 100755 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -57,6 +57,7 @@ def test_oneshot_with_garbage_fails(self): jobs = self.service.jobs self.assertRaises(TypeError, jobs.create, "abcd", exec_mode="oneshot") + @pytest.mark.smoke def test_oneshot(self): jobs = self.service.jobs stream = jobs.oneshot("search index=_internal earliest=-1m | head 3", output_mode='json') @@ -382,6 +383,7 @@ def test_search_invalid_query_as_json(self): except Exception as e: self.fail("Got some unexpected error. %s" % e.message) + @pytest.mark.smoke def test_v1_job_fallback(self): self.assertEventuallyTrue(self.job.is_done) self.assertLessEqual(int(self.job['eventCount']), 3) diff --git a/tests/test_saved_search.py b/tests/test_saved_search.py index d1f8f57c2..1f44261c5 100755 --- a/tests/test_saved_search.py +++ b/tests/test_saved_search.py @@ -223,6 +223,7 @@ def test_suppress(self): self.saved_search.unsuppress() self.assertEqual(self.saved_search['suppressed'], 0) + @pytest.mark.smoke def test_acl(self): self.assertEqual(self.saved_search.access["perms"], None) self.saved_search.acl_update(sharing="app", owner="admin", app="search", **{"perms.read": "admin, nobody"}) @@ -231,6 +232,7 @@ def test_acl(self): self.assertEqual(self.saved_search.access["sharing"], "app") self.assertEqual(self.saved_search.access["perms"]["read"], ['admin', 'nobody']) + @pytest.mark.smoke def test_acl_fails_without_sharing(self): self.assertRaisesRegex( ValueError, @@ -239,6 +241,7 @@ def test_acl_fails_without_sharing(self): owner="admin", app="search", **{"perms.read": "admin, nobody"} ) + @pytest.mark.smoke def test_acl_fails_without_owner(self): self.assertRaisesRegex( ValueError, diff --git a/tests/test_service.py b/tests/test_service.py index 34afef2c8..8f5b898dc 100755 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -15,6 +15,8 @@ # under the License. from __future__ import absolute_import +import pytest + from tests import testlib import unittest @@ -168,6 +170,7 @@ def _create_unauthenticated_service(self): }) # To check the HEC event endpoint using Endpoint instance + @pytest.mark.smoke def test_hec_event(self): import json service_hec = client.connect(host='localhost', scheme='https', port=8088, From 794f68ae00ee01e3c1693a62829848998721b7f3 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Wed, 19 Apr 2023 15:29:36 +0530 Subject: [PATCH 2/2] Update test_saved_search.py --- tests/test_saved_search.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/test_saved_search.py b/tests/test_saved_search.py index 1f44261c5..d1f8f57c2 100755 --- a/tests/test_saved_search.py +++ b/tests/test_saved_search.py @@ -223,7 +223,6 @@ def test_suppress(self): self.saved_search.unsuppress() self.assertEqual(self.saved_search['suppressed'], 0) - @pytest.mark.smoke def test_acl(self): self.assertEqual(self.saved_search.access["perms"], None) self.saved_search.acl_update(sharing="app", owner="admin", app="search", **{"perms.read": "admin, nobody"}) @@ -232,7 +231,6 @@ def test_acl(self): self.assertEqual(self.saved_search.access["sharing"], "app") self.assertEqual(self.saved_search.access["perms"]["read"], ['admin', 'nobody']) - @pytest.mark.smoke def test_acl_fails_without_sharing(self): self.assertRaisesRegex( ValueError, @@ -241,7 +239,6 @@ def test_acl_fails_without_sharing(self): owner="admin", app="search", **{"perms.read": "admin, nobody"} ) - @pytest.mark.smoke def test_acl_fails_without_owner(self): self.assertRaisesRegex( ValueError,