Skip to content

Commit

Permalink
test: add integration testing for OVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
awilson-urbane authored and MaineK00n committed Feb 9, 2023
1 parent 6252278 commit 882f2a7
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Integration

on:
push:
schedule:
- cron: '0 0 * * 0' # Run weekly at midnight on Sunday

jobs:
integration:
name: Integration
runs-on: ubuntu-latest
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Integration Tests
run: make test-integration
19 changes: 18 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@
fmtcheck \
pretest \
test \
test-integration \
unused \
cov \
clean \
build-integration \
build-container \
clean-integration \
fetch-rdb \
fetch-redis \
diff-cveid \
diff-package \
diff-server-rdb \
diff-server-redis \
diff-server-rdb-redis
diff-server-rdb-redis \
start-postgres

SRCS = $(shell git ls-files '*.go')
PKGS = $(shell go list ./...)
Expand Down Expand Up @@ -68,6 +71,20 @@ pretest: lint vet fmtcheck
test: pretest
$(GO) test -cover -v ./... || exit;

test-integration-cleanup:
@docker-compose down

test-integration: start-postgres build-container run-update-alpine run-update-amazon run-update-debian run-update-fedora run-update-oracle run-update-redhat run-update-opensuse run-update-ubuntu test-integration-cleanup

start-postgres:
@docker-compose up -d postgres-oval

run-update-%:
@docker-compose up --exit-code-from=goval-updater-$(*) goval-updater-$(*)

build-container:
@docker build --no-cache -t local-goval .

unused:
$(foreach pkg,$(PKGS),unused $(pkg);)

Expand Down
180 changes: 180 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
version: "3.9"
services:

goval-server:
container_name: goval-server
image: local-goval
restart: always
networks:
- goval-tester
expose:
- "80"
command:
- "server"
- "--bind=0.0.0.0"
- "--port=80"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"

goval-updater-alpine:
container_name: goval-updater-alpine
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "alpine"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.15"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"

goval-updater-amazon:
container_name: goval-updater-amazon
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "amazon"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"

goval-updater-debian:
container_name: goval-updater-debian
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "debian"
- "7"
- "8"
- "9"
- "10"
- "11"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"

goval-updater-fedora:
container_name: goval-updater-fedora
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "fedora"
- "36"
- "37"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"

goval-updater-oracle:
container_name: goval-updater-oracle
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "oracle"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"


goval-updater-redhat:
container_name: goval-updater-redhat
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "redhat"
- "5"
- "6"
- "7"
- "8"
- "9"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"

goval-updater-opensuse:
container_name: goval-updater-suse
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "suse"
- "--suse-type"
- "opensuse"
- "10.2"
- "10.3"
- "11.0"
- "11.1"
- "11.2"
- "11.3"
- "11.4"
- "12.1"
- "12.2"
- "12.3"
- "13.1"
- "13.2"
- "tumbleweed"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"

goval-updater-ubuntu:
container_name: goval-updater-ubuntu
image: local-goval
restart: "no"
networks:
- goval-tester
command:
- "fetch"
- "ubuntu"
- "14"
- "16"
- "18"
- "19"
- "20"
- "21"
- "22"
- "--dbtype=postgres"
- "--dbpath=postgres://hello:world@postgres-oval:5432/goval"
- "--debug"

postgres-oval:
container_name: postgres-oval
image: postgres:14.1-alpine
restart: always
expose:
- "5432"
networks:
- goval-tester
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=world
- POSTGRES_USER=hello
- POSTGRES_DB=goval

networks:
goval-tester:

0 comments on commit 882f2a7

Please sign in to comment.