diff --git a/.vib/aspnet-core/goss/aspnet-core.yaml b/.vib/aspnet-core/goss/aspnet-core.yaml new file mode 100644 index 000000000000..82ece86d1485 --- /dev/null +++ b/.vib/aspnet-core/goss/aspnet-core.yaml @@ -0,0 +1,18 @@ +command: + check-bin-caps: + exec: getcap {{ .Vars.root_dir }}/aspnet-core/bin/dotnet + stdout: + - {{ .Vars.binary.capabilities }} + exit-status: 0 + check-installed-runtimes: + exec: dotnet --list-runtimes + stdout: + - AspNetCore.App {{ .Env.APP_VERSION }} + - NETCore.App {{ .Env.APP_VERSION }} + exit-status: 0 +file: + # Checks the postunpack phase properly creates the lib's symlink + /lib64/libz.so: + exists: true + filetype: symlink + linked-to: /usr/lib/libz.so.1 diff --git a/.vib/aspnet-core/goss/goss.yaml b/.vib/aspnet-core/goss/goss.yaml new file mode 100644 index 000000000000..f3bd4d4db199 --- /dev/null +++ b/.vib/aspnet-core/goss/goss.yaml @@ -0,0 +1,11 @@ +gossfile: + # Goss tests exclusive to the current container + ../../aspnet-core/goss/aspnet-core.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: {} diff --git a/.vib/aspnet-core/goss/vars.yaml b/.vib/aspnet-core/goss/vars.yaml new file mode 100644 index 000000000000..c50c3059b437 --- /dev/null +++ b/.vib/aspnet-core/goss/vars.yaml @@ -0,0 +1,15 @@ +binaries: + - dotnet +directories: + - paths: + - /app + mode: "0775" + - paths: + - /opt/bitnami/aspnet-core/bin/host + - /opt/bitnami/aspnet-core/bin/shared +root_dir: /opt/bitnami +version: + bin_name: dotnet + flag: --info +binary: + capabilities: cap_net_bind_service=eip diff --git a/.vib/aspnet-core/vib-publish.json b/.vib/aspnet-core/vib-publish.json index c3b18078c0ce..e23501b8957f 100644 --- a/.vib/aspnet-core/vib-publish.json +++ b/.vib/aspnet-core/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,19 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "aspnet-core/goss/goss.yaml", + "vars_file": "aspnet-core/goss/vars.yaml", + "remote": { + "workload": "deploy-aspnet-core" + } + } + }, { "action_id": "trivy", "params": { diff --git a/.vib/aspnet-core/vib-verify.json b/.vib/aspnet-core/vib-verify.json index 835cd556e241..63ecf12fe6e6 100644 --- a/.vib/aspnet-core/vib-verify.json +++ b/.vib/aspnet-core/vib-verify.json @@ -3,7 +3,8 @@ "resources": { "url": "{SHA_ARCHIVE}", "path": "{VIB_ENV_PATH}" - } + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" }, "phases": { "package": { @@ -29,6 +30,19 @@ }, "verify": { "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "aspnet-core/goss/goss.yaml", + "vars_file": "aspnet-core/goss/vars.yaml", + "remote": { + "workload": "deploy-aspnet-core" + } + } + }, { "action_id": "trivy", "params": { @@ -50,4 +64,4 @@ ] } } -} \ No newline at end of file +}