From e22c314f1060825532a64a9ab60cdd7592edd0a0 Mon Sep 17 00:00:00 2001 From: Michiel Date: Tue, 30 May 2023 18:32:13 +0200 Subject: [PATCH] [bitnami/argo-cd] Add VIB tests (#34279) * [bitnami/argo-cd] Add VIB tests Signed-off-by: Michiel --- .vib/argo-cd/goss/argo-cd.yaml | 16 ++++++++++++++++ .vib/argo-cd/goss/goss.yaml | 11 +++++++++++ .vib/argo-cd/goss/vars.yaml | 19 +++++++++++++++++++ .vib/argo-cd/vib-publish.json | 18 +++++++++++++++++- .vib/argo-cd/vib-verify.json | 18 +++++++++++++++++- 5 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 .vib/argo-cd/goss/argo-cd.yaml create mode 100644 .vib/argo-cd/goss/goss.yaml create mode 100644 .vib/argo-cd/goss/vars.yaml diff --git a/.vib/argo-cd/goss/argo-cd.yaml b/.vib/argo-cd/goss/argo-cd.yaml new file mode 100644 index 000000000000..c926c9d64929 --- /dev/null +++ b/.vib/argo-cd/goss/argo-cd.yaml @@ -0,0 +1,16 @@ +command: + check-app-version: + # argocd version exits with exit code 1 + exec: argocd version + exit-status: 1 + stdout: + - {{ .Env.APP_VERSION }} +file: + /opt/bitnami/argo-cd/bin/argocd-server: + exists: true + filetype: symlink + linked-to: "/opt/bitnami/argo-cd/bin/argocd" + /opt/bitnami/argo-cd/bin/argocd-util: + exists: true + filetype: symlink + linked-to: "/opt/bitnami/argo-cd/bin/argocd" diff --git a/.vib/argo-cd/goss/goss.yaml b/.vib/argo-cd/goss/goss.yaml new file mode 100644 index 000000000000..9930b75be0d0 --- /dev/null +++ b/.vib/argo-cd/goss/goss.yaml @@ -0,0 +1,11 @@ +gossfile: + # Goss tests exclusive to the current container + ../../argo-cd/goss/argo-cd.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-binaries.yaml: {} + ../../common/goss/templates/check-broken-symlinks.yaml: {} + ../../common/goss/templates/check-ca-certs.yaml: {} + ../../common/goss/templates/check-directories.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/argo-cd/goss/vars.yaml b/.vib/argo-cd/goss/vars.yaml new file mode 100644 index 000000000000..cf8f2408f638 --- /dev/null +++ b/.vib/argo-cd/goss/vars.yaml @@ -0,0 +1,19 @@ +binaries: + - argocd + - argocd-server + - argocd-util +directories: + - paths: + - /.argocd + - /app/config/gpg/keys + - /app/config/gpg/source + - /bitnami/argocd + mode: "0775" + - paths: + - /opt/bitnami/argo-cd/app + - /opt/bitnami/argo-cd/bin +root_dir: /opt/bitnami +sed_in_place: + exclude_paths: + # Ignore hack directory (not bitnami-related) + - /opt/bitnami/argo-cd/hack diff --git a/.vib/argo-cd/vib-publish.json b/.vib/argo-cd/vib-publish.json index 8b6fe8eab4e6..e2cdb5933d97 100644 --- a/.vib/argo-cd/vib-publish.json +++ b/.vib/argo-cd/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": "argo-cd/goss/goss.yaml", + "vars_file": "argo-cd/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-argo-cd" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/argo-cd/vib-verify.json b/.vib/argo-cd/vib-verify.json index a34e8aee9161..d8934ab80bc3 100644 --- a/.vib/argo-cd/vib-verify.json +++ b/.vib/argo-cd/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": "argo-cd/goss/goss.yaml", + "vars_file": "argo-cd/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-argo-cd" + } + } + } + }, { "action_id": "trivy", "params": {