mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-02 01:45:23 +08:00
test changes
This commit is contained in:
parent
adc8876f9b
commit
8e9a0b46aa
3 changed files with 8 additions and 5 deletions
|
@ -1 +1 @@
|
|||
10.0.0.2 myhost.skynet
|
||||
10.0.0.1 node-thhy9.skynet
|
||||
|
|
|
@ -61,6 +61,9 @@ type NetworkUpdate struct {
|
|||
AllowManualSignUp *bool `json:"allowmanualsignup" bson:"allowmanualsignup"`
|
||||
IsLocal *bool `json:"islocal" bson:"islocal"`
|
||||
IsDualStack *bool `json:"isdualstack" bson:"isdualstack"`
|
||||
IsIPv4 string `json:"isipv4" bson:"isipv4"`
|
||||
IsIPv6 string `json:"isipv6" bson:"isipv6"`
|
||||
IsGRPCHub string `json:"isgrpchub" bson:"isgrpchub"`
|
||||
LocalRange string `json:"localrange" bson:"localrange" validate:"omitempty,cidr"`
|
||||
//can't have min=1 with omitempty
|
||||
DefaultCheckInInterval int32 `json:"checkininterval,omitempty" bson:"checkininterval,omitempty" validate:"omitempty,numeric,min=2,max=100000"`
|
||||
|
|
|
@ -277,7 +277,7 @@ func TestDeleteKey(t *testing.T) {
|
|||
err = json.NewDecoder(response.Body).Decode(&message)
|
||||
assert.Nil(t, err, err)
|
||||
assert.Equal(t, http.StatusUnauthorized, message.Code)
|
||||
assert.Contains(t, "ou are unauthorized to access this endpoint", message.Message)
|
||||
assert.Contains(t, message.Message, "ou are unauthorized to access this endpoint")
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ func TestGetKeys(t *testing.T) {
|
|||
var message models.ErrorResponse
|
||||
err = json.NewDecoder(response.Body).Decode(&message)
|
||||
assert.Nil(t, err, err)
|
||||
assert.Contains(t, "his network does not exist", message.Message)
|
||||
assert.Contains(t, message.Message, "his network does not exist")
|
||||
assert.Equal(t, http.StatusNotFound, response.StatusCode)
|
||||
})
|
||||
t.Run("InvalidCredentials", func(t *testing.T) {
|
||||
|
@ -314,7 +314,7 @@ func TestGetKeys(t *testing.T) {
|
|||
err = json.NewDecoder(response.Body).Decode(&message)
|
||||
assert.Nil(t, err, err)
|
||||
assert.Equal(t, http.StatusUnauthorized, message.Code)
|
||||
assert.Contains(t, "ou are unauthorized to access this endpoint", message.Message)
|
||||
assert.Contains(t, message.Message, "ou are unauthorized to access this endpoint")
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -352,7 +352,7 @@ func TestUpdateNetwork(t *testing.T) {
|
|||
err = json.NewDecoder(response.Body).Decode(&message)
|
||||
assert.Nil(t, err, err)
|
||||
assert.Equal(t, http.StatusUnauthorized, message.Code)
|
||||
assert.Contains(t, "his network does not exist.", message.Message)
|
||||
assert.Contains(t, message.Message, "his network does not exist.")
|
||||
assert.Equal(t, http.StatusNotFound, response.StatusCode)
|
||||
})
|
||||
t.Run("UpdateAddress", func(t *testing.T) {
|
||||
|
|
Loading…
Add table
Reference in a new issue