Skip to content

Commit

Permalink
Minor E2E edits from Jenkins testing (#531)
Browse files Browse the repository at this point in the history
* Minor edits from jenkins testing

Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
  • Loading branch information
lewijacn authored Mar 6, 2024
1 parent f35c54a commit ffb8eed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,23 @@ export class OpenSearchDomainStack extends Stack {

createSSMParameters(domain: Domain, endpointParameterName: string|undefined, adminUserName: string|undefined, adminUserSecret: ISecret|undefined, stage: string, deployId: string) {
const endpointParameter = endpointParameterName ?? "osClusterEndpoint"
new StringParameter(this, 'SSMParameterOpenSearchEndpoint', {
const endpointSSM = new StringParameter(this, 'SSMParameterOpenSearchEndpoint', {
description: 'OpenSearch migration parameter for OpenSearch endpoint',
parameterName: `/migration/${stage}/${deployId}/${endpointParameter}`,
stringValue: `https://${domain.domainEndpoint}:443`
});
endpointSSM.node.addDependency(domain)

if (domain.masterUserPassword && !adminUserSecret) {
console.log(`An OpenSearch domain fine-grained access control user was configured without an existing Secrets Manager secret, will not create SSM Parameter: /migration/${stage}/${deployId}/osUserAndSecret`)
}
else if (domain.masterUserPassword && adminUserSecret) {
new StringParameter(this, 'SSMParameterOpenSearchFGACUserAndSecretArn', {
const secretSSM = new StringParameter(this, 'SSMParameterOpenSearchFGACUserAndSecretArn', {
description: 'OpenSearch migration parameter for OpenSearch configured fine-grained access control user and associated Secrets Manager secret ARN ',
parameterName: `/migration/${stage}/${deployId}/osUserAndSecretArn`,
stringValue: `${adminUserName} ${adminUserSecret.secretArn}`
});
secretSSM.node.addDependency(adminUserSecret)
}
}

Expand Down Expand Up @@ -215,7 +217,6 @@ export class OpenSearchDomainStack extends Stack {
zoneAwareness: zoneAwarenessConfig,
removalPolicy: props.domainRemovalPolicy
});

this.createSSMParameters(domain, props.endpointParameterName, adminUserName, adminUserSecret, props.stage, deployId)

}
Expand Down
2 changes: 1 addition & 1 deletion test/awsRunIntegTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ echo "Clearing non-system target indices"
unbuffer aws ecs execute-command --cluster "migration-${STAGE}-ecs-cluster" --task "${task_arn}" --container "migration-console" --interactive --command "curl -XDELETE ${target_endpoint}/*,-.*"

echo "Print initial source and target indices after clearing indices: "
unbuffer aws ecs execute-command --cluster "migration-${STAGE}-ecs-cluster" --task "${task_arn}" --container "migration-console" --interactive --command "./catIndices.sh --source_endpoint ${source_endpoint} --source_no_auth --target_no_auth"
unbuffer aws ecs execute-command --cluster "migration-${STAGE}-ecs-cluster" --task "${task_arn}" --container "migration-console" --interactive --command "./catIndices.sh --source-endpoint ${source_endpoint} --source-no-auth --target-no-auth"

# Spin up Replayer container and wait for service to be stable
aws ecs update-service --cluster "migration-${STAGE}-ecs-cluster" --service "migration-${STAGE}-traffic-replayer-default" --desired-count 1 > /dev/null 2>&1
Expand Down
4 changes: 1 addition & 3 deletions test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,11 @@ def test_0005_invalidIncorrectUri(self):

def test_0006_OSB(self):
if self.deployment_type == "cloud":
cmd_exec = f"/root/runTestBenchmarks.sh --unique-id {self.unique_id} --endpoint {self.proxy_endpoint}"
cmd_exec = f"/root/runTestBenchmarks.sh --endpoint {self.proxy_endpoint}"
if self.source_auth_type == "none":
cmd_exec = cmd_exec + " --no-auth"
elif self.source_auth_type == "basic":
cmd_exec = cmd_exec + f" --auth-user {self.source_username} --auth-pass {self.source_password}"
if not self.source_verify_ssl:
cmd_exec = cmd_exec + " --no-ssl"
logger.warning(f"Running local command: {cmd_exec}")
subprocess.run(cmd_exec, shell=True)
# TODO: Enhance our waiting logic for determining when all OSB records have been processed by Replayer
Expand Down

0 comments on commit ffb8eed

Please sign in to comment.