mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-10 17:48:25 +08:00
fixing tests
This commit is contained in:
parent
dd79186a81
commit
bea7467210
2 changed files with 6 additions and 2 deletions
|
@ -32,10 +32,12 @@ func TestCreateEgressGateway(t *testing.T) {
|
|||
assert.EqualError(t, err, "freebsd is unsupported for egress gateways")
|
||||
})
|
||||
t.Run("Success", func(t *testing.T) {
|
||||
deleteAllNodes()
|
||||
testnode := createTestNode()
|
||||
gateway.NodeID = testnode.ID
|
||||
|
||||
node, err := logic.CreateEgressGateway(gateway)
|
||||
t.Log(node)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, "yes", node.IsEgressGateway)
|
||||
assert.Equal(t, gateway.Ranges, node.EgressGatewayRanges)
|
||||
|
@ -47,7 +49,6 @@ func TestDeleteEgressGateway(t *testing.T) {
|
|||
database.InitializeDatabase()
|
||||
deleteAllNetworks()
|
||||
createNet()
|
||||
createTestNode()
|
||||
testnode := createTestNode()
|
||||
gateway.Interface = "eth0"
|
||||
gateway.Ranges = []string{"10.100.100.0/24"}
|
||||
|
|
|
@ -604,7 +604,10 @@ func isMacAddressUnique(macaddress string, networkName string) (bool, error) {
|
|||
|
||||
nodes, err := GetNetworkNodes(networkName)
|
||||
if err != nil {
|
||||
return database.IsEmptyRecord(err), err
|
||||
if database.IsEmptyRecord(err) {
|
||||
return true, nil
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
|
||||
for _, node := range nodes {
|
||||
|
|
Loading…
Reference in a new issue