From 13d210754fb70a9ca40eb509a7ee5a9a2ad962a3 Mon Sep 17 00:00:00 2001 From: Michiel Date: Mon, 22 May 2023 13:14:35 +0200 Subject: [PATCH] [bitnami/airflow-worker] Add VIB tests (#31100) * [bitnami/airflow-worker] Add VIB tests Signed-off-by: Michiel --- .vib/airflow-worker/goss/airflow-worker.yaml | 18 +++++++++++ .vib/airflow-worker/goss/goss.yaml | 12 +++++++ .vib/airflow-worker/goss/vars.yaml | 34 ++++++++++++++++++++ .vib/airflow-worker/vib-publish.json | 18 ++++++++++- .vib/airflow-worker/vib-verify.json | 18 ++++++++++- 5 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 .vib/airflow-worker/goss/airflow-worker.yaml create mode 100644 .vib/airflow-worker/goss/goss.yaml create mode 100644 .vib/airflow-worker/goss/vars.yaml diff --git a/.vib/airflow-worker/goss/airflow-worker.yaml b/.vib/airflow-worker/goss/airflow-worker.yaml new file mode 100644 index 000000000000..fdd70e7579d1 --- /dev/null +++ b/.vib/airflow-worker/goss/airflow-worker.yaml @@ -0,0 +1,18 @@ +command: + check-airflow: + timeout: 30000 + exec: airflow users list + exit-status: 0 + stdout: + - No data found + check-subpackages: + # Check python packages that should have been installed + exec: . /opt/bitnami/airflow/venv/bin/activate && pip list + exit-status: 0 + stdout: + {{ range $subpackage := .Vars.subpackages }} + - {{ $subpackage }} + {{ end }} +file: + /opt/bitnami/airflow/venv/lib/python3.9/site-packages/airflow/www/node_modules: + exists: false diff --git a/.vib/airflow-worker/goss/goss.yaml b/.vib/airflow-worker/goss/goss.yaml new file mode 100644 index 000000000000..dcfa6b4db264 --- /dev/null +++ b/.vib/airflow-worker/goss/goss.yaml @@ -0,0 +1,12 @@ +gossfile: + # Goss tests exclusive to the current container + ../../airflow-worker/goss/airflow-worker.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/airflow-worker/goss/vars.yaml b/.vib/airflow-worker/goss/vars.yaml new file mode 100644 index 000000000000..d886bab03064 --- /dev/null +++ b/.vib/airflow-worker/goss/vars.yaml @@ -0,0 +1,34 @@ +binaries: + - airflow + - ini-file + - psql + - python + - wait-for-port +linked_libraries: + exclude_paths: + # Ignore python venv executable scripts + - /opt/bitnami/airflow/venv/.* +directories: + - mode: "0775" + paths: + - /opt/bitnami/airflow + - /opt/bitnami/airflow/dags + - /opt/bitnami/airflow/logs + - /opt/bitnami/airflow/tmp +root_dir: /opt/bitnami +version: + bin_name: airflow + flag: version +subpackages: + - async + - amazon + - celery + - /cncf.kubernetes/ + - docker + - hashicorp + - ldap + - google + - /microsoft.azure/ + - mysql + - postgres + - redis diff --git a/.vib/airflow-worker/vib-publish.json b/.vib/airflow-worker/vib-publish.json index 1e2aad8ef471..69102de2c3c7 100644 --- a/.vib/airflow-worker/vib-publish.json +++ b/.vib/airflow-worker/vib-publish.json @@ -3,7 +3,8 @@ "resources": { "url": "{VIB_ENV_CONTAINER_URL}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -32,6 +33,21 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "airflow-worker/goss/goss.yaml", + "vars_file": "airflow-worker/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-airflow-worker" + } + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/airflow-worker/vib-verify.json b/.vib/airflow-worker/vib-verify.json index a34e8aee9161..811728674a25 100644 --- a/.vib/airflow-worker/vib-verify.json +++ b/.vib/airflow-worker/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": "airflow-worker/goss/goss.yaml", + "vars_file": "airflow-worker/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-airflow-worker" + } + } + } + }, { "action_id": "trivy", "params": {