Skip to content

Commit

Permalink
Fixes deployment fail if create private subnet is not requested (#47)
Browse files Browse the repository at this point in the history
* Template code fix
* Added automation coverage for this case
  • Loading branch information
bczoma authored Jun 2, 2020
1 parent 176dab9 commit b976b16
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,28 @@ script:
- until curl http://$url:8080; do sleep 10; done
- curl -O https://sftp.solace.com/download/SDKPERF_C_LINUX64
- tar -xvf SDKPERF_C_LINUX64
- pubSubTools/sdkperf_c -cip=$url -mn=100000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
- sleep 30
- curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc><show><redundancy></redundancy></show></rpc>"
- curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc><show><config-sync></config-sync></show></rpc>"
- bash -c 'if [[ -z `curl -sS -u admin:admin http://$url:8080/SEMP -d "<rpc><show><config-sync></config-sync></show></rpc>"
| grep "<oper-status>Up</oper-status>"` ]] ; then echo "config-sync not up!"; exit
1; fi'
- pubSubTools/sdkperf_c -cip=$url -mn=100000 -mr=0 -ptl=t1 -stl=t1 | grep "Total Messages"
- aws cloudformation delete-stack --stack-name $TESTSTACKNAME
- echo "Waiting for stack delete complete"
- stackid="$(aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep StackId | awk -F '"' '{print $4}')"
- if [ -n "$stackid" ]; then until aws cloudformation describe-stacks --stack-name $stackid | grep -m 1 "DELETE_COMPLETE"; do sleep 10; done; fi
- # Now test No Private Subnet
- export TESTSTACKNAME="$TESTSTACKNAME-1"
- sed -i "s@true@false@g" ci/solace-aws-ha-3az-prod-travistest.json
- aws cloudformation create-stack --stack-name $TESTSTACKNAME --template-body file://templates/solace-master.template --parameters file://ci/solace-aws-ha-3az-prod-travistest.json --on-failure DO_NOTHING --capabilities CAPABILITY_IAM
- echo "Waiting for stack create complete"
- "travis_wait 30 sleep 1800 &"
- until aws cloudformation describe-stacks --stack-name $TESTSTACKNAME | grep -m 1 -E 'CREATE_COMPLETE|DELETE_IN_PROGRESS'; do sleep 10; done
- aws cloudformation describe-stack-events --stack-name $TESTSTACKNAME
- aws cloudformation describe-stacks --stack-name $TESTSTACKNAME
- # This completes forming No Private Subnet


after_success:
- echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
Expand Down
22 changes: 22 additions & 0 deletions templates/solace.template
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 55555
Protocol: TCP
Expand All @@ -627,6 +628,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 55003
Protocol: TCP
Expand All @@ -643,6 +645,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 55443
Protocol: TCP
Expand All @@ -659,6 +662,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 1443
Protocol: TCP
Expand All @@ -675,6 +679,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 8000
Protocol: TCP
Expand All @@ -691,6 +696,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 5672
Protocol: TCP
Expand All @@ -707,6 +713,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 9000
Protocol: TCP
Expand All @@ -723,6 +730,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 1883
Protocol: TCP
Expand All @@ -739,6 +747,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 8008
Protocol: TCP
Expand All @@ -755,6 +764,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 8080
Protocol: TCP
Expand All @@ -771,6 +781,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
Port: 1943
Protocol: TCP
Expand All @@ -787,6 +798,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -798,6 +810,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -809,6 +822,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -820,6 +834,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -831,6 +846,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -842,6 +858,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -853,6 +870,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -864,6 +882,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -875,6 +894,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -886,6 +906,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand All @@ -897,6 +918,7 @@ Resources:
Type: AWS::ElasticLoadBalancingV2::Listener
DependsOn:
- ELB
Condition: UsePrivateSubnetsCondition
Properties:
DefaultActions:
- Type: forward
Expand Down

0 comments on commit b976b16

Please sign in to comment.