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

Minor E2E edits from Jenkins testing #531

Merged
merged 3 commits into from
Mar 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
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