-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andre Kurait <[email protected]>
- Loading branch information
1 parent
48a2179
commit 974b6f3
Showing
4 changed files
with
248 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -317,3 +317,43 @@ test('Throw error on invalid CPU Arch', () => { | |
expect(error.message).toEqual('distributionUrl parameter is required. Please provide the OpenSearch distribution artifact url to download'); | ||
} | ||
}); | ||
|
||
test('Throw error on invalid load balancer type', () => { | ||
const app = new App({ | ||
context: { | ||
distVersion: '1.0.0', | ||
securityDisabled: false, | ||
minDistribution: false, | ||
cpuArch: 'x64', | ||
singleNodeCluster: false, | ||
dashboardsUrl: 'www.example.com', | ||
distributionUrl: 'www.example.com', | ||
serverAccessType: 'ipv4', | ||
restrictServerAccessTo: 'all', | ||
additionalConfig: '{ "name": "John Doe", "age": 30, "email": "[email protected]" }', | ||
additionalOsdConfig: '{ "something.enabled": "true", "something_else.enabled": "false" }', | ||
loadBalancerType: 'invalid-type', | ||
}, | ||
}); | ||
|
||
try { | ||
// WHEN | ||
const networkStack = new NetworkStack(app, 'opensearch-network-stack', { | ||
env: { account: 'test-account', region: 'us-east-1' }, | ||
}); | ||
|
||
// @ts-ignore | ||
const infraStack = new InfraStack(app, 'opensearch-infra-stack', { | ||
vpc: networkStack.vpc, | ||
securityGroup: networkStack.osSecurityGroup, | ||
env: { account: 'test-account', region: 'us-east-1' }, | ||
}); | ||
|
||
// eslint-disable-next-line no-undef | ||
fail('Expected an error to be thrown'); | ||
} catch (error) { | ||
expect(error).toBeInstanceOf(Error); | ||
// @ts-ignore | ||
expect(error.message).toEqual('Invalid load balancer type provided. Valid values are nlb, alb'); | ||
} | ||
}); |
Oops, something went wrong.