Skip to content

Commit

Permalink
Merge pull request #315 from splunk/fix/port-perf
Browse files Browse the repository at this point in the history
Update conftest.py to improve performance on catalina
  • Loading branch information
Ryan Faircloth authored and GitHub committed Feb 10, 2020
2 parents 59487cd + 3009652 commit 6220604
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import splunklib.client as client



@pytest.fixture(scope="module")
def setup_wordlist():
path_to_current_file = os.path.realpath(__file__)
Expand Down Expand Up @@ -128,14 +127,17 @@ def docker_compose_file(pytestconfig):

return os.path.join(str(pytestconfig.invocation_dir), "tests", "docker-compose.yml")


@pytest.fixture(scope="session")
def splunk(request):
if request.config.getoption('splunk_type') == 'external':
request.fixturenames.append('splunk_external')
splunk = request.getfixturevalue("splunk_external")
elif request.config.getoption('splunk_type') == 'docker':
os.environ['SPLUNK_PASSWORD'] = request.config.getoption('splunk_password')
os.environ['SPLUNK_HEC_TOKEN'] = request.config.getoption('splunk_hec_token')
os.environ['SPLUNK_PASSWORD'] = request.config.getoption(
'splunk_password')
os.environ['SPLUNK_HEC_TOKEN'] = request.config.getoption(
'splunk_hec_token')
request.fixturenames.append('splunk_docker')
splunk = request.getfixturevalue("splunk_docker")
else:
Expand Down Expand Up @@ -193,8 +195,8 @@ def sc4s_docker(docker_services):
docker_services.start('sc4s')

ports = {514: docker_services.port_for("sc4s", 514)}
for x in range(5000, 5050):
ports.update({ x: docker_services.port_for("sc4s", x)})
for x in range(5000, 5006):
ports.update({x: docker_services.port_for("sc4s", x)})

return docker_services.docker_ip, ports

Expand Down

0 comments on commit 6220604

Please sign in to comment.