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-T1729 Automated Test for PostgresSQL Exporter Add w/ Socket file #643

Closed
wants to merge 5 commits into from
Closed
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
29 changes: 29 additions & 0 deletions cli/tests/postgreSql-pdpgsql.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,33 @@ test.describe('Percona Distribution for PostgreSQL CLI tests ', async () => {
await output.outContains('Service removed.');
}
});

/**
* @link https://jira.percona.com/secure/Tests.jspa#/testCase/PMM-T1729
*/
test('PMM-T1729 run pmm-admin add postgresql based on running intsances using socket and service name', async ({}) => {
let services = (await cli.exec(`sudo pmm-admin list | grep "PostgreSQL" | grep "pdpgsql-" | awk -F" " '{print $2}'`))
.stdout.trim().split('\n').filter((item) => item.trim().length > 0);
let n = 1;
for (const service of services) {
let socket = "/tmp/".concat(service);
let output = await cli.exec(`sudo pmm-admin add postgresql --username=${PGSQL_USER} --password=${PGSQL_PASSWORD} --socket=${socket} --service-name=pdpgsql-${n++}`);
await output.assertSuccess();
await output.outContains('PostgreSQL Service added.');
}

});

/**
* @link https://jira.percona.com/secure/Tests.jspa#/testCase/PMM-T1729
*/
test('PMM-T1729 run pmm-admin remove postgresql using service name', async ({}) => {
let services = (await cli.exec(`sudo pmm-admin list | grep "PostgreSQL" | grep "pdpgsql-" | awk -F" " '{print $2}'`))
.stdout.trim().split('\n').filter((item) => item.trim().length > 0);
for (const service of services) {
let output = await cli.exec(`sudo pmm-admin remove postgresql ${service}`);
await output.assertSuccess();
await output.outContains('Service removed.');
}
});
});