Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Add test for aws config check
Browse files Browse the repository at this point in the history
Signed-off-by: knrt10 <kautilya@kinvolk.io>
  • Loading branch information
knrt10 committed Sep 1, 2020
1 parent 30c7d96 commit a204fa6
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions pkg/platform/aws/aws_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2020 The Lokomotive Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package aws

import "testing"

func TestCheckSamePortForMuliplePools(t *testing.T) {
c := config{
WorkerPools: []workerPool{
{
Name: "pool-1",
},
{
Name: "pool-2",
},
},
}

if d := c.checkDifferentPortForMuliplePools(); !d.HasErrors() {
t.Error("Should fail with lb_http_port and lb_https_port not set")
}
}

func TestCheckDifferentPortForMuliplePools(t *testing.T) {
c := config{
WorkerPools: []workerPool{
{
Name: "pool-1",
},
{
Name: "pool-2",
LBHTTPPort: 8080,
LBHTTPSPort: 8443,
},
},
}

if d := c.checkDifferentPortForMuliplePools(); d.HasErrors() {
t.Error("Should work with unique lb_http_port and lb_https_port for both workers")
}
}

0 comments on commit a204fa6

Please sign in to comment.