Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
8c382649
Commit
8c382649
authored
Feb 12, 2018
by
Pengfei Ni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit tests for mapLoadBalancerNameToVMSet
parent
d3e0280c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
azure_standard_test.go
pkg/cloudprovider/providers/azure/azure_standard_test.go
+44
-0
No files found.
pkg/cloudprovider/providers/azure/azure_standard_test.go
View file @
8c382649
...
@@ -19,6 +19,8 @@ package azure
...
@@ -19,6 +19,8 @@ package azure
import
(
import
(
"testing"
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
meta
"k8s.io/apimachinery/pkg/apis/meta/v1"
meta
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
)
...
@@ -120,3 +122,45 @@ func TestGenerateStorageAccountName(t *testing.T) {
...
@@ -120,3 +122,45 @@ func TestGenerateStorageAccountName(t *testing.T) {
}
}
}
}
}
}
func
TestMapLoadBalancerNameToVMSet
(
t
*
testing
.
T
)
{
az
:=
getTestCloud
()
az
.
PrimaryAvailabilitySetName
=
"primary"
cases
:=
[]
struct
{
description
string
lbName
string
clusterName
string
expectedVMSet
string
}{
{
description
:
"default external LB should map to primary vmset"
,
lbName
:
"azure"
,
clusterName
:
"azure"
,
expectedVMSet
:
"primary"
,
},
{
description
:
"default internal LB should map to primary vmset"
,
lbName
:
"azure-internal"
,
clusterName
:
"azure"
,
expectedVMSet
:
"primary"
,
},
{
description
:
"non-default external LB should map to its own vmset"
,
lbName
:
"azuretest-internal"
,
clusterName
:
"azure"
,
expectedVMSet
:
"azuretest"
,
},
{
description
:
"non-default internal LB should map to its own vmset"
,
lbName
:
"azuretest-internal"
,
clusterName
:
"azure"
,
expectedVMSet
:
"azuretest"
,
},
}
for
_
,
c
:=
range
cases
{
vmset
:=
az
.
mapLoadBalancerNameToVMSet
(
c
.
lbName
,
c
.
clusterName
)
assert
.
Equal
(
t
,
c
.
expectedVMSet
,
vmset
,
c
.
description
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment