From 8a7e506f0d576760ff0e04fc6d53aa61de9f86d0 Mon Sep 17 00:00:00 2001 From: corico44 <42420333+corico44@users.noreply.github.com> Date: Wed, 12 Apr 2023 16:23:28 +0200 Subject: [PATCH] [bitnami/gitlab-runner] Add VIB tests (#29326) * [bitnami/gitlab-runner] Check if gitlab-runner file exists Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Check text inside file for gitlab-runner test Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Add comment to try tests Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Delete comment to try tests Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Add check for gosu and remove checks for files Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Add version and sed checks Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Delete directories checker and check version Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Delete files checker Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Add change in docker-compose to trigger tests Signed-off-by: Cori Avila * [bitnami/gitlab-runner] Delete change in docker-compose Signed-off-by: Cori Avila --------- Signed-off-by: Cori Avila --- .vib/gitlab-runner/goss/goss.yaml | 9 +++++++++ .vib/gitlab-runner/goss/vars.yaml | 7 +++++++ .vib/gitlab-runner/vib-publish.json | 18 +++++++++++++++++- .vib/gitlab-runner/vib-verify.json | 18 +++++++++++++++++- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .vib/gitlab-runner/goss/goss.yaml create mode 100644 .vib/gitlab-runner/goss/vars.yaml diff --git a/.vib/gitlab-runner/goss/goss.yaml b/.vib/gitlab-runner/goss/goss.yaml new file mode 100644 index 000000000000..f93077f81df9 --- /dev/null +++ b/.vib/gitlab-runner/goss/goss.yaml @@ -0,0 +1,9 @@ +gossfile: + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-app-version.yaml: {} + ../../common/goss/templates/check-binaries.yaml: {} + ../../common/goss/templates/check-broken-symlinks.yaml: {} + ../../common/goss/templates/check-ca-certs.yaml: {} + ../../common/goss/templates/check-linked-libraries.yaml: {} + ../../common/goss/templates/check-sed-in-place.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/gitlab-runner/goss/vars.yaml b/.vib/gitlab-runner/goss/vars.yaml new file mode 100644 index 000000000000..ade85823476c --- /dev/null +++ b/.vib/gitlab-runner/goss/vars.yaml @@ -0,0 +1,7 @@ +binaries: + - gitlab-runner + - gosu +root_dir: /opt/bitnami +version: + bin_name: gitlab-runner + flag: -v \ No newline at end of file diff --git a/.vib/gitlab-runner/vib-publish.json b/.vib/gitlab-runner/vib-publish.json index 8b6fe8eab4e6..3cf525eabc01 100644 --- a/.vib/gitlab-runner/vib-publish.json +++ b/.vib/gitlab-runner/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -33,6 +34,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "gitlab-runner/goss/goss.yaml", + "vars_file": "gitlab-runner/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-gitlab-runner" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/gitlab-runner/vib-verify.json b/.vib/gitlab-runner/vib-verify.json index a34e8aee9161..df292f924911 100644 --- a/.vib/gitlab-runner/vib-verify.json +++ b/.vib/gitlab-runner/vib-verify.json @@ -3,7 +3,8 @@ "resources": { "url": "{SHA_ARCHIVE}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -29,6 +30,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "gitlab-runner/goss/goss.yaml", + "vars_file": "gitlab-runner/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-gitlab-runner" + } + } + } + }, { "action_id": "trivy", "params": {