[bitnami/mysql] Add MySQL Helm Chart tests (#10818)

* Added antiflake pipeline

Signed-off-by: alukic <alukic@vmware.com>

* Diversified the pipeline

Signed-off-by: alukic <alukic@vmware.com>

* Make a change to trigger TKG

Signed-off-by: alukic <alukic@vmware.com>

* Replaced FIPS with normal AKS

Signed-off-by: alukic <alukic@vmware.com>

* Added extra workflow for Grafana Loki

Signed-off-by: alukic <alukic@vmware.com>

* Changed the pipeline

Signed-off-by: alukic <alukic@vmware.com>

* Modified the workflow

Signed-off-by: alukic <alukic@vmware.com>

* Removed Grafana Loki

Signed-off-by: alukic <alukic@vmware.com>

* Added the first Goss test

Signed-off-by: alukic <alukic@vmware.com>

* Remove the antiflake pipeline

Signed-off-by: alukic <alukic@vmware.com>

* Trigger VIB

Signed-off-by: alukic <alukic@vmware.com>

* Fix workload name

Signed-off-by: alukic <alukic@vmware.com>

* Changed runtime parameters and added more Goss tests

Signed-off-by: alukic <alukic@vmware.com>

* Change access mode

Signed-off-by: alukic <alukic@vmware.com>

* Undo test related changes

Signed-off-by: alukic <alukic@vmware.com>

* Applied CR suggestions

Signed-off-by: alukic <alukic@vmware.com>

* Trigger VIB changes

Signed-off-by: alukic <alukic@vmware.com>

* Exposed a service on port 80

Signed-off-by: alukic <alukic@vmware.com>

* Added the proper endpoint

Signed-off-by: alukic <alukic@vmware.com>

* Removed http from health-check

Signed-off-by: alukic <alukic@vmware.com>

* Changed username to root directly

Signed-off-by: alukic <alukic@vmware.com>

* Access mode

Signed-off-by: alukic <alukic@vmware.com>

* Remove test changes

Signed-off-by: alukic <alukic@vmware.com>
This commit is contained in:
superaleks
2022-06-22 17:21:23 +02:00
committed by GitHub
parent 94282aa81c
commit ef185f4648
3 changed files with 95 additions and 3 deletions

34
.vib/mysql/goss/goss.yaml Normal file
View File

@@ -0,0 +1,34 @@
command:
mysql-env:
exec: env
exit-status: 0
stdout:
- "MYSQL_DATABASE=important_db"
stderr: [ ]
timeout: 40000
mysql-create:
exec: mysql -h localhost -u root -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" -e 'DROP TABLE IF EXISTS TEST; create table TEST( test_id int auto_increment, test_value int, primary key(test_id)); INSERT INTO TEST (TEST_VALUE) VALUES (1993);SELECT * FROM TEST'
exit-status: 0
stdout:
- "test_id"
- "test_value"
- "1993"
stderr: [ ]
timeout: 40000
user-id-test:
exec: if [ "$(id -u)" -eq 0 ]; then exit 1; fi
exit-status: 0
stdout: []
stderr: []
file:
{{ printf "/bitnami/mysql/data/%s" .Env.MYSQL_DATABASE }}:
mode: "2750"
filetype: directory
exists: true
/opt/bitnami/mysql/conf/my.cnf:
mode: "0644"
filetype: file
contains:
- "datadir=/bitnami/mysql/data"
- "socket=/opt/bitnami/mysql/tmp/mysql.sock"
exists: true

View File

@@ -17,14 +17,42 @@
]
},
"verify": {
"context": {
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "/bitnami/mysql"
},
"runtime_parameters": "YXV0aDogCiAgcm9vdFBhc3N3b3JkOiBDb21wbGljYXRlZFBhc3N3b3JkMTIzNAogIGRhdGFiYXNlOiBpbXBvcnRhbnRfZGIKcHJpbWFyeToKICBzZXJ2aWNlOgogICAgdHlwZTogTG9hZEJhbGFuY2VyCiAgICBwb3J0czogCiAgICAgIG15c3FsOiA4MAo=",
"target_platform": {
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
"size": {
"name": "S4"
}
}
},
"actions": [
{
"action_id": "trivy",
"params": {
"threshold": "CRITICAL",
"vuln_type": [
"OS"
]
"vuln_type": ["OS"]
}
},
{
"action_id": "health-check",
"params": {
"endpoint": "lb-mysql-mysql"
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib/mysql/goss"
},
"remote": {
"workload": "sts-mysql"
}
}
}
]

View File

@@ -17,6 +17,19 @@
]
},
"verify": {
"context": {
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "/bitnami/mysql"
},
"runtime_parameters": "YXV0aDogCiAgcm9vdFBhc3N3b3JkOiBDb21wbGljYXRlZFBhc3N3b3JkMTIzNAogIGRhdGFiYXNlOiBpbXBvcnRhbnRfZGIKcHJpbWFyeToKICBzZXJ2aWNlOgogICAgdHlwZTogTG9hZEJhbGFuY2VyCiAgICBwb3J0czogCiAgICAgIG15c3FsOiA4MAo=",
"target_platform": {
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
"size": {
"name": "S4"
}
}
},
"actions": [
{
"action_id": "trivy",
@@ -24,6 +37,23 @@
"threshold": "CRITICAL",
"vuln_type": ["OS"]
}
},
{
"action_id": "health-check",
"params": {
"endpoint": "lb-mysql-mysql"
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib/mysql/goss"
},
"remote": {
"workload": "sts-mysql"
}
}
}
]
}