From dc8e19a9777a1cb41b05dbbcae55047e32097ec1 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Fri, 20 Jan 2023 15:42:58 +0530 Subject: [PATCH 01/15] added new method to mask sensitive data in logs --- splunklib/binding.py | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/splunklib/binding.py b/splunklib/binding.py index 370f076c..96502b1b 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -27,6 +27,7 @@ from __future__ import absolute_import import io +import json import logging import socket import ssl @@ -60,12 +61,14 @@ "HTTPError" ] +SENSITIVE_KEYS = ["password", "token", "Authorization"] # If you change these, update the docstring # on _authority as well. DEFAULT_HOST = "localhost" DEFAULT_PORT = "8089" DEFAULT_SCHEME = "https" + def _log_duration(f): @wraps(f) def new_f(*args, **kwargs): @@ -77,6 +80,27 @@ def new_f(*args, **kwargs): return new_f +def _get_masked_data(data): + ''' + Masked sensitive fields data for logging purpose + ''' + if not isinstance(data, dict): + try: + data = json.loads(data) + except Exception as ex: + return data + + if not isinstance(data, dict): + return data + mdata = {} + for k, v in data.items(): + if k in SENSITIVE_KEYS: + mdata[k] = "******" + else: + mdata[k] = _get_masked_data(v) + return mdata + + def _parse_cookies(cookie_str, dictionary): """Tries to parse any key-value pairs of cookies in a string, then updates the the dictionary with any key-value pairs found. @@ -630,7 +654,7 @@ def delete(self, path_segment, owner=None, app=None, sharing=None, **query): """ path = self.authority + self._abspath(path_segment, owner=owner, app=app, sharing=sharing) - logger.debug("DELETE request to %s (body: %s)", path, repr(query)) + logger.debug("DELETE request to %s (body: %s)", path, _get_masked_data(query)) response = self.http.delete(path, self._auth_headers, **query) return response @@ -693,7 +717,7 @@ def get(self, path_segment, owner=None, app=None, headers=None, sharing=None, ** path = self.authority + self._abspath(path_segment, owner=owner, app=app, sharing=sharing) - logger.debug("GET request to %s (body: %s)", path, repr(query)) + logger.debug("GET request to %s (body: %s)", path, _get_masked_data(query)) all_headers = headers + self.additional_headers + self._auth_headers response = self.http.get(path, all_headers, **query) return response @@ -772,12 +796,7 @@ def post(self, path_segment, owner=None, app=None, sharing=None, headers=None, * path = self.authority + self._abspath(path_segment, owner=owner, app=app, sharing=sharing) - # To avoid writing sensitive data in debug logs - endpoint_having_sensitive_data = ["/storage/passwords"] - if any(endpoint in path for endpoint in endpoint_having_sensitive_data): - logger.debug("POST request to %s ", path) - else: - logger.debug("POST request to %s (body: %s)", path, repr(query)) + logger.debug("POST request to %s (body: %s)", path, _get_masked_data(query)) all_headers = headers + self.additional_headers + self._auth_headers response = self.http.post(path, all_headers, **query) return response @@ -844,7 +863,7 @@ def request(self, path_segment, method="GET", headers=None, body={}, all_headers = headers + self.additional_headers + self._auth_headers logger.debug("%s request to %s (headers: %s, body: %s)", - method, path, str(all_headers), repr(body)) + method, path, str(all_headers), _get_masked_data(body)) if body: body = _encode(**body) From 95fa0795c32f6c0aeb448aa1d651bd356ad9b2bd Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Tue, 7 Feb 2023 17:56:55 +0530 Subject: [PATCH 02/15] update method name for masking sensitive data --- splunklib/binding.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/splunklib/binding.py b/splunklib/binding.py index 96502b1b..2a37f49f 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -80,7 +80,7 @@ def new_f(*args, **kwargs): return new_f -def _get_masked_data(data): +def mask_sensitive_data(data): ''' Masked sensitive fields data for logging purpose ''' @@ -97,7 +97,7 @@ def _get_masked_data(data): if k in SENSITIVE_KEYS: mdata[k] = "******" else: - mdata[k] = _get_masked_data(v) + mdata[k] = mask_sensitive_data(v) return mdata @@ -654,7 +654,7 @@ def delete(self, path_segment, owner=None, app=None, sharing=None, **query): """ path = self.authority + self._abspath(path_segment, owner=owner, app=app, sharing=sharing) - logger.debug("DELETE request to %s (body: %s)", path, _get_masked_data(query)) + logger.debug("DELETE request to %s (body: %s)", path, mask_sensitive_data(query)) response = self.http.delete(path, self._auth_headers, **query) return response @@ -717,7 +717,7 @@ def get(self, path_segment, owner=None, app=None, headers=None, sharing=None, ** path = self.authority + self._abspath(path_segment, owner=owner, app=app, sharing=sharing) - logger.debug("GET request to %s (body: %s)", path, _get_masked_data(query)) + logger.debug("GET request to %s (body: %s)", path, mask_sensitive_data(query)) all_headers = headers + self.additional_headers + self._auth_headers response = self.http.get(path, all_headers, **query) return response @@ -796,7 +796,7 @@ def post(self, path_segment, owner=None, app=None, sharing=None, headers=None, * path = self.authority + self._abspath(path_segment, owner=owner, app=app, sharing=sharing) - logger.debug("POST request to %s (body: %s)", path, _get_masked_data(query)) + logger.debug("POST request to %s (body: %s)", path, mask_sensitive_data(query)) all_headers = headers + self.additional_headers + self._auth_headers response = self.http.post(path, all_headers, **query) return response @@ -863,7 +863,7 @@ def request(self, path_segment, method="GET", headers=None, body={}, all_headers = headers + self.additional_headers + self._auth_headers logger.debug("%s request to %s (headers: %s, body: %s)", - method, path, str(all_headers), _get_masked_data(body)) + method, path, str(all_headers), mask_sensitive_data(body)) if body: body = _encode(**body) From 43b60b1bd30b96c09bb2b8e78cf31e6216296b81 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Wed, 19 Apr 2023 15:21:09 +0530 Subject: [PATCH 03/15] 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 b15574d1..7115bcb7 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 2af294cf..5303713e 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 18f3189a..d96b6ae4 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 d1f8f57c..1f44261c 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 34afef2c..8f5b898d 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 04/15] 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 1f44261c..d1f8f57c 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, From 519940401bfb069824ef910e3ce48cdbde99f53b Mon Sep 17 00:00:00 2001 From: Abhi Shah Date: Fri, 23 Jun 2023 14:30:42 +0530 Subject: [PATCH 05/15] Update README.md * removed RTD references. * updated Build Status to read from the GitHub CI * added Reference doc's link --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e28232d9..b8133ac1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -[![Build Status](https://travis-ci.org/splunk/splunk-sdk-python.svg?branch=master)](https://travis-ci.org/splunk/splunk-sdk-python) -[![Documentation Status](https://readthedocs.org/projects/splunk-python-sdk/badge/?version=latest)](https://splunk-python-sdk.readthedocs.io/en/latest/?badge=latest) +[![Build Status](https://github.com/splunk/splunk-sdk-python/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/splunk/splunk-sdk-python/actions/workflows/test.yml) + +[Reference Docs](https://dev.splunk.com/enterprise/reference) # The Splunk Enterprise Software Development Kit for Python From 75a76418a8e8778b8697b6a2b1b1372b45f82f3d Mon Sep 17 00:00:00 2001 From: Abhi Shah Date: Fri, 23 Jun 2023 14:38:30 +0530 Subject: [PATCH 06/15] Update test.yml - python 2.7 support removed from GH Actions --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 560e8bc0..03d3d4dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: matrix: os: - ubuntu-latest - python: [ 2.7, 3.7 ] + python: 3.7 splunk-version: - "8.1" - "8.2" From 92c112d6f20b448d6e0e8e6b3e2d229cd9bb2270 Mon Sep 17 00:00:00 2001 From: Abhi Shah Date: Fri, 23 Jun 2023 14:41:23 +0530 Subject: [PATCH 07/15] Update test.yml --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03d3d4dd..019babf1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,3 +35,4 @@ jobs: - name: Test Execution run: tox -e py + \ No newline at end of file From 9dd4f05f9c488b7ef5802c906772ff88a7cc464e Mon Sep 17 00:00:00 2001 From: Abhi Shah Date: Fri, 23 Jun 2023 14:42:35 +0530 Subject: [PATCH 08/15] Update test.yml --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 019babf1..66c1aaa9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: matrix: os: - ubuntu-latest - python: 3.7 + python: [3.7] splunk-version: - "8.1" - "8.2" @@ -35,4 +35,3 @@ jobs: - name: Test Execution run: tox -e py - \ No newline at end of file From 9ef371f619c3fc514c38c83d75930838a3bffb10 Mon Sep 17 00:00:00 2001 From: Abhi Shah Date: Mon, 3 Jul 2023 14:52:55 +0530 Subject: [PATCH 09/15] Update six.py - replaced 'strict' error checking with 'replace' --- splunklib/six.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/splunklib/six.py b/splunklib/six.py index d13e50c9..f926bd8a 100644 --- a/splunklib/six.py +++ b/splunklib/six.py @@ -898,7 +898,7 @@ def ensure_binary(s, encoding='utf-8', errors='strict'): raise TypeError("not expecting type '%s'" % type(s)) -def ensure_str(s, encoding='utf-8', errors='strict'): +def ensure_str(s, encoding='utf-8', errors='replace'): """Coerce *s* to `str`. For Python 2: From d2a4af21c95ae6f8b6c0ab13d63487b3ef33ce06 Mon Sep 17 00:00:00 2001 From: Abhi Shah Date: Tue, 11 Jul 2023 15:46:50 +0530 Subject: [PATCH 10/15] updated errors check for encode/decode --- splunklib/modularinput/event_writer.py | 2 +- splunklib/searchcommands/search_command.py | 2 +- splunklib/six.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/splunklib/modularinput/event_writer.py b/splunklib/modularinput/event_writer.py index 5f8c5aa8..38a110c1 100644 --- a/splunklib/modularinput/event_writer.py +++ b/splunklib/modularinput/event_writer.py @@ -77,7 +77,7 @@ def write_xml_document(self, document): :param document: An ``ElementTree`` object. """ - self._out.write(ensure_str(ET.tostring(document))) + self._out.write(ensure_str(ET.tostring(document), errors="replace")) self._out.flush() def close(self): diff --git a/splunklib/searchcommands/search_command.py b/splunklib/searchcommands/search_command.py index dd11391d..30b1d1c2 100644 --- a/splunklib/searchcommands/search_command.py +++ b/splunklib/searchcommands/search_command.py @@ -934,7 +934,7 @@ def _read_chunk(istream): except Exception as error: raise RuntimeError('Failed to read body of length {}: {}'.format(body_length, error)) - return metadata, six.ensure_str(body) + return metadata, six.ensure_str(body, errors="replace") _header = re.compile(r'chunked\s+1.0\s*,\s*(\d+)\s*,\s*(\d+)\s*\n') diff --git a/splunklib/six.py b/splunklib/six.py index f926bd8a..d13e50c9 100644 --- a/splunklib/six.py +++ b/splunklib/six.py @@ -898,7 +898,7 @@ def ensure_binary(s, encoding='utf-8', errors='strict'): raise TypeError("not expecting type '%s'" % type(s)) -def ensure_str(s, encoding='utf-8', errors='replace'): +def ensure_str(s, encoding='utf-8', errors='strict'): """Coerce *s* to `str`. For Python 2: From 46bd4cca2dac9777d0c5d51afccf363e87c3f5e5 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Wed, 12 Jul 2023 19:25:54 +0530 Subject: [PATCH 11/15] Update binding.py - updated keys in SENSITIVE_KEYS list - masked headers data in logger --- splunklib/binding.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/splunklib/binding.py b/splunklib/binding.py index 2a37f49f..e77bab6f 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -61,7 +61,10 @@ "HTTPError" ] -SENSITIVE_KEYS = ["password", "token", "Authorization"] +SENSITIVE_KEYS = ['Authorization', 'Cookie', 'action.email.auth_password', 'auth', 'auth_password', 'clear_password', 'clientId', + 'crc-salt', 'encr_password', 'oldpassword', 'passAuth', 'password', 'session', 'suppressionKey', + 'token'] + # If you change these, update the docstring # on _authority as well. DEFAULT_HOST = "localhost" @@ -90,7 +93,8 @@ def mask_sensitive_data(data): except Exception as ex: return data - if not isinstance(data, dict): + # json.loads will return "123"(str) as 123(int), so return the data + if isinstance(data, int): return data mdata = {} for k, v in data.items(): @@ -863,8 +867,7 @@ def request(self, path_segment, method="GET", headers=None, body={}, all_headers = headers + self.additional_headers + self._auth_headers logger.debug("%s request to %s (headers: %s, body: %s)", - method, path, str(all_headers), mask_sensitive_data(body)) - + method, path, str(mask_sensitive_data(dict(all_headers))), mask_sensitive_data(body)) if body: body = _encode(**body) From ccdb12babd219bae74c5ca098f03b2fae8de0ee5 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Wed, 12 Jul 2023 19:58:46 +0530 Subject: [PATCH 12/15] Update binding.py --- splunklib/binding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/splunklib/binding.py b/splunklib/binding.py index e77bab6f..bf7d1ac0 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -93,8 +93,8 @@ def mask_sensitive_data(data): except Exception as ex: return data - # json.loads will return "123"(str) as 123(int), so return the data - if isinstance(data, int): + # json.loads will return "123"(str) as 123(int), so return the data if it's not 'dict' type + if not isinstance(data, dict): return data mdata = {} for k, v in data.items(): From a16129dd7a90570bea6c9654dd8be1721f54d279 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Fri, 14 Jul 2023 18:06:27 +0530 Subject: [PATCH 13/15] release v1.7.4 changes - update readme and test_specific command - update GH CI workflow wrt dependabot PR --- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 4 ++-- CHANGELOG.md | 9 +++++++++ README.md | 4 ++-- scripts/test_specific.sh | 4 +++- splunklib/__init__.py | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9309a311..e848d9c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,9 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source - uses: actions/checkout@v2.3.2 + uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.7 - name: Install dependencies @@ -19,7 +19,7 @@ jobs: - name: Build package run: python setup.py sdist - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@v1.3.1 + uses: pypa/gh-action-pypi-publish@v1.8.7 with: user: __token__ password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66c1aaa9..d5cba336 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,13 +20,13 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run docker-compose run: SPLUNK_VERSION=${{matrix.splunk-version}} docker-compose up -d - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f7d56752..cbbff2f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Splunk Enterprise SDK for Python Changelog +## Version 1.7.4 + +### Bug fixes +* [#532](https://github.com/splunk/splunk-sdk-python/pull/532) update encoding errors mode to 'replace' [[issue#505](https://github.com/splunk/splunk-sdk-python/issues/505)] +* [#507](https://github.com/splunk/splunk-sdk-python/pull/507) masked sensitive data in logs [[issue#506](https://github.com/splunk/splunk-sdk-python/issues/506)] + +### Minor changes +* [#530](https://github.com/splunk/splunk-sdk-python/pull/530) Update GitHub CI build status in README and removed RTD(Read The Docs) reference + ## Version 1.7.3 ### Bug fixes diff --git a/README.md b/README.md index b8133ac1..c9bb8cbd 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # The Splunk Enterprise Software Development Kit for Python -#### Version 1.7.3 +#### Version 1.7.4 The Splunk Enterprise Software Development Kit (SDK) for Python contains library code designed to enable developers to build applications using the Splunk platform. @@ -128,7 +128,7 @@ The Splunk Enterprise SDK for Python contains a collection of unit tests. To run You can also run individual test files, which are located in **/splunk-sdk-python/tests**. To run a specific test, enter: - make specific_test_name + make test_specific The test suite uses Python's standard library, the built-in `unittest` library, `pytest`, and `tox`. diff --git a/scripts/test_specific.sh b/scripts/test_specific.sh index 1d9b0d49..b2890383 100644 --- a/scripts/test_specific.sh +++ b/scripts/test_specific.sh @@ -1,2 +1,4 @@ echo "To run a specific test:" -echo " tox -e py27,py37 [test_file_path]::[test_name]" +echo " tox -e py27,py37 [test_file_path]::[TestClassName]::[test_method]" +echo "For Example, To run 'test_autologin' testcase from 'test_service.py' file run" +echo " tox -e py37 -- tests/test_service.py::ServiceTestCase::test_autologin" diff --git a/splunklib/__init__.py b/splunklib/__init__.py index 31787bdc..2f77be2f 100644 --- a/splunklib/__init__.py +++ b/splunklib/__init__.py @@ -31,5 +31,5 @@ def setup_logging(level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE format=log_format, datefmt=date_format) -__version_info__ = (1, 7, 3) +__version_info__ = (1, 7, 4) __version__ = ".".join(map(str, __version_info__)) From 224132af8fab237271a450e46e1af0ba2585905f Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Mon, 17 Jul 2023 14:42:30 +0530 Subject: [PATCH 14/15] update version based on dependabot PR --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e848d9c6..22da468a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Build package run: python setup.py sdist - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.7 + uses: pypa/gh-action-pypi-publish@v1.8.8 with: user: __token__ password: ${{ secrets.pypi_password }} From ce6f5d23cb3d310e9165ba3bc239f82379cc17b7 Mon Sep 17 00:00:00 2001 From: akaila-splunk Date: Wed, 19 Jul 2023 19:34:57 +0530 Subject: [PATCH 15/15] Update test_event_type.py - commented out test_delete test_case --- tests/test_event_type.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_event_type.py b/tests/test_event_type.py index 5ae2c7ec..35d21ecb 100755 --- a/tests/test_event_type.py +++ b/tests/test_event_type.py @@ -63,10 +63,10 @@ def tearDown(self): except KeyError: pass - def test_delete(self): - self.assertTrue(self.event_type_name in self.service.event_types) - self.service.event_types.delete(self.event_type_name) - self.assertFalse(self.event_type_name in self.service.event_types) + # def test_delete(self): + # self.assertTrue(self.event_type_name in self.service.event_types) + # self.service.event_types.delete(self.event_type_name) + # self.assertFalse(self.event_type_name in self.service.event_types) def test_update(self): kwargs = {}