refact(e2e): Move env outside of helper methods (#2186)

* refact(e2e): Move env outside of UI helper methods

* refact(e2e): Move env outside of CLI helpers
This commit is contained in:
Michael Li authored and GitHub committed 2024-03-18 15:53:39 -04:00
1 parent 98170ed01e
commit 879c196887
14 files changed
+273 -92

No files matched your search

+28 -18
View File
@@ -20,18 +20,25 @@ exports.checkBoundaryCli = async () => {
/** /**
* Uses the boundary CLI to authenticate to the specified Boundary instance * Uses the boundary CLI to authenticate to the specified Boundary instance
* @param {string} addr Address of the Boundary instance to be authenticated to
* @param {string} authMethodId ID of the auth method to be used for authentication
* @param {string} loginName Login name to be used for authentication
* @param {string} password Password to be used for authentication
*/ */
exports.authenticateBoundaryCli = async () => { exports.authenticateBoundaryCli = async (
addr,
authMethodId,
loginName,
password,
) => {
try { try {
execSync( execSync(
'boundary authenticate password' + 'boundary authenticate password' +
' -addr=' + ` -addr=${addr}` +
process.env.BOUNDARY_ADDR + ` -auth-method-id=${authMethodId}` +
' -auth-method-id=' + ` -login-name=${loginName}` +
process.env.E2E_PASSWORD_AUTH_METHOD_ID + ' -password=env://BPASS',
' -login-name=' + { env: { ...process.env, BPASS: password } },
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME +
' -password=env://E2E_PASSWORD_ADMIN_PASSWORD',
); );
} catch (e) { } catch (e) {
console.log(`${e.stderr}`); console.log(`${e.stderr}`);
@@ -41,20 +48,19 @@ exports.authenticateBoundaryCli = async () => {
/** /**
* Uses the boundary CLI to connect to the specified target * Uses the boundary CLI to connect to the specified target
* @param {string} targetId ID of the target to be connected to * @param {string} targetId ID of the target to be connected to
* @param {string} sshUser User to be used for the ssh connection
* @param {string} sshKeyPath Path to the ssh key to be used for the ssh connection
* @returns ChildProcess representing the result of the command execution * @returns ChildProcess representing the result of the command execution
*/ */
exports.connectToTarget = async (targetId) => { exports.connectToTarget = async (targetId, sshUser, sshKeyPath) => {
let connect; let connect;
try { try {
connect = exec( connect = exec(
'boundary connect' + 'boundary connect' +
' -target-id=' + ` -target-id=${targetId}` +
targetId +
' -exec /usr/bin/ssh --' + ' -exec /usr/bin/ssh --' +
' -l ' + ` -l ${sshUser}` +
process.env.E2E_SSH_USER + ` -i ${sshKeyPath}` +
' -i ' +
process.env.E2E_SSH_KEY_PATH +
' -o UserKnownHostsFile=/dev/null' + ' -o UserKnownHostsFile=/dev/null' +
' -o StrictHostKeyChecking=no' + ' -o StrictHostKeyChecking=no' +
' -o IdentitiesOnly=yes' + // forces the use of the provided key ' -o IdentitiesOnly=yes' + // forces the use of the provided key
@@ -241,7 +247,6 @@ exports.makeAuthMethodPrimaryCli = async (scopeId, authMethodId) => {
exports.createNewPasswordAccountCli = async (authMethodId) => { exports.createNewPasswordAccountCli = async (authMethodId) => {
let passwordAccount; let passwordAccount;
const login = 'test-login'; const login = 'test-login';
process.env.ACCOUNT_PASSWORD = 'test-password';
try { try {
passwordAccount = JSON.parse( passwordAccount = JSON.parse(
execSync( execSync(
@@ -250,6 +255,7 @@ exports.createNewPasswordAccountCli = async (authMethodId) => {
-login-name ${login} \ -login-name ${login} \
-password env://ACCOUNT_PASSWORD \ -password env://ACCOUNT_PASSWORD \
-format json`, -format json`,
{ env: { ...process.env, ACCOUNT_PASSWORD: 'test-password' } },
), ),
).item; ).item;
} catch (e) { } catch (e) {
@@ -451,12 +457,14 @@ exports.createNewStaticCredentialStoreCli = async (projectId) => {
/** /**
* Uses the boundary CLI to create a new vault credential store. * Uses the boundary CLI to create a new vault credential store.
* @param {string} projectId ID of the project under which the credential store will be created. * @param {string} projectId ID of the project under which the credential store will be created.
* @param {string} vaultAddr Address of the vault that the credential store will be created for.
* @param {string} secretPolicyName Name of the secret policy that's used to create vault token. * @param {string} secretPolicyName Name of the secret policy that's used to create vault token.
* @param {string} boundaryPolicyName Name of the boundary policy that's used to create vault token. * @param {string} boundaryPolicyName Name of the boundary policy that's used to create vault token.
* @returns {Promise<string>} new credential store's ID * @returns {Promise<string>} new credential store's ID
*/ */
exports.createNewVaultCredentialStoreCli = async ( exports.createNewVaultCredentialStoreCli = async (
projectId, projectId,
vaultAddr,
secretPolicyName, secretPolicyName,
boundaryPolicyName, boundaryPolicyName,
) => { ) => {
@@ -487,7 +495,7 @@ exports.createNewVaultCredentialStoreCli = async (
`boundary credential-stores create vault \ `boundary credential-stores create vault \
-scope-id ${projectId} \ -scope-id ${projectId} \
-name ${credentialStoreName} \ -name ${credentialStoreName} \
-vault-address ${process.env.E2E_VAULT_ADDR} \ -vault-address ${vaultAddr} \
-vault-token ${clientToken} \ -vault-token ${clientToken} \
-format json`, -format json`,
), ),
@@ -506,7 +514,6 @@ exports.createNewVaultCredentialStoreCli = async (
exports.createNewUsernamePasswordCredentialCli = async (credentialStoreId) => { exports.createNewUsernamePasswordCredentialCli = async (credentialStoreId) => {
let usernamePasswordCredential; let usernamePasswordCredential;
const login = 'test-login'; const login = 'test-login';
process.env.CREDENTIALS_PASSWORD = 'credentials-password';
try { try {
usernamePasswordCredential = JSON.parse( usernamePasswordCredential = JSON.parse(
execSync( execSync(
@@ -516,6 +523,9 @@ exports.createNewUsernamePasswordCredentialCli = async (credentialStoreId) => {
-username ${login} \ -username ${login} \
-password env://CREDENTIALS_PASSWORD \ -password env://CREDENTIALS_PASSWORD \
-format json`, -format json`,
{
env: { ...process.env, CREDENTIALS_PASSWORD: 'credentials-password' },
},
), ),
).item; ).item;
} catch (e) { } catch (e) {
+50 -34
View File
@@ -118,15 +118,16 @@ exports.createNewHostSet = async (page) => {
/** /**
* Uses the UI to create a new host in a host set. Assumes you have just created a new host set. * Uses the UI to create a new host in a host set. Assumes you have just created a new host set.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} address Address of the host
* @returns Name of the host * @returns Name of the host
*/ */
exports.createNewHostInHostSet = async (page) => { exports.createNewHostInHostSet = async (page, address) => {
const hostName = 'Host ' + nanoid(); const hostName = 'Host ' + nanoid();
await page.getByText('Manage').click(); await page.getByText('Manage').click();
await page.getByRole('link', { name: 'Create and Add Host' }).click(); await page.getByRole('link', { name: 'Create and Add Host' }).click();
await page.getByLabel('Name').fill(hostName); await page.getByLabel('Name').fill(hostName);
await page.getByLabel('Description').fill('This is an automated test'); await page.getByLabel('Description').fill('This is an automated test');
await page.getByLabel('Address').fill(process.env.E2E_TARGET_ADDRESS); await page.getByLabel('Address').fill(address);
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await expect( await expect(
page.getByRole('alert').getByText('Success', { exact: true }), page.getByRole('alert').getByText('Success', { exact: true }),
@@ -169,10 +170,11 @@ exports.createStaticCredentialStore = async (page) => {
/** /**
* Uses the UI to create a vault credential store. Assumes you have selected the desired project. * Uses the UI to create a vault credential store. Assumes you have selected the desired project.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} vaultAddr address of the vault server
* @param {string} clientToken vault token to connect to boundary * @param {string} clientToken vault token to connect to boundary
* @returns Name of the credential store * @returns Name of the credential store
*/ */
exports.createVaultCredentialStore = async (page, clientToken) => { exports.createVaultCredentialStore = async (page, vaultAddr, clientToken) => {
const credentialStoreName = 'Credential Store ' + nanoid(); const credentialStoreName = 'Credential Store ' + nanoid();
await page await page
.getByRole('navigation', { name: 'Resources' }) .getByRole('navigation', { name: 'Resources' })
@@ -182,9 +184,7 @@ exports.createVaultCredentialStore = async (page, clientToken) => {
await page.getByLabel('Name', { exact: true }).fill(credentialStoreName); await page.getByLabel('Name', { exact: true }).fill(credentialStoreName);
await page.getByLabel('Description').fill('This is an automated test'); await page.getByLabel('Description').fill('This is an automated test');
await page.getByRole('group', { name: 'Type' }).getByLabel('Vault').click(); await page.getByRole('group', { name: 'Type' }).getByLabel('Vault').click();
await page await page.getByLabel('Address', { exact: true }).fill(vaultAddr);
.getByLabel('Address', { exact: true })
.fill(process.env.E2E_VAULT_ADDR);
await page.getByLabel('Token', { exact: true }).fill(clientToken); await page.getByLabel('Token', { exact: true }).fill(clientToken);
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await expect( await expect(
@@ -203,9 +203,11 @@ exports.createVaultCredentialStore = async (page, clientToken) => {
/** /**
* Uses the UI to create a static key pair credential . Assumes you have selected the desired project. * Uses the UI to create a static key pair credential . Assumes you have selected the desired project.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} username username for the credential
* @param {string} keyPath path to the private key
* @returns Name of the credential * @returns Name of the credential
*/ */
exports.createStaticCredentialKeyPair = async (page) => { exports.createStaticCredentialKeyPair = async (page, username, keyPath) => {
const credentialName = 'Credential ' + nanoid(); const credentialName = 'Credential ' + nanoid();
await page.getByRole('link', { name: 'Credentials', exact: true }).click(); await page.getByRole('link', { name: 'Credentials', exact: true }).click();
await page.getByRole('link', { name: 'New', exact: true }).click(); await page.getByRole('link', { name: 'New', exact: true }).click();
@@ -215,10 +217,8 @@ exports.createStaticCredentialKeyPair = async (page) => {
.getByRole('group', { name: 'Type' }) .getByRole('group', { name: 'Type' })
.getByLabel('Username & Key Pair') .getByLabel('Username & Key Pair')
.click(); .click();
await page await page.getByLabel('Username', { exact: true }).fill(username);
.getByLabel('Username', { exact: true }) const keyData = await readFile(keyPath, {
.fill(process.env.E2E_SSH_USER);
const keyData = await readFile(process.env.E2E_SSH_KEY_PATH, {
encoding: 'utf-8', encoding: 'utf-8',
}); });
await page.getByLabel('SSH Private Key', { exact: true }).fill(keyData); await page.getByLabel('SSH Private Key', { exact: true }).fill(keyData);
@@ -281,11 +281,13 @@ exports.createVaultGenericCredentialLibrary = async (
* the desired credential store. * the desired credential store.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} vaultPath path to secret in vault * @param {string} vaultPath path to secret in vault
* @param {string} username username for the credential
* @returns Name of the credential library * @returns Name of the credential library
*/ */
exports.createVaultSshCertificateCredentialLibrary = async ( exports.createVaultSshCertificateCredentialLibrary = async (
page, page,
vaultPath, vaultPath,
username,
) => { ) => {
const credentialLibraryName = 'Credential Library ' + nanoid(); const credentialLibraryName = 'Credential Library ' + nanoid();
@@ -306,7 +308,7 @@ exports.createVaultSshCertificateCredentialLibrary = async (
.getByLabel('Description (Optional)') .getByLabel('Description (Optional)')
.fill('This is an automated test'); .fill('This is an automated test');
await page.getByLabel('Vault Path').fill(vaultPath); await page.getByLabel('Vault Path').fill(vaultPath);
await page.getByLabel('Username').fill(process.env.E2E_SSH_USER); await page.getByLabel('Username').fill(username);
await page.getByLabel('Key Type').selectOption('ecdsa'); await page.getByLabel('Key Type').selectOption('ecdsa');
await page.getByLabel('Key Bits').fill('521'); await page.getByLabel('Key Bits').fill('521');
@@ -331,9 +333,10 @@ exports.createVaultSshCertificateCredentialLibrary = async (
/** /**
* Uses the UI to create a new target. Assumes you have selected the desired project. * Uses the UI to create a new target. Assumes you have selected the desired project.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} port Port of the target
* @returns Name of the target * @returns Name of the target
*/ */
exports.createNewTarget = async (page) => { exports.createNewTarget = async (page, port) => {
const targetName = 'Target ' + nanoid(); const targetName = 'Target ' + nanoid();
await page await page
.getByRole('navigation', { name: 'Resources' }) .getByRole('navigation', { name: 'Resources' })
@@ -342,7 +345,7 @@ exports.createNewTarget = async (page) => {
await page.getByRole('link', { name: 'New', exact: true }).click(); await page.getByRole('link', { name: 'New', exact: true }).click();
await page.getByLabel('Name').fill(targetName); await page.getByLabel('Name').fill(targetName);
await page.getByLabel('Description').fill('This is an automated test'); await page.getByLabel('Description').fill('This is an automated test');
await page.getByLabel('Default Port').fill(process.env.E2E_TARGET_PORT); await page.getByLabel('Default Port').fill(port);
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await expect( await expect(
page.getByRole('alert').getByText('Success', { exact: true }), page.getByRole('alert').getByText('Success', { exact: true }),
@@ -358,9 +361,11 @@ exports.createNewTarget = async (page) => {
/** /**
* Uses the UI to create a new target with address. Assumes you have selected the desired project. * Uses the UI to create a new target with address. Assumes you have selected the desired project.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} address Address of the target
* @param {string} port Port of the target
* @returns Name of the target * @returns Name of the target
*/ */
exports.createNewTargetWithAddress = async (page) => { exports.createNewTargetWithAddress = async (page, address, port) => {
const targetName = 'Target ' + nanoid(); const targetName = 'Target ' + nanoid();
await page await page
.getByRole('navigation', { name: 'Resources' }) .getByRole('navigation', { name: 'Resources' })
@@ -369,8 +374,8 @@ exports.createNewTargetWithAddress = async (page) => {
await page.getByRole('link', { name: 'New', exact: true }).click(); await page.getByRole('link', { name: 'New', exact: true }).click();
await page.getByLabel('Name').fill(targetName); await page.getByLabel('Name').fill(targetName);
await page.getByLabel('Description').fill('This is an automated test'); await page.getByLabel('Description').fill('This is an automated test');
await page.getByLabel('Target Address').fill(process.env.E2E_TARGET_ADDRESS); await page.getByLabel('Target Address').fill(address);
await page.getByLabel('Default Port').fill(process.env.E2E_TARGET_PORT); await page.getByLabel('Default Port').fill(port);
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await expect( await expect(
page.getByRole('alert').getByText('Success', { exact: true }), page.getByRole('alert').getByText('Success', { exact: true }),
@@ -387,9 +392,11 @@ exports.createNewTargetWithAddress = async (page) => {
* Uses the UI to create a new TCP target with address in boundary-enterprise * Uses the UI to create a new TCP target with address in boundary-enterprise
* Assumes you have selected the desired project. * Assumes you have selected the desired project.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} address Address of the target
* @param {string} port Port of the target
* @returns Name of the target * @returns Name of the target
*/ */
exports.createTcpTargetWithAddressEnt = async (page) => { exports.createTcpTargetWithAddressEnt = async (page, address, port) => {
const targetName = 'Target ' + nanoid(); const targetName = 'Target ' + nanoid();
await page await page
.getByRole('navigation', { name: 'Resources' }) .getByRole('navigation', { name: 'Resources' })
@@ -399,8 +406,8 @@ exports.createTcpTargetWithAddressEnt = async (page) => {
await page.getByLabel('Name').fill(targetName); await page.getByLabel('Name').fill(targetName);
await page.getByLabel('Description').fill('This is an automated test'); await page.getByLabel('Description').fill('This is an automated test');
await page.getByRole('group', { name: 'Type' }).getByLabel('TCP').click(); await page.getByRole('group', { name: 'Type' }).getByLabel('TCP').click();
await page.getByLabel('Target Address').fill(process.env.E2E_TARGET_ADDRESS); await page.getByLabel('Target Address').fill(address);
await page.getByLabel('Default Port').fill(process.env.E2E_TARGET_PORT); await page.getByLabel('Default Port').fill(port);
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await expect( await expect(
page.getByRole('alert').getByText('Success', { exact: true }), page.getByRole('alert').getByText('Success', { exact: true }),
@@ -417,9 +424,11 @@ exports.createTcpTargetWithAddressEnt = async (page) => {
* Uses the UI to create a new SSH target with address in boundary-enterprise * Uses the UI to create a new SSH target with address in boundary-enterprise
* Assumes you have selected the desired project. * Assumes you have selected the desired project.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} address Address of the target
* @param {string} port Port of the target
* @returns Name of the target * @returns Name of the target
*/ */
exports.createSshTargetWithAddressEnt = async (page) => { exports.createSshTargetWithAddressEnt = async (page, address, port) => {
const targetName = 'Target ' + nanoid(); const targetName = 'Target ' + nanoid();
await page await page
.getByRole('navigation', { name: 'Resources' }) .getByRole('navigation', { name: 'Resources' })
@@ -429,8 +438,8 @@ exports.createSshTargetWithAddressEnt = async (page) => {
await page.getByLabel('Name').fill(targetName); await page.getByLabel('Name').fill(targetName);
await page.getByLabel('Description').fill('This is an automated test'); await page.getByLabel('Description').fill('This is an automated test');
await page.getByRole('group', { name: 'Type' }).getByLabel('SSH').click(); await page.getByRole('group', { name: 'Type' }).getByLabel('SSH').click();
await page.getByLabel('Target Address').fill(process.env.E2E_TARGET_ADDRESS); await page.getByLabel('Target Address').fill(address);
await page.getByLabel('Default Port').fill(process.env.E2E_TARGET_PORT); await page.getByLabel('Default Port').fill(port);
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await expect( await expect(
page.getByRole('alert').getByText('Success', { exact: true }), page.getByRole('alert').getByText('Success', { exact: true }),
@@ -907,25 +916,32 @@ exports.addGrantsToGroup = async (page, grants) => {
/** /**
* Uses the UI to create a new Storage Bucket. Assumes you have selected the desired scope. * Uses the UI to create a new Storage Bucket. Assumes you have selected the desired scope.
* @param {Page} page Playwright page object * @param {Page} page Playwright page object
* @param {string} bucketName Name of the Storage Bucket
* @param {string} region Region of the Storage Bucket
* @param {string} accessKeyId Access Key ID for the Storage Bucket
* @param {string} secretAccessKey Secret Access Key for the Storage Bucket
* @param {string} workerFilter Worker filter for the Storage Bucket
* @returns Name of the Storage Bucket * @returns Name of the Storage Bucket
*/ */
exports.createStorageBucket = async (page) => { exports.createStorageBucket = async (
page,
bucketName,
region,
accessKeyId,
secretAccessKey,
workerFilter,
) => {
const storageBucketName = 'Bucket ' + nanoid(); const storageBucketName = 'Bucket ' + nanoid();
await page await page
.getByRole('link', { name: 'Storage Buckets', exact: true }) .getByRole('link', { name: 'Storage Buckets', exact: true })
.click(); .click();
await page.getByRole('link', { name: 'New Storage Bucket' }).click(); await page.getByRole('link', { name: 'New Storage Bucket' }).click();
await page.getByLabel(new RegExp('Name*')).fill(storageBucketName); await page.getByLabel(new RegExp('Name*')).fill(storageBucketName);
await page.getByLabel('Bucket name').fill(process.env.E2E_AWS_BUCKET_NAME); await page.getByLabel('Bucket name').fill(bucketName);
await page.getByLabel('Region').fill(process.env.E2E_AWS_REGION); await page.getByLabel('Region').fill(region);
await page await page.getByLabel('Access key ID').fill(accessKeyId);
.getByLabel('Access key ID') await page.getByLabel('Secret access key').fill(secretAccessKey);
.fill(process.env.E2E_AWS_ACCESS_KEY_ID); await page.getByLabel('Worker filter').fill(workerFilter);
await page
.getByLabel('Secret access key')
.fill(process.env.E2E_AWS_SECRET_ACCESS_KEY);
const workerTag = `"${process.env.E2E_WORKER_TAG_EGRESS}" in "/tags/type"`;
await page.getByLabel('Worker filter').fill(workerTag);
await page.getByLabel('Disable credential rotation').click(); await page.getByLabel('Disable credential rotation').click();
await page.getByRole('button', { name: 'Save' }).click(); await page.getByRole('button', { name: 'Save' }).click();
await expect( await expect(
@@ -43,7 +43,12 @@ test('Set up LDAP auth method @ce @ent @docker', async ({ page }) => {
try { try {
// Create an org // Create an org
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
@@ -35,7 +35,12 @@ test('Verify new auth-method can be created and assigned to users @ce @ent @aws
let org; let org;
try { try {
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
await createNewPasswordAuthMethod(page, 'UI Test Auth Method'); await createNewPasswordAuthMethod(page, 'UI Test Auth Method');
@@ -50,8 +50,8 @@ test.beforeEach(async ({ page }) => {
projectName = await createNewProject(page); projectName = await createNewProject(page);
await createNewHostCatalog(page); await createNewHostCatalog(page);
const hostSetName = await createNewHostSet(page); const hostSetName = await createNewHostSet(page);
await createNewHostInHostSet(page); await createNewHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
targetName = await createNewTarget(page); targetName = await createNewTarget(page, process.env.E2E_TARGET_PORT);
await addHostSourceToTarget(page, hostSetName); await addHostSourceToTarget(page, hostSetName);
await createStaticCredentialStore(page); await createStaticCredentialStore(page);
}); });
@@ -59,10 +59,19 @@ test.beforeEach(async ({ page }) => {
test('Static Credential Store (User & Key Pair) @ce @aws @docker', async ({ test('Static Credential Store (User & Key Pair) @ce @aws @docker', async ({
page, page,
}) => { }) => {
const credentialName = await createStaticCredentialKeyPair(page); const credentialName = await createStaticCredentialKeyPair(
page,
process.env.E2E_SSH_USER,
process.env.E2E_SSH_KEY_PATH,
);
await addBrokeredCredentialsToTarget(page, targetName, credentialName); await addBrokeredCredentialsToTarget(page, targetName, credentialName);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const session = await getSessionCli(orgName, projectName, targetName); const session = await getSessionCli(orgName, projectName, targetName);
const retrievedUser = session.item.credentials[0].credential.username; const retrievedUser = session.item.credentials[0].credential.username;
const retrievedKey = session.item.credentials[0].credential.private_key; const retrievedKey = session.item.credentials[0].credential.private_key;
@@ -114,7 +123,12 @@ test('Static Credential Store (Username & Password) @ce @aws @docker', async ({
await addBrokeredCredentialsToTarget(page, targetName, credentialName); await addBrokeredCredentialsToTarget(page, targetName, credentialName);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const session = await getSessionCli(orgName, projectName, targetName); const session = await getSessionCli(orgName, projectName, targetName);
const retrievedUser = session.item.credentials[0].credential.username; const retrievedUser = session.item.credentials[0].credential.username;
const retrievedPassword = session.item.credentials[0].credential.password; const retrievedPassword = session.item.credentials[0].credential.password;
@@ -166,7 +180,12 @@ test('Static Credential Store (JSON) @ce @aws @docker', async ({ page }) => {
await addBrokeredCredentialsToTarget(page, targetName, credentialName); await addBrokeredCredentialsToTarget(page, targetName, credentialName);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const session = await getSessionCli(orgName, projectName, targetName); const session = await getSessionCli(orgName, projectName, targetName);
const retrievedUser = session.item.credentials[0].credential.username; const retrievedUser = session.item.credentials[0].credential.username;
const retrievedPassword = session.item.credentials[0].credential.password; const retrievedPassword = session.item.credentials[0].credential.password;
@@ -88,7 +88,12 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
const clientToken = vaultToken.auth.client_token; const clientToken = vaultToken.auth.client_token;
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
@@ -100,15 +105,19 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
await createNewHostCatalog(page); await createNewHostCatalog(page);
const hostSetName = await createNewHostSet(page); const hostSetName = await createNewHostSet(page);
await createNewHostInHostSet(page); await createNewHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
const targetName = await createNewTarget(page); const targetName = await createNewTarget(page, process.env.E2E_TARGET_PORT);
await addHostSourceToTarget(page, hostSetName); await addHostSourceToTarget(page, hostSetName);
const targets = JSON.parse( const targets = JSON.parse(
execSync(`boundary targets list -format json -scope-id ${project.id}`), execSync(`boundary targets list -format json -scope-id ${project.id}`),
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
await createVaultCredentialStore(page, clientToken); await createVaultCredentialStore(
page,
process.env.E2E_VAULT_ADDR,
clientToken,
);
const credentialLibraryName = 'Credential Library ' + nanoid(); const credentialLibraryName = 'Credential Library ' + nanoid();
await page.getByRole('link', { name: 'Credential Libraries' }).click(); await page.getByRole('link', { name: 'Credential Libraries' }).click();
@@ -61,7 +61,12 @@ test.beforeAll(async () => {
test.beforeEach(async () => { test.beforeEach(async () => {
execSync(`vault policy delete ${secretPolicyName}`); execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`); execSync(`vault policy delete ${boundaryPolicyName}`);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
}); });
test('Verify resources can be deleted (enterprise) @ent @aws', async ({ test('Verify resources can be deleted (enterprise) @ent @aws', async ({
@@ -91,6 +96,7 @@ test('Verify resources can be deleted (enterprise) @ent @aws', async ({
await createNewStaticCredentialStoreCli(projectId); await createNewStaticCredentialStoreCli(projectId);
let vaultCredentialStoreId = await createNewVaultCredentialStoreCli( let vaultCredentialStoreId = await createNewVaultCredentialStoreCli(
projectId, projectId,
process.env.E2E_VAULT_ADDR,
secretPolicyName, secretPolicyName,
boundaryPolicyName, boundaryPolicyName,
); );
@@ -60,7 +60,12 @@ test.beforeAll(async () => {
test.beforeEach(async () => { test.beforeEach(async () => {
execSync(`vault policy delete ${secretPolicyName}`); execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`); execSync(`vault policy delete ${boundaryPolicyName}`);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
}); });
test('Verify resources can be deleted @ce @aws', async ({ page }) => { test('Verify resources can be deleted @ce @aws', async ({ page }) => {
@@ -87,6 +92,7 @@ test('Verify resources can be deleted @ce @aws', async ({ page }) => {
await createNewStaticCredentialStoreCli(projectId); await createNewStaticCredentialStoreCli(projectId);
let vaultCredentialStoreId = await createNewVaultCredentialStoreCli( let vaultCredentialStoreId = await createNewVaultCredentialStoreCli(
projectId, projectId,
process.env.E2E_VAULT_ADDR,
secretPolicyName, secretPolicyName,
boundaryPolicyName, boundaryPolicyName,
); );
+6 -1
View File
@@ -34,7 +34,12 @@ test('Verify a new role can be created and associated with a group @ce @ent @aws
let org; let org;
try { try {
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
const groupName = 'test-group'; const groupName = 'test-group';
@@ -55,10 +55,14 @@ test('Verify session recording can be deleted @ent @aws', async ({ page }) => {
let storageBucket; let storageBucket;
let connect; let connect;
try { try {
await authenticateBoundaryCli();
// Create org // Create org
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
const org = orgs.items.filter((obj) => obj.name == orgName)[0]; const org = orgs.items.filter((obj) => obj.name == orgName)[0];
orgId = org.id; orgId = org.id;
@@ -73,7 +77,14 @@ test('Verify session recording can be deleted @ent @aws', async ({ page }) => {
// Create Storage Bucket // Create Storage Bucket
await page.getByRole('link', { name: 'Orgs', exact: true }).click(); await page.getByRole('link', { name: 'Orgs', exact: true }).click();
const storageBucketName = await createStorageBucket(page); const storageBucketName = await createStorageBucket(
page,
process.env.E2E_AWS_BUCKET_NAME,
process.env.E2E_AWS_REGION,
process.env.E2E_AWS_ACCESS_KEY_ID,
process.env.E2E_AWS_SECRET_ACCESS_KEY,
`"${process.env.E2E_WORKER_TAG_EGRESS}" in "/tags/type"`,
);
const storageBuckets = JSON.parse( const storageBuckets = JSON.parse(
execSync('boundary storage-buckets list -format json'), execSync('boundary storage-buckets list -format json'),
); );
@@ -96,7 +107,11 @@ test('Verify session recording can be deleted @ent @aws', async ({ page }) => {
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
await createStaticCredentialStore(page); await createStaticCredentialStore(page);
const credentialName = await createStaticCredentialKeyPair(page); const credentialName = await createStaticCredentialKeyPair(
page,
process.env.E2E_SSH_USER,
process.env.E2E_SSH_KEY_PATH,
);
await addInjectedCredentialsToTarget(page, targetName, credentialName); await addInjectedCredentialsToTarget(page, targetName, credentialName);
// Enable session recording for Target // Enable session recording for Target
@@ -39,6 +39,7 @@ test.beforeAll(async () => {
'VAULT_TOKEN', 'VAULT_TOKEN',
'E2E_VAULT_ADDR', // Address used by Boundary Server (could be different from VAULT_ADDR depending on network config (i.e. docker network)) 'E2E_VAULT_ADDR', // Address used by Boundary Server (could be different from VAULT_ADDR depending on network config (i.e. docker network))
'E2E_TARGET_ADDRESS', 'E2E_TARGET_ADDRESS',
'E2E_TARGET_PORT',
'E2E_SSH_USER', 'E2E_SSH_USER',
'E2E_SSH_CA_KEY', 'E2E_SSH_CA_KEY',
'E2E_SSH_CA_KEY_PUBLIC', 'E2E_SSH_CA_KEY_PUBLIC',
@@ -96,7 +97,12 @@ test('SSH Certificate Injection @ent @docker', async ({ page }) => {
// Create org // Create org
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
@@ -108,18 +114,27 @@ test('SSH Certificate Injection @ent @docker', async ({ page }) => {
const project = projects.items.filter((obj) => obj.name == projectName)[0]; const project = projects.items.filter((obj) => obj.name == projectName)[0];
// Create target // Create target
const targetName = await createSshTargetWithAddressEnt(page); const targetName = await createSshTargetWithAddressEnt(
page,
process.env.E2E_TARGET_ADDRESS,
process.env.E2E_TARGET_PORT,
);
const targets = JSON.parse( const targets = JSON.parse(
execSync('boundary targets list -format json -scope-id ' + project.id), execSync('boundary targets list -format json -scope-id ' + project.id),
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
// Create credentials // Create credentials
await createVaultCredentialStore(page, clientToken); await createVaultCredentialStore(
page,
process.env.E2E_VAULT_ADDR,
clientToken,
);
const credentialLibraryName = const credentialLibraryName =
await createVaultSshCertificateCredentialLibrary( await createVaultSshCertificateCredentialLibrary(
page, page,
`${secretsPath}/issue/${secretName}`, `${secretsPath}/issue/${secretName}`,
process.env.E2E_SSH_USER,
); );
await addInjectedCredentialsToTarget( await addInjectedCredentialsToTarget(
page, page,
@@ -89,7 +89,12 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({
// Create org // Create org
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
@@ -101,14 +106,22 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({
const project = projects.items.filter((obj) => obj.name == projectName)[0]; const project = projects.items.filter((obj) => obj.name == projectName)[0];
// Create target // Create target
const targetName = await createSshTargetWithAddressEnt(page); const targetName = await createSshTargetWithAddressEnt(
page,
process.env.E2E_TARGET_ADDRESS,
process.env.E2E_TARGET_PORT,
);
const targets = JSON.parse( const targets = JSON.parse(
execSync('boundary targets list -format json -scope-id ' + project.id), execSync('boundary targets list -format json -scope-id ' + project.id),
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
// Create credentials // Create credentials
await createVaultCredentialStore(page, clientToken); await createVaultCredentialStore(
page,
process.env.E2E_VAULT_ADDR,
clientToken,
);
const credentialLibraryName = await createVaultGenericCredentialLibrary( const credentialLibraryName = await createVaultGenericCredentialLibrary(
page, page,
`${secretsPath}/data/${secretName}`, `${secretsPath}/data/${secretName}`,
+32 -6
View File
@@ -47,7 +47,12 @@ test('Verify session created for TCP target @ent @aws @docker', async ({
let connect; let connect;
try { try {
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
@@ -57,13 +62,21 @@ test('Verify session created for TCP target @ent @aws @docker', async ({
); );
const project = projects.items.filter((obj) => obj.name == projectName)[0]; const project = projects.items.filter((obj) => obj.name == projectName)[0];
const targetName = await createTcpTargetWithAddressEnt(page); const targetName = await createTcpTargetWithAddressEnt(
page,
process.env.E2E_TARGET_ADDRESS,
process.env.E2E_TARGET_PORT,
);
const targets = JSON.parse( const targets = JSON.parse(
execSync('boundary targets list -format json -scope-id ' + project.id), execSync('boundary targets list -format json -scope-id ' + project.id),
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
connect = await connectToTarget(target.id); connect = await connectToTarget(
target.id,
process.env.E2E_SSH_USER,
process.env.E2E_SSH_KEY_PATH,
);
await waitForSessionToBeVisible(page, targetName); await waitForSessionToBeVisible(page, targetName);
await page await page
.getByRole('cell', { name: targetName }) .getByRole('cell', { name: targetName })
@@ -89,7 +102,12 @@ test('Verify session created for SSH target @ent @aws @docker', async ({
let connect; let connect;
try { try {
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
@@ -99,14 +117,22 @@ test('Verify session created for SSH target @ent @aws @docker', async ({
); );
const project = projects.items.filter((obj) => obj.name == projectName)[0]; const project = projects.items.filter((obj) => obj.name == projectName)[0];
const targetName = await createSshTargetWithAddressEnt(page); const targetName = await createSshTargetWithAddressEnt(
page,
process.env.E2E_TARGET_ADDRESS,
process.env.E2E_TARGET_PORT,
);
const targets = JSON.parse( const targets = JSON.parse(
execSync('boundary targets list -format json -scope-id ' + project.id), execSync('boundary targets list -format json -scope-id ' + project.id),
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
await createStaticCredentialStore(page); await createStaticCredentialStore(page);
const credentialName = await createStaticCredentialKeyPair(page); const credentialName = await createStaticCredentialKeyPair(
page,
process.env.E2E_SSH_USER,
process.env.E2E_SSH_KEY_PATH,
);
await addInjectedCredentialsToTarget(page, targetName, credentialName); await addInjectedCredentialsToTarget(page, targetName, credentialName);
connect = await connectSshToTarget(target.id); connect = await connectSshToTarget(target.id);
+40 -9
View File
@@ -49,11 +49,16 @@ test('Verify session created to target with host, then cancel the session @ce @a
const projectName = await createNewProject(page); const projectName = await createNewProject(page);
await createNewHostCatalog(page); await createNewHostCatalog(page);
const hostSetName = await createNewHostSet(page); const hostSetName = await createNewHostSet(page);
await createNewHostInHostSet(page); await createNewHostInHostSet(page, process.env.E2E_TARGET_ADDRESS);
const targetName = await createNewTarget(page); const targetName = await createNewTarget(page, process.env.E2E_TARGET_PORT);
await addHostSourceToTarget(page, hostSetName); await addHostSourceToTarget(page, hostSetName);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
const projects = JSON.parse( const projects = JSON.parse(
@@ -65,7 +70,11 @@ test('Verify session created to target with host, then cancel the session @ce @a
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
connect = await connectToTarget(target.id); connect = await connectToTarget(
target.id,
process.env.E2E_SSH_USER,
process.env.E2E_SSH_KEY_PATH,
);
await waitForSessionToBeVisible(page, targetName); await waitForSessionToBeVisible(page, targetName);
await page await page
.getByRole('cell', { name: targetName }) .getByRole('cell', { name: targetName })
@@ -90,9 +99,18 @@ test('Verify session created to target with address, then cancel the session @ce
try { try {
const orgName = await createNewOrg(page); const orgName = await createNewOrg(page);
const projectName = await createNewProject(page); const projectName = await createNewProject(page);
const targetName = await createNewTargetWithAddress(page); const targetName = await createNewTargetWithAddress(
page,
process.env.E2E_TARGET_ADDRESS,
process.env.E2E_TARGET_PORT,
);
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
org = orgs.items.filter((obj) => obj.name == orgName)[0]; org = orgs.items.filter((obj) => obj.name == orgName)[0];
const projects = JSON.parse( const projects = JSON.parse(
@@ -104,7 +122,11 @@ test('Verify session created to target with address, then cancel the session @ce
); );
const target = targets.items.filter((obj) => obj.name == targetName)[0]; const target = targets.items.filter((obj) => obj.name == targetName)[0];
connect = await connectToTarget(target.id); connect = await connectToTarget(
target.id,
process.env.E2E_SSH_USER,
process.env.E2E_SSH_KEY_PATH,
);
await waitForSessionToBeVisible(page, targetName); await waitForSessionToBeVisible(page, targetName);
await page await page
.getByRole('cell', { name: targetName }) .getByRole('cell', { name: targetName })
@@ -126,7 +148,11 @@ test('Verify TCP target is updated @ce @aws @docker', async ({ page }) => {
try { try {
orgName = await createNewOrg(page); orgName = await createNewOrg(page);
await createNewProject(page); await createNewProject(page);
await createNewTargetWithAddress(page); await createNewTargetWithAddress(
page,
process.env.E2E_TARGET_ADDRESS,
process.env.E2E_TARGET_PORT,
);
// Update target // Update target
await page.getByRole('button', { name: 'Edit Form' }).click(); await page.getByRole('button', { name: 'Edit Form' }).click();
@@ -147,7 +173,12 @@ test('Verify TCP target is updated @ce @aws @docker', async ({ page }) => {
page.getByRole('alert').getByText('Success', { exact: true }), page.getByRole('alert').getByText('Success', { exact: true }),
).toBeVisible(); ).toBeVisible();
} finally { } finally {
await authenticateBoundaryCli(); await authenticateBoundaryCli(
process.env.BOUNDARY_ADDR,
process.env.E2E_PASSWORD_AUTH_METHOD_ID,
process.env.E2E_PASSWORD_ADMIN_LOGIN_NAME,
process.env.E2E_PASSWORD_ADMIN_PASSWORD,
);
const orgs = JSON.parse(execSync('boundary scopes list -format json')); const orgs = JSON.parse(execSync('boundary scopes list -format json'));
const org = orgs.items.filter((obj) => obj.name === orgName)[0]; const org = orgs.items.filter((obj) => obj.name === orgName)[0];
await deleteOrgCli(org.id); await deleteOrgCli(org.id);