Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaircloth-splunk committed Feb 6, 2020
1 parent 66738d8 commit 050bb95
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
34 changes: 6 additions & 28 deletions demo-with-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
63 changes: 21 additions & 42 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,82 +7,61 @@
#You should have received a copy of the CC0 legalcode along with this
#work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
version: "3.7"


services:
test:
build: ./tests

build: tests
links:
- splunk
- sc4s
environment:
- 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
- SC4S_LISTEN_CISCO_MERAKI_TCP_PORT=5003
- 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
34 changes: 1 addition & 33 deletions test-with-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 050bb95

Please sign in to comment.