diff --git a/.vib/nats/goss/goss.yaml b/.vib/nats/goss/goss.yaml new file mode 100644 index 000000000000..befb84a6d2d5 --- /dev/null +++ b/.vib/nats/goss/goss.yaml @@ -0,0 +1,12 @@ +gossfile: + # Goss tests exclusive to the current container + ../../nats/goss/nats.yaml: {} + # 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-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/nats/goss/nats.yaml b/.vib/nats/goss/nats.yaml new file mode 100644 index 000000000000..0016db6f604b --- /dev/null +++ b/.vib/nats/goss/nats.yaml @@ -0,0 +1,19 @@ +command: + check-nats-server: + exec: timeout --preserve-status 5 nats-server + timeout: 10000 + exit-status: 1 + stderr: + - "Listening for client connections" + - "Server is ready" +file: + /opt/bitnami/nats/conf/nats-server.conf: + exists: true + filetype: file + mode: "0664" + contains: + - /listen.*4222/ + /opt/bitnami/nats/logs/nats-server.log: + exists: true + filetype: symlink + linked-to: /dev/stdout diff --git a/.vib/nats/goss/vars.yaml b/.vib/nats/goss/vars.yaml new file mode 100644 index 000000000000..cbbda9abab8c --- /dev/null +++ b/.vib/nats/goss/vars.yaml @@ -0,0 +1,18 @@ +binaries: + - nats-server + - render-template +directories: + - mode: "0775" + paths: + - /bitnami/nats + - /bitnami/nats/data + - /bitnami/nats/conf + - /opt/bitnami/nats + - /opt/bitnami/nats/conf + - /opt/bitnami/nats/logs + - /opt/bitnami/nats/tmp + - /docker-entrypoint-initdb.d +root_dir: /opt/bitnami +version: + bin_name: nats-server + flag: --version diff --git a/.vib/nats/vib-publish.json b/.vib/nats/vib-publish.json index 8b6fe8eab4e6..b76fd9f51b71 100644 --- a/.vib/nats/vib-publish.json +++ b/.vib/nats/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": "nats/goss/goss.yaml", + "vars_file": "nats/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-nats" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/nats/vib-verify.json b/.vib/nats/vib-verify.json index a34e8aee9161..4b221e985291 100644 --- a/.vib/nats/vib-verify.json +++ b/.vib/nats/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": "nats/goss/goss.yaml", + "vars_file": "nats/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-nats" + } + } + } + }, { "action_id": "trivy", "params": {