diff --git a/.circleci/config.yml b/.circleci/config.yml
index a616137..b182848 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -60,6 +60,60 @@
cat /tmp/goss.tmp | grep "[<\>]" > ~/project/test-results/goss.xml
- store_test_results:
path: test-results
+ test:
+ docker:
+ - image: circleci/buildpack-deps:stretch
+ steps:
+ - setup_remote_docker:
+ docker_layer_caching: true
+ - checkout
+ - run:
+ name: Docker Login
+ command: docker login -u $DOCKER_USER -p $DOCKER_PASS
+ - run:
+ name: Docker pull
+ command: docker pull $IMAGE_NAME:$CIRCLE_SHA1
+ - run:
+ name: Setup test volume
+ command: |
+ mkdir test-results
+ docker volume create sc4s-tests
+ docker volume create sc4s-results
+
+ docker container create --name dummy \
+ -v sc4s-tests:/work/tests \
+ -v sc4s-results:/work/test-results \
+ registry.access.redhat.com/ubi7/ubi
+ docker cp tests/ dummy:/work/tests/
+ docker rm dummy
+ - run:
+ name: Docker Compose build
+ command: |
+ docker-compose build \
+ --build-arg RH_ACTIVATION=$RH_ACTIVATION \
+ --build-arg RH_ORG=$RH_ORG
+ - run:
+ name: Docker Compose up
+ command: docker-compose up --abort-on-container-exit
+ - run:
+ name: Collect test results from Docker Compose
+ command: |
+ docker container create --name dummy \
+ -v sc4s-tests:/work/tests \
+ -v sc4s-results:/work/test-results \
+ registry.access.redhat.com/ubi7/ubi
+
+ docker cp dummy:/work/test-results/functional test-results
+ docker rm dummy
+ - run:
+ name: Cleanup volumes
+ command: |
+ docker volume rm sc4s-tests
+ docker volume rm sc4s-results
+ - store_test_results:
+ path: test-results
+
+
publish:
environment:
IMAGE_NAME: rfaircloth/scs
@@ -91,9 +145,13 @@
- dgoss:
requires:
- build
+ - test:
+ - requires:
+ - build
- publish:
requires:
- dgoss
+ - test
filters:
branches:
only:
diff --git a/.gitignore b/.gitignore
index 527731f..d3efeb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -305,3 +305,6 @@ tags
# Persistent undo
[._]*.un~
+/.env
+/test-results
+/.idea
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 3f7f406..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index aa62d56..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/sc4s.iml b/.idea/sc4s.iml
deleted file mode 100644
index 251be75..0000000
--- a/.idea/sc4s.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 53b20c8..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index 44b7535..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,612 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- pip
- yum
- java
- goss.y
- goss
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1561601135562
-
-
- 1561601135562
-
-
-
-
-
-
- 1561725354114
-
-
-
- 1561725354114
-
-
- 1561727911945
-
-
-
- 1561727911945
-
-
- 1561728088283
-
-
-
- 1561728088283
-
-
- 1561732858768
-
-
-
- 1561732858768
-
-
- 1561742879170
-
-
-
- 1561742879170
-
-
- 1561749672876
-
-
-
- 1561749672877
-
-
- 1561756254127
-
-
-
- 1561756254127
-
-
- 1561756480339
-
-
-
- 1561756480339
-
-
- 1561756707590
-
-
-
- 1561756707590
-
-
- 1561756813319
-
-
-
- 1561756813319
-
-
- 1561757391279
-
-
-
- 1561757391279
-
-
- 1561757671153
-
-
-
- 1561757671153
-
-
- 1561761791106
-
-
-
- 1561761791106
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- file://$PROJECT_DIR$/tests/test_poc.py
- 84
-
-
-
- file://$PROJECT_DIR$/tests/test_poc.py
- 33
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index bacc2d6..461faf4 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,7 +5,12 @@ services:
links:
- splunk
- sc4s
+ volumes:
+ - sc4s-tests:/work/tests
+ - sc4s-results:/work/test-results
+
sc4s:
+ image: rfaircloth/scs:master
build: ./package
hostname: sc4s
ports:
@@ -52,3 +57,8 @@ services:
# splunk-index: main
# splunk-insecureskipverify: true
# splunk-verify-connection: false
+volumes:
+ sc4s-tests:
+ external: true
+ sc4s-results:
+ external: true
diff --git a/test-with-compose.sh b/test-with-compose.sh
new file mode 100755
index 0000000..f426220
--- /dev/null
+++ b/test-with-compose.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+mkdir test-results
+docker volume create sc4s-tests
+docker volume create sc4s-results
+
+docker container create --name dummy \
+ -v sc4s-tests:/work/tests \
+ -v sc4s-results:/work/test-results \
+ registry.access.redhat.com/ubi7/ubi
+docker cp tests/ dummy:/work/tests/
+docker rm dummy
+
+docker-compose build --build-arg RH_ACTIVATION=$RH_ACTIVATION --build-arg RH_ORG=$RH_ORG
+docker-compose up --abort-on-container-exit --exit-code-from test
+
+docker container create --name dummy \
+ -v sc4s-tests:/work/tests \
+ -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
+
+
diff --git a/tests/Dockerfile b/tests/Dockerfile
index 695362a..99b98a6 100644
--- a/tests/Dockerfile
+++ b/tests/Dockerfile
@@ -3,5 +3,7 @@ FROM python:3.7
COPY requirements.txt /
RUN pip3 install -r /requirements.txt
-RUN mkdir /work
-CMD python pytest
+RUN mkdir -p /work/tests
+RUN mkdir -p /work/test-results/functional
+WORKDIR /work
+CMD cd /work;python -m pytest --junitxml=/work/test-results/functional/functional.xml