mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-09 05:06:29 +10:00
[bitnami/osclass] Add VIB tests to OsClass helm chart (#12373)
* [bitnami/osclass] Add VIB tests to OsClass helm chart Signed-off-by: Michiel <michield@vmware.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"baseUrl": "http://localhost",
|
||||
"env": {
|
||||
"username": "test_user",
|
||||
"password": "ComplicatedPassword123!4"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"newPage": {
|
||||
"title": "Test Page",
|
||||
"internalName": "testpage"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/// <reference types="cypress" />
|
||||
import { random } from '../support/utils';
|
||||
|
||||
it('should add a new page', () => {
|
||||
cy.login();
|
||||
cy.visit('/oc-admin/index.php?page=pages&action=add');
|
||||
cy.fixture('pages').then((pages) => {
|
||||
cy.get('[id*="title"]').type(`${pages.newPage.title} ${random}`);
|
||||
cy.get('[id*="internal_name"]').type(`${pages.newPage.internalName}${random}`);
|
||||
cy.contains('Insert').click();
|
||||
cy.contains('Image').click();
|
||||
cy.contains('Upload').click();
|
||||
cy.get('[type="file"]').selectFile('cypress/fixtures/images/test_image.jpeg', {force: true});
|
||||
cy.contains('Save').click();
|
||||
cy.contains('input', 'Add page').scrollIntoView().click();
|
||||
cy.visit('/');
|
||||
cy.contains(`${pages.newPage.title} ${random}`).click();
|
||||
cy.get('[src*="test_image"]');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
const COMMAND_DELAY = 2000;
|
||||
|
||||
for (const command of ['click']) {
|
||||
Cypress.Commands.overwrite(command, (originalFn, ...args) => {
|
||||
const origVal = originalFn(...args);
|
||||
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(origVal);
|
||||
}, COMMAND_DELAY);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Cypress.Commands.add(
|
||||
'login',
|
||||
(username = Cypress.env('username'), password = Cypress.env('password')) => {
|
||||
cy.visit('/oc-admin');
|
||||
cy.get('#user_login').type(username);
|
||||
cy.get('#user_pass').type(password);
|
||||
cy.contains('button', 'Log in').click();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// ***********************************************************
|
||||
// This example support/index.js is processed and
|
||||
// loaded automatically before your test files.
|
||||
//
|
||||
// This is a great place to put global configuration and
|
||||
// behavior that modifies Cypress.
|
||||
//
|
||||
// You can change the location of this file or turn off
|
||||
// automatically serving support files with the
|
||||
// 'supportFile' configuration option.
|
||||
//
|
||||
// You can read more here:
|
||||
// https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands';
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
@@ -0,0 +1,3 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
export let random = (Math.random() + 1).toString(36).substring(7);
|
||||
@@ -0,0 +1,32 @@
|
||||
http:
|
||||
https://osclass:{{ .Vars.service.ports.https }}:
|
||||
status: 200
|
||||
allow-insecure: true
|
||||
timeout: 70000
|
||||
command:
|
||||
check-user-info:
|
||||
exec: id
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- uid={{ .Vars.containerSecurityContext.runAsUser }}
|
||||
- /groups=.*{{ .Vars.podSecurityContext.fsGroup }}/
|
||||
file:
|
||||
/bitnami/osclass/config.php:
|
||||
exists: true
|
||||
filetype: file
|
||||
mode: "0666"
|
||||
contains:
|
||||
- /WEB_PATH.*{{ .Vars.containerPorts.http }}/
|
||||
- /DB_NAME.*{{ .Vars.mariadb.auth.database }}/
|
||||
- /DB_USER.*{{ .Vars.mariadb.auth.username }}/
|
||||
- /DB_PASSWORD.*{{ .Vars.mariadb.auth.password }}/
|
||||
/etc/hosts:
|
||||
exists: true
|
||||
filetype: file
|
||||
contains:
|
||||
{{ range .Vars.hostAliases }}
|
||||
{{ $ip := .ip }}
|
||||
{{ range $host := .hostnames }}
|
||||
- /{{ $ip }}.*{{ $host }}/
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,18 @@
|
||||
containerPorts:
|
||||
http: 8081
|
||||
service:
|
||||
ports:
|
||||
https: 444
|
||||
podSecurityContext:
|
||||
fsGroup: 1002
|
||||
containerSecurityContext:
|
||||
runAsUser: 1002
|
||||
hostAliases:
|
||||
- ip: 127.0.0.1
|
||||
hostnames:
|
||||
- status.testhost
|
||||
mariadb:
|
||||
auth:
|
||||
database: test_osclass_database
|
||||
username: test_osclass_username
|
||||
password: test_osclass_password
|
||||
@@ -22,7 +22,7 @@
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/osclass"
|
||||
},
|
||||
"runtime_parameters": "Im9zY2xhc3NQYXNzd29yZCI6ICJiaXRuYW1pMSIKIm9zY2xhc3NVc2VybmFtZSI6ICJ1c2VyIgoic2VydmljZSI6CiAgInBvcnQiOiA4MAogICJ0eXBlIjogIkxvYWRCYWxhbmNlciI=",
|
||||
"runtime_parameters": "b3NjbGFzc1VzZXJuYW1lOiB0ZXN0X3VzZXIKb3NjbGFzc1Bhc3N3b3JkOiBDb21wbGljYXRlZFBhc3N3b3JkMTIzITQKc2VydmljZToKICBwb3J0czoKICAgIGh0dHA6IDgwCiAgICBodHRwczogNDQ0CiAgdHlwZTogTG9hZEJhbGFuY2VyCmNvbnRhaW5lclBvcnRzOgogIGh0dHA6IDgwODEKICBodHRwczogODQ0NAptYXJpYWRiOgogIGVuYWJsZWQ6IHRydWUKICBhdXRoOgogICAgZGF0YWJhc2U6IHRlc3Rfb3NjbGFzc19kYXRhYmFzZQogICAgdXNlcm5hbWU6IHRlc3Rfb3NjbGFzc191c2VybmFtZQogICAgcGFzc3dvcmQ6IHRlc3Rfb3NjbGFzc19wYXNzd29yZApwb2RTZWN1cml0eUNvbnRleHQ6CiAgZW5hYmxlZDogdHJ1ZQogIGZzR3JvdXA6IDEwMDIKY29udGFpbmVyU2VjdXJpdHlDb250ZXh0OgogIGVuYWJsZWQ6IHRydWUKICBydW5Bc1VzZXI6IDEwMDIKaG9zdEFsaWFzZXM6CiAgLSBpcDogMTI3LjAuMC4xCiAgICBob3N0bmFtZXM6CiAgICAgIC0gc3RhdHVzLnRlc3Rob3N0",
|
||||
"target_platform": {
|
||||
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
|
||||
"size": {
|
||||
@@ -37,6 +37,32 @@
|
||||
"endpoint": "lb-osclass-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/osclass/goss"
|
||||
},
|
||||
"remote": {
|
||||
"workload": "deploy-osclass"
|
||||
},
|
||||
"vars_file": "vars.yaml"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "cypress",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/osclass/cypress"
|
||||
},
|
||||
"endpoint": "lb-osclass-http",
|
||||
"app_protocol": "HTTP",
|
||||
"env": {
|
||||
"username": "test_user",
|
||||
"password": "ComplicatedPassword123!4"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"url": "{SHA_ARCHIVE}",
|
||||
"path": "/bitnami/osclass"
|
||||
},
|
||||
"runtime_parameters": "Im9zY2xhc3NQYXNzd29yZCI6ICJiaXRuYW1pMSIKIm9zY2xhc3NVc2VybmFtZSI6ICJ1c2VyIgoic2VydmljZSI6CiAgInBvcnQiOiA4MAogICJ0eXBlIjogIkxvYWRCYWxhbmNlciI=",
|
||||
"runtime_parameters": "b3NjbGFzc1VzZXJuYW1lOiB0ZXN0X3VzZXIKb3NjbGFzc1Bhc3N3b3JkOiBDb21wbGljYXRlZFBhc3N3b3JkMTIzITQKc2VydmljZToKICBwb3J0czoKICAgIGh0dHA6IDgwCiAgICBodHRwczogNDQ0CiAgdHlwZTogTG9hZEJhbGFuY2VyCmNvbnRhaW5lclBvcnRzOgogIGh0dHA6IDgwODEKICBodHRwczogODQ0NAptYXJpYWRiOgogIGVuYWJsZWQ6IHRydWUKICBhdXRoOgogICAgZGF0YWJhc2U6IHRlc3Rfb3NjbGFzc19kYXRhYmFzZQogICAgdXNlcm5hbWU6IHRlc3Rfb3NjbGFzc191c2VybmFtZQogICAgcGFzc3dvcmQ6IHRlc3Rfb3NjbGFzc19wYXNzd29yZApwb2RTZWN1cml0eUNvbnRleHQ6CiAgZW5hYmxlZDogdHJ1ZQogIGZzR3JvdXA6IDEwMDIKY29udGFpbmVyU2VjdXJpdHlDb250ZXh0OgogIGVuYWJsZWQ6IHRydWUKICBydW5Bc1VzZXI6IDEwMDIKaG9zdEFsaWFzZXM6CiAgLSBpcDogMTI3LjAuMC4xCiAgICBob3N0bmFtZXM6CiAgICAgIC0gc3RhdHVzLnRlc3Rob3N0",
|
||||
"target_platform": {
|
||||
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
|
||||
"size": {
|
||||
@@ -37,6 +37,32 @@
|
||||
"endpoint": "lb-osclass-http",
|
||||
"app_protocol": "HTTP"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "goss",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/osclass/goss"
|
||||
},
|
||||
"remote": {
|
||||
"workload": "deploy-osclass"
|
||||
},
|
||||
"vars_file": "vars.yaml"
|
||||
}
|
||||
},
|
||||
{
|
||||
"action_id": "cypress",
|
||||
"params": {
|
||||
"resources": {
|
||||
"path": "/.vib/osclass/cypress"
|
||||
},
|
||||
"endpoint": "lb-osclass-http",
|
||||
"app_protocol": "HTTP",
|
||||
"env": {
|
||||
"username": "test_user",
|
||||
"password": "ComplicatedPassword123!4"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user