Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest-splunk-addon==5.4.1
splunk-add-on-ucc-framework==5.58.0
splunk-add-on-ucc-modinput-test==1.0.0
splunk-add-on-ucc-modinput-test==2.0.0
8 changes: 3 additions & 5 deletions tests/ucc_modinput_functional/splunk/forges.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,10 @@ def another_account(


def another_account_index(
splunk_client: SplunkClient,
splunk_client: SplunkClient, test_id: str, datatype: str = None
) -> Generator[Dict[str, str], None, None]:
index_name = f"idx_mit_another_account_{utils.Common().sufix}"
splunk_client.create_index(
index_name,
)
index_name = f"idx_mit_another_account_{test_id}".lower()
splunk_client.create_index(index_name, datatype)
yield {"another_account_index_name": index_name}


Expand Down
7 changes: 6 additions & 1 deletion tests/ucc_modinput_functional/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def test_accounts(
assert actual_another_account["api_key"] == defaults.ENCRYPTED_VALUE


# Test all types of indexes
@pytest.mark.parametrize("datatype", ["event", "metric"])
@bootstrap(
forge(
set_loglevel,
Expand All @@ -72,9 +74,12 @@ def test_accounts(
# if more indexes are needed, they can be created as well
),
)
def test_indexes(splunk_client: SplunkClient, another_account_index_name: str) -> None:
def test_indexes(
splunk_client: SplunkClient, another_account_index_name: str, datatype: str
) -> None:
actual_index = splunk_client.get_index(
another_account_index_name,
)
assert actual_index is not None
assert actual_index.name == another_account_index_name
assert actual_index.content["datatype"] == datatype