diff --git a/.circleci/config.yml b/.circleci/config.yml index 57dcdbe..7720f07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ test: &test docker cp dummy:/work/test-results/test.xml test-results/ - store_artifacts: path: test-results - destination: apptest-${SYSLOG}-${SPLUNK} + destination: test-results - store_test_results: path: test-results diff --git a/demo-with-compose.sh b/demo-with-compose.sh index 3e0f693..cba338c 100755 --- a/demo-with-compose.sh +++ b/demo-with-compose.sh @@ -4,35 +4,13 @@ #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 -WAITON=${1:-test} -compose=${2:-docker-compose-demo.yml} -echo $WAITON $compose -mkdir test-results -docker-compose down -docker volume rm sc4s-results -docker volume rm splunk-etc +export SPLUNK=8.0 +export SYSLOG=3.25.1 -docker volume create sc4s-results -docker volume create splunk-etc - -docker container create --name dummy \ - -v sc4s-results:/work/test-results \ - -v splunk-etc:/work/splunk-etc \ - registry.access.redhat.com/ubi7/ubi -docker cp ./splunk/etc/* dummy:/work/splunk-etc/ -docker rm dummy - -docker-compose -f $compose pull -docker-compose -f $compose up -d splunk -docker-compose -f $compose up -d sc4s +docker-compose build +docker-compose up -d splunk +docker-compose up -d sc4s sleep 60 -docker-compose -f $compose build -docker-compose -f $compose up - -docker container create --name dummy \ - -v sc4s-results:/work/test-results \ - registry.access.redhat.com/ubi7/ubi +docker-compose up -docker cp dummy:/work/test-results/functional test-results -docker rm dummy EXIT=$0 diff --git a/docker-compose.yml b/docker-compose.yml index d0dab92..0c106f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,10 +7,11 @@ #You should have received a copy of the CC0 legalcode along with this #work. If not, see . version: "3.7" + + services: test: - build: ./tests - + build: tests links: - splunk - sc4s @@ -18,34 +19,30 @@ services: - SPLUNK_USER=admin - SPLUNK_PASSWORD=${SPLUNK_PASSWORD} - SPLUNK_HOST=splunk - - SYSLOG_HOST=sc4s + - docke=sc4s sc4s: - image: splunk/scs:latest build: - context: ./package + context: package hostname: sc4s -#When this is enabled test_common will fail -# command: -det + #When this is enabled test_common will fail + # command: -det ports: - - "514:514" - - "601:601" - - "514:514/udp" - - "5000" - - "5000:5000/udp" - - "6514:6514" + - "514" + - "601" + - "514/udp" + - "5000-5050" + - "5000-5200/udp" + - "6514" stdin_open: true tty: true links: - splunk environment: - - SPLUNK_HEC_URL=${SPLUNK_HEC_URL} + - SPLUNK_HEC_URL=https://splunk:8088 - SPLUNK_HEC_TOKEN=${SPLUNK_HEC_TOKEN} - SC4S_SOURCE_TLS_ENABLE=no - SC4S_DEST_SPLUNK_HEC_TLS_VERIFY=no -# - SC4S_LISTEN_DEFAULT_TCP_PORT=514 -# - SC4S_LISTEN_DEFAULT_UDP_PORT=514 -# - SC4S_LISTEN_DEFAULT_TLS_PORT=6514 - SC4S_LISTEN_JUNIPER_NETSCREEN_TCP_PORT=5000 - SC4S_LISTEN_CISCO_ASA_TCP_PORT=5001 - SC4S_LISTEN_CISCO_IOS_TCP_PORT=5002 @@ -53,36 +50,18 @@ services: - SC4S_LISTEN_JUNIPER_IDP_TCP_PORT=5004 - SC4S_LISTEN_PALOALTO_PANOS_TCP_PORT=5005 - SC4S_LISTEN_PFSENSE_TCP_PORT=5006 - - SC4S_ARCHIVE_GLOBAL=yes -# - SC4S_SOURCE_STORE_RAWMSG=yes + - SC4S_ARCHIVE_GLOBAL=no volumes: - ./tls:/opt/syslog-ng/tls splunk: - image: splunk/splunk:latest + build: + context: splunk hostname: splunk ports: - - "8000:8000" - - "8088:8088" - - "8089:8089" + - "8000" + - "8088" + - "8089" environment: - SPLUNK_HEC_TOKEN=${SPLUNK_HEC_TOKEN} - SPLUNK_PASSWORD=${SPLUNK_PASSWORD} - - SPLUNK_START_ARGS=${SPLUNK_START_ARGS} - - SPLUNK_APPS_URL=${SPLUNK_APPS_URL} - - SPLUNKBASE_USERNAME=${SPLUNKBASE_USERNAME} - - SPLUNKBASE_PASSWORD=${SPLUNKBASE_PASSWORD} - volumes: - - splunk-etc:/opt/splunk/etc - pcapreplay: - build: - context: ./utility/pcapreplay - entrypoint: tail -f /dev/null - links: - - splunk - - sc4s - volumes: - - ./replay:/work - -volumes: - splunk-etc: - external: true + - SPLUNK_START_ARGS=--accept-license diff --git a/test-with-compose.sh b/test-with-compose.sh index 6ae13ba..27a367e 100755 --- a/test-with-compose.sh +++ b/test-with-compose.sh @@ -4,36 +4,4 @@ #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 -WAITON=${1:-test} -compose=${2:-docker-compose.yml} -echo $WAITON $compose -mkdir test-results -docker-compose down -docker volume rm sc4s-results -docker volume rm splunk-etc - -docker volume create sc4s-results -docker volume create splunk-etc - -docker container create --name dummy \ - -v sc4s-results:/work/test-results \ - -v splunk-etc:/work/splunk-etc \ - registry.access.redhat.com/ubi7/ubi -docker cp ./splunk/etc/* dummy:/work/splunk-etc/ -docker rm dummy - -docker-compose -f $compose pull splunk -docker-compose -f $compose build -docker-compose -f $compose up -d splunk -docker-compose -f $compose up -d sc4s -sleep 60 - -docker-compose -f $compose up --abort-on-container-exit --exit-code-from $WAITON - -docker container create --name dummy \ - -v sc4s-results:/work/test-results \ - registry.access.redhat.com/ubi7/ubi - -docker cp dummy:/work/test-results/functional test-results -docker rm dummy -EXIT=$0 +SPLUNK=8.0;SYSLOG=3.25.1 pytest --splunk_password=Changed@11 diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index b49d5a5..63f10dc 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -63,7 +63,7 @@ services: image: docker.pkg.github.com/splunk/splunk-connect-for-syslog/stg-splunk-connect-for-syslog:splunk-${SPLUNK}-${CIRCLE_SHA1} hostname: splunk ports: - - "8000" + - "8000:8000" - "8088" - "8089" environment: