Skip to content

Commit 939616f

Browse files
feat!: Trigger UCC 6 release (#1920)
BREAKING CHANGE: Trigger UCC 6 release --------- Co-authored-by: hetangmodi-crest <[email protected]>
1 parent 89f0dfa commit 939616f

File tree

2 files changed

+21
-29
lines changed

2 files changed

+21
-29
lines changed

splunk_add_on_ucc_framework/const.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"arules",
3434
"associate",
3535
"autoregress",
36-
"awssnsalert",
3736
"bin",
3837
"bucket",
3938
"bucketdir",

tests/unit/test_const.py

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,39 @@
11
import re
22
import urllib.request
3-
import urllib.error
43

54
from splunk_add_on_ucc_framework.const import SPLUNK_COMMANDS
65

76

87
def test_command_list_up_to_date():
9-
url = "https://docs.splunk.com/Documentation/Splunk/latest/SearchReference"
10-
try:
11-
with urllib.request.urlopen(url) as resp:
12-
content = resp.read().decode()
13-
except urllib.error.HTTPError:
14-
# passing an imitation of browser header to make this a request from web browser
15-
headers = {
16-
"User-Agent": (
17-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
18-
"AppleWebKit/537.36 (KHTML, like Gecko) "
19-
"Chrome/115.0.0.0 Safari/537.36"
20-
)
21-
}
22-
23-
req = urllib.request.Request(url, headers=headers)
24-
25-
with urllib.request.urlopen(req) as resp:
26-
content = resp.read().decode()
27-
28-
match = re.search(r"Search\s+Commands.+?<ul.+?>(.+?)</ul>", content, re.S)
29-
if match:
30-
search_commands_ul = match.group(1)
31-
search_commands = re.findall(
32-
r"<li[^>]*>.*?<a[^>]*>\s*([^\s<]+)\s+?</a>", search_commands_ul, re.S
8+
url = "https://help.splunk.com/en/splunk-enterprise/search/spl-search-reference/10.0/search-commands"
9+
# passing an imitation of browser header to make this a request from web browser
10+
headers = {
11+
"User-Agent": (
12+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
13+
"AppleWebKit/537.36 (KHTML, like Gecko) "
14+
"Chrome/115.0.0.0 Safari/537.36"
3315
)
34-
else:
35-
search_commands_ul = None
36-
search_commands = []
16+
}
17+
18+
req = urllib.request.Request(url, headers=headers)
19+
20+
with urllib.request.urlopen(req) as resp:
21+
content = resp.read().decode()
22+
23+
search_commands = re.findall(
24+
r'splunk-enterprise/search/spl-search-reference/[^/]+/search-commands/([^"&]+)',
25+
content,
26+
)
27+
assert search_commands, "No search commands found on the Splunk documentation page"
3728

3829
# These are the search commands for the serviceNow add-on. They are not present by default in Splunk instance
3930
not_global_commands = [
4031
"snowincidentstream",
4132
"snoweventstream",
4233
"snowincident",
4334
"snowevent",
35+
"3rd-party-custom-commands",
36+
"awssnsalert",
4437
]
4538
for command in not_global_commands:
4639
search_commands.remove(command)

0 commit comments

Comments
 (0)