From bda72659ec08ad9b6eefb2213869387403bd4998 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Wed, 6 Nov 2024 13:04:40 +0530 Subject: [PATCH 1/3] PMM-7 SSL_Fixes PDPGSQL --- tests/pages/api/inventoryAPI.js | 2 +- tests/pages/remoteInstancesPage.js | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/pages/api/inventoryAPI.js b/tests/pages/api/inventoryAPI.js index 91f40a09f..566c447b6 100644 --- a/tests/pages/api/inventoryAPI.js +++ b/tests/pages/api/inventoryAPI.js @@ -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); }, diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 1d9e85aaf..2a62ba2b9 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -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') { From 37dfbbc48ead5ff4c27b50bf7b08efafee84b3d1 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Wed, 6 Nov 2024 14:00:17 +0530 Subject: [PATCH 2/3] PMM-7 Fix MySQL SSL Tests --- tests/configuration/pages/pmmInventoryPage.js | 2 +- tests/verifyTLSMySQLRemoteInstance_test.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/configuration/pages/pmmInventoryPage.js b/tests/configuration/pages/pmmInventoryPage.js index a5bb393b1..441613425 100644 --- a/tests/configuration/pages/pmmInventoryPage.js +++ b/tests/configuration/pages/pmmInventoryPage.js @@ -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', diff --git a/tests/verifyTLSMySQLRemoteInstance_test.js b/tests/verifyTLSMySQLRemoteInstance_test.js index 1bf3a07ce..aeb7a5940 100644 --- a/tests/verifyTLSMySQLRemoteInstance_test.js +++ b/tests/verifyTLSMySQLRemoteInstance_test.js @@ -148,7 +148,7 @@ Scenario( adminPage.performPageDown(5); await dashboardPage.expandEachDashboardRow(); adminPage.performPageUp(5); - await dashboardPage.verifyThereAreNoGraphsWithoutData(1); + await dashboardPage.verifyThereAreNoGraphsWithoutData(2); } }, ).retry(2); @@ -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); From 4d004a8bd8f39a878872ec7078d9702068d513c3 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Wed, 6 Nov 2024 14:03:32 +0530 Subject: [PATCH 3/3] Fix the Metric Name for PG --- tests/verifyTLSPostgresRemoteInstance_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/verifyTLSPostgresRemoteInstance_test.js b/tests/verifyTLSPostgresRemoteInstance_test.js index 96c9cb3fc..4f3d1919b 100644 --- a/tests/verifyTLSPostgresRemoteInstance_test.js +++ b/tests/verifyTLSPostgresRemoteInstance_test.js @@ -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']);