Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaircloth-splunk committed Feb 8, 2020
1 parent 30fd0f2 commit 09ed79e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ testpaths = tests
addopts =
-v --tb=long
--splunk_type=docker
--maxfail=1
--keepalive
--splunk_hec_token=1ec3c8ac-74b3-46f2-ba44-a7c96b6ab236
filterwarnings =
ignore::DeprecationWarning
junit_family=xunit1
13 changes: 8 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ def sc4s(request):


@pytest.fixture(scope="session")
def splunk_docker(request, docker_services, docker_ip):
def splunk_docker(request, docker_services):
docker_services.start('splunk')
port = docker_services.port_for("splunk", 8089)

splunk = {
'host': docker_ip,
'host': docker_services.docker_ip,
'port': port,
'username': request.config.getoption('splunk_user'),
'password': request.config.getoption('splunk_password'),
Expand All @@ -187,12 +188,14 @@ def splunk_external(request):


@pytest.fixture(scope="session")
def sc4s_docker(request, docker_services, docker_ip):
ports = { 514: docker_services.port_for("sc4s", 514) }
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)})

return docker_ip, ports
return docker_services.docker_ip, ports


@pytest.fixture(scope="session")
Expand Down
6 changes: 5 additions & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ services:
context: ../splunk
hostname: splunk
ports:
- "8000"
- "8000:8000"
- "8088"
- "8089"
environment:
- SPLUNK_HEC_TOKEN=${SPLUNK_HEC_TOKEN}
- SPLUNK_PASSWORD=${SPLUNK_PASSWORD}
- SPLUNK_START_ARGS=--accept-license
volumes:
- splunk-var:/opt/splunk/vars

volumes:
results:
external: false
splunk-var:
external: false

0 comments on commit 09ed79e

Please sign in to comment.