mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-12 16:14:37 +08:00
test logic update
This commit is contained in:
parent
c6a2f2cb64
commit
edbce5547a
1 changed files with 3 additions and 3 deletions
|
@ -19,12 +19,12 @@ func TestCreateEgressGateway(t *testing.T) {
|
||||||
t.Run("NoNodes", func(t *testing.T) {
|
t.Run("NoNodes", func(t *testing.T) {
|
||||||
node, err := logic.CreateEgressGateway(gateway)
|
node, err := logic.CreateEgressGateway(gateway)
|
||||||
assert.Equal(t, models.Node{}, node)
|
assert.Equal(t, models.Node{}, node)
|
||||||
assert.EqualError(t, err, "unable to get record key")
|
assert.EqualError(t, err, "could not find any records")
|
||||||
})
|
})
|
||||||
t.Run("Success", func(t *testing.T) {
|
t.Run("Success", func(t *testing.T) {
|
||||||
testnode := createTestNode()
|
testnode := createTestNode()
|
||||||
gateway.NetID = "skynet"
|
gateway.NetID = "skynet"
|
||||||
gateway.NodeID = testnode.MacAddress
|
gateway.NodeID = testnode.ID
|
||||||
|
|
||||||
node, err := logic.CreateEgressGateway(gateway)
|
node, err := logic.CreateEgressGateway(gateway)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
@ -43,7 +43,7 @@ func TestDeleteEgressGateway(t *testing.T) {
|
||||||
gateway.Interface = "eth0"
|
gateway.Interface = "eth0"
|
||||||
gateway.Ranges = []string{"10.100.100.0/24"}
|
gateway.Ranges = []string{"10.100.100.0/24"}
|
||||||
gateway.NetID = "skynet"
|
gateway.NetID = "skynet"
|
||||||
gateway.NodeID = testnode.MacAddress
|
gateway.NodeID = testnode.ID
|
||||||
t.Run("Success", func(t *testing.T) {
|
t.Run("Success", func(t *testing.T) {
|
||||||
node, err := logic.CreateEgressGateway(gateway)
|
node, err := logic.CreateEgressGateway(gateway)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue