Skip to content

Commit

Permalink
fix migrate from uuid to shortuuid
Browse files Browse the repository at this point in the history
  • Loading branch information
ikheifets-splunk committed Aug 28, 2023
1 parent 3b20434 commit 8d4e05f
Show file tree
Hide file tree
Showing 88 changed files with 346 additions and 342 deletions.
4 changes: 2 additions & 2 deletions docs/resources/test_vmware_carbonblack_with_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause

import uuid
import shortuuid
from jinja2 import Environment, select_autoescape

from .sendmessage import sendsingle
Expand All @@ -20,7 +20,7 @@
def test_vmware_carbonblack_protect(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down
10 changes: 9 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ python = "^3.9"
Jinja2 = "^3.1.2"
sqlitedict = "^2.0.0"
requests = "^2.28.1"
shortuuid = "^1.0.11"


[tool.poetry.dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import uuid
import socket
import uuid
import shortuuid
from time import sleep

import pytest
Expand All @@ -16,7 +16,7 @@

@pytest.fixture
def get_host_key():
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

return host

Expand Down
1 change: 0 additions & 1 deletion tests/test_arista.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
import pytest
import uuid

from jinja2 import Environment, select_autoescape

Expand Down
2 changes: 1 addition & 1 deletion tests/test_aruba_clearpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause

import uuid
import shortuuid

from jinja2 import Environment, select_autoescape

Expand Down
2 changes: 1 addition & 1 deletion tests/test_avi_vantage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause

import uuid
import shortuuid

from jinja2 import Environment, select_autoescape

Expand Down
4 changes: 2 additions & 2 deletions tests/test_barracuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
import uuid
import shortuuid
import pytest
from jinja2 import Environment, select_autoescape

Expand All @@ -15,7 +15,7 @@
env = Environment(autoescape=select_autoescape(default_for_string=False))
#486 <132>1 2022-04-05T19:56:42.387000Z Barracuda - - - src=10.1.1.1 spt=33217 dst=10.1.1.1 dpt=39971 actionTaken=DENY attackDescription=GEO_IP_BLOCK attackDetails=GeoIP Policy Match attackGroup=Forceful Browsing attackId=1111 logType=WF app=TLSv1.2 request=/apps/ requestMethod=GET rt=1649197620642 userAgent=Mozilla/5.0 [en] (X11, U; OpenVAS-VT 9.0.3) referer=
def test_barracuda(record_property, setup_splunk, setup_sc4s):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down
34 changes: 17 additions & 17 deletions tests/test_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
import uuid
import shortuuid
import random

from jinja2 import Environment, select_autoescape
Expand All @@ -20,7 +20,7 @@
def test_checkpoint_splunk_ips(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_checkpoint_splunk_ips(
def test_checkpoint_splunk_firewall(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_checkpoint_splunk_firewall(
def test_checkpoint_splunk_firewall_noise(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_checkpoint_splunk_firewall_noise(
def test_checkpoint_splunk_firewall2(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_checkpoint_splunk_firewall2(
def test_checkpoint_vsplunk_firewall(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -195,7 +195,7 @@ def test_checkpoint_vsplunk_firewall(
def test_checkpoint_splunk_mds(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -230,7 +230,7 @@ def test_checkpoint_splunk_mds(
def test_checkpoint_splunk_cpmi(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_checkpoint_splunk_cpmi(
def test_checkpoint_splunk_web_api(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -300,7 +300,7 @@ def test_checkpoint_splunk_web_api(
def test_checkpoint_splunk_smartconsole(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -335,7 +335,7 @@ def test_checkpoint_splunk_smartconsole(
def test_checkpoint_splunk_os(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"
pid = random.randint(1000, 32000)

mt = env.from_string(
Expand Down Expand Up @@ -363,7 +363,7 @@ def test_checkpoint_splunk_os(
def test_checkpoint_splunk_os_nested(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -399,7 +399,7 @@ def test_checkpoint_splunk_os_nested(
def test_checkpoint_splunk_Endpoint_Management(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -435,7 +435,7 @@ def test_checkpoint_splunk_Endpoint_Management(
def test_checkpoint_splunk_ios_profile(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -471,7 +471,7 @@ def test_checkpoint_splunk_ios_profile(
def test_checkpoint_splunk_SmartUpdate(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -506,7 +506,7 @@ def test_checkpoint_splunk_SmartUpdate(
def test_checkpoint_splunk_Endpoint_Compliance(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -541,7 +541,7 @@ def test_checkpoint_splunk_Endpoint_Compliance(
def test_checkpoint_splunk_Mobile_Access(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down
24 changes: 12 additions & 12 deletions tests/test_checkpoint_syslog_rfc5424.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause

import uuid
import shortuuid
from jinja2 import Environment, select_autoescape

from .sendmessage import sendsingle
Expand All @@ -19,7 +19,7 @@
def test_checkpoint_syslog_anti_malware(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -55,7 +55,7 @@ def test_checkpoint_syslog_anti_malware(
def test_checkpoint_syslog_threat_emulation(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_checkpoint_syslog_threat_emulation(
def test_checkpoint_syslog_url_filtering(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_checkpoint_syslog_url_filtering(
def test_checkpoint_syslog_vpn_and_firewall(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -167,7 +167,7 @@ def test_checkpoint_syslog_vpn_and_firewall(
def test_checkpoint_syslog_web_api_internal(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -199,7 +199,7 @@ def test_checkpoint_syslog_web_api_internal(
def test_checkpoint_syslog_cli(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_checkpoint_syslog_cli(
def test_checkpoint_syslog_iOS_profiles(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -273,7 +273,7 @@ def test_checkpoint_syslog_iOS_profiles(
def test_checkpoint_syslog_Endpoint_Compliance(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -305,7 +305,7 @@ def test_checkpoint_syslog_Endpoint_Compliance(
def test_checkpoint_syslog_Endpoint(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -339,7 +339,7 @@ def test_checkpoint_syslog_Endpoint(
def test_checkpoint_syslog_Identity_Awareness(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down Expand Up @@ -375,7 +375,7 @@ def test_checkpoint_syslog_Identity_Awareness(
def test_checkpoint_syslog_Mobile_Access(
record_property, setup_splunk, setup_sc4s
):
host = f"{uuid.uuid4().hex}"
host = f"{shortuuid.ShortUUID().random(length=5).lower()}-{shortuuid.ShortUUID().random(length=5).lower()}"

dt = datetime.datetime.now()
iso, bsd, time, date, tzoffset, tzname, epoch = time_operations(dt)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cisco_ace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
import uuid
import shortuuid

from jinja2 import Environment, select_autoescape

Expand Down
Loading

0 comments on commit 8d4e05f

Please sign in to comment.