Skip to content

Commit

Permalink
Add test to verify dependencies
Browse files Browse the repository at this point in the history
Checks if the dependencies of:
- gvm-libs
- openvas-smb
- openvas-scanner
play nicely together and double checks that
openvas-smb is linked to the openvas binary.
  • Loading branch information
nichtsfrei committed Jan 16, 2025
1 parent e719ae3 commit a6b543d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .docker/railguards/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Railguards

As long as openvas is a distributed monolith in
- greenbone/gvm-libs
- greenbone/openvas-smb
- greenbone/openvas-scanner

we need to verify that the dependencies play nicely together on our target:

- debian:stable

**WARNING** The Dockerfiles within this folder are not meant to be used outside of this very specific test case.
27 changes: 27 additions & 0 deletions .docker/railguards/debian_stable.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This Dockerfile is not meant to be actually used, it is meant for testing
# the integrity when building:
# - gvm-libs
# - openvas-smb
# - openvas-scanner
#
# together from a main branch.
#
# If it builds without error everything is as expected.
FROM debian:stable
# CLONE gvm-libs
# CLONE openvas-smb
# Install dependencies
# check ld
COPY . /source
RUN apt update && apt install -y git
RUN bash /source/.devcontainer/github-clone.sh greenbone/gvm-libs
RUN bash /source/.devcontainer/github-clone.sh greenbone/openvas-smb
# tests implicitely if there are dependencies conflicts
RUN sh /workspaces/greenbone/gvm-libs/.github/install-dependencies.sh
RUN sh /workspaces/greenbone/openvas-smb/.github/install-openvas-smb-dependencies.sh
RUN sh /source/.github/install-openvas-dependencies.sh
# build everything
RUN sh /source/.devcontainer/build-cmake-project.sh /workspaces/greenbone/gvm-libs
RUN sh /source/.devcontainer/build-cmake-project.sh /workspaces/greenbone/openvas-smb
RUN sh /source/.devcontainer/build-cmake-project.sh /source

15 changes: 15 additions & 0 deletions .github/workflows/functional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ on:
# It depends on build.yml that is controlled via control.yml
#
jobs:
# Tests that gvm-libs, openvas-smb and openvas dependencies work together and
# that openvas is buildable and integrates openvas-smb when available
distributed-monolith-railguard:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
system:
- debian_stable
steps:
- uses: actions/checkout@v4
- run: docker build -t test -f .docker/railguards/${{matrix.system}}.Dockerfile .
- run: docker run --rm test ldd /usr/local/sbin/openvas
- run: docker run --rm test ldd /usr/local/sbin/openvas | grep libopenvas_wmiclient
- run: docker rmi test || true
# TESTS that are possible before pushing an image
tests:
runs-on: ubuntu-latest
Expand Down

0 comments on commit a6b543d

Please sign in to comment.