Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-7 SSL_Fixes PDPGSQL & MS #885

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/configuration/pages/pmmInventoryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
backToServices: '//span[text()="Go back to services"]',
agentsLinkNew: '//div[contains(@data-testid,"status-badge")]',
detailsLabelByText: (label) => locate('[aria-label="Tags"]').find(`//li/span[contains(text(), "${label}")]`),
agentDetailsLabelByText: (label) => locate('[aria-label="Tags"]').find('li').withText(label),
agentDetailsLabelByText: (label) => locate('$details-row-content').find('li').withText(label),
agentsLink: locate('[role="tablist"] a').withText('Agents').withAttr({ 'aria-label': 'Tab Agents' }),
agentsLinkOld: locate('a').withText('Agents'),
cluster: '$cluster-text-input',
Expand Down
2 changes: 1 addition & 1 deletion tests/pages/api/inventoryAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module.exports = {

async apiGetServices() {
const headers = { Authorization: `Basic ${await I.getAuth()}` };
const url = 'v1/inventory/services';
const url = 'v1/management/services';

return await I.sendGetRequest(url, headers);
},
Expand Down
23 changes: 16 additions & 7 deletions tests/pages/remoteInstancesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,22 @@ module.exports = {
I.click(this.fields.useTLS);
I.waitForElement(this.fields.tlscaInput, 30);

await this.fillFileContent(this.fields.tlscaInput, details.tlsCAFile);
await this.fillFileContent(this.fields.tlsCertificateInput, details.tlsCertFile);
await this.fillFileContent(this.fields.tlsCertificateKeyInput, details.tlsKeyFile);

if (details.serviceType === 'postgres_ssl') I.click(this.fields.usePgStatStatements);

if (details.serviceType === 'mysql_ssl') I.click(this.fields.skipTLSL);
if (details.serviceType === 'postgres_ssl') {
I.click(this.fields.tlscaInput);
I.type(details.tlsCA);
I.click(this.fields.tlsCertificateInput);
I.type(details.tlsCert);
I.click(this.fields.tlsCertificateKeyInput);
I.type(details.tlsKey);
I.click(this.fields.usePgStatStatements);
}

if (details.serviceType === 'mysql_ssl') {
await this.fillFileContent(this.fields.tlscaInput, details.tlsCAFile);
await this.fillFileContent(this.fields.tlsCertificateInput, details.tlsCertFile);
await this.fillFileContent(this.fields.tlsCertificateKeyInput, details.tlsKeyFile);
I.click(this.fields.skipTLSL);
}
}

if (details.serviceType === 'mongodb_ssl') {
Expand Down
10 changes: 5 additions & 5 deletions tests/verifyTLSMySQLRemoteInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Scenario(
adminPage.performPageDown(5);
await dashboardPage.expandEachDashboardRow();
adminPage.performPageUp(5);
await dashboardPage.verifyThereAreNoGraphsWithoutData(1);
await dashboardPage.verifyThereAreNoGraphsWithoutData(2);
}
},
).retry(2);
Expand Down Expand Up @@ -185,14 +185,14 @@ Data(instances).Scenario(

const agent_id = await I.verifyCommand(`docker exec ${container} pmm-admin list | grep mysqld_exporter | awk -F" " '{print $4}' | awk -F"/" '{print $3}'`);

await I.verifyCommand(`docker exec ${container} ls -la /usr/local/percona/pmm/tmp/mysqld_exporter/${agent_id} | grep tls`);
await I.verifyCommand(`docker exec ${container} rm -r /usr/local/percona/pmm/tmp/mysqld_exporter/`);
await I.verifyCommand(`docker exec ${container} ls -la /usr/local/percona/pmm/tmp/mysqld_exporter/`, 'ls: cannot access \'/usr/local/percona/pmm/tmp/mysqld_exporter\': No such file or directory', 'fail');
await I.verifyCommand(`docker exec ${container} ls -R /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/${agent_id} | grep tls`);
await I.verifyCommand(`docker exec ${container} rm -r /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/`);
await I.verifyCommand(`docker exec ${container} ls -R /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/`, 'ls: cannot access \'/usr/local/percona/pmm/tmp/agent_type_mysqld_exporter\': No such file or directory', 'fail');
await I.verifyCommand(`docker exec ${container} pmm-admin list | grep mysqld_exporter | grep Running`);
await I.verifyCommand(`docker exec ${container} pkill -f mysqld_exporter`);
I.wait(10);
await I.verifyCommand(`docker exec ${container} pmm-admin list | grep mysqld_exporter | grep Running`);
await I.verifyCommand(`docker exec ${container} ls -la /usr/local/percona/pmm/tmp/mysqld_exporter/${agent_id} | grep tls`);
await I.verifyCommand(`docker exec ${container} ls -R /usr/local/percona/pmm/tmp/agent_type_mysqld_exporter/${agent_id} | grep tls`);
},
).retry(1);

Expand Down
2 changes: 1 addition & 1 deletion tests/verifyTLSPostgresRemoteInstance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Before(async ({ I, settingsAPI }) => {

const instances = new DataTable(['serviceName', 'version', 'container', 'serviceType', 'metric', 'maxQueryLength']);

instances.add(['pgsql_16_ssl_service', '16', 'pdpgsql_pgsm_ssl_16', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']);
instances.add(['pgsql_16_ssl_service', '16', 'pdpgsql_pgsm_ssl_16', 'postgres_ssl', 'pg_up', '7']);
// instances.add(['pgsql_14_ssl_service', '14', 'pdpgsql_pgsm_ssl_14', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']);
// instances.add(['pgsql_14_ssl_service', '13', 'pdpgsql_pgsm_ssl_13', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']);
// instances.add(['pgsql_12_ssl_service', '12', 'pdpgsql_pgsm_ssl_12', 'postgres_ssl', 'pg_stat_database_xact_rollback', '7']);
Expand Down
Loading