Skip to content

Commit

Permalink
Merge pull request #107 from linkernetworks/johnlin/invalidIPforStorage
Browse files Browse the repository at this point in the history
add test for invalid NFS IP
  • Loading branch information
Hung-Wei Chiu authored Jul 17, 2018
2 parents 48acd3c + fbdea81 commit e27451e
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions src/server/handler_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,41 @@ func (suite *StorageTestSuite) TestCreateStorageFail() {
Fake: &entity.FakeStorage{
FakeParameter: "Yo",
IWantFail: true,
}},
},
},
http.StatusInternalServerError},
{"inValidNFSIP", entity.Storage{
Type: entity.FakeStorageType,
Name: namesgenerator.GetRandomName(1),
StorageClassName: namesgenerator.GetRandomName(0),
IP: "256.256.256.256",
PATH: "/myspace",
Fake: &entity.FakeStorage{
FakeParameter: "Yo",
},
},
http.StatusBadRequest},
{"lackStorageName", entity.Storage{
Type: entity.FakeStorageType,
StorageClassName: namesgenerator.GetRandomName(0),
IP: "256.256.256.256",
PATH: "/myspace",
Fake: &entity.FakeStorage{
FakeParameter: "Yo",
},
},
http.StatusBadRequest},
{"StorageTypeError", entity.Storage{
Name: namesgenerator.GetRandomName(0),
StorageClassName: namesgenerator.GetRandomName(1),
Type: "non-exist",
Type: "none-exist",
IP: "192.168.5.100",
PATH: "/myspace",
Fake: &entity.FakeStorage{
FakeParameter: "Yo",
IWantFail: true,
}},
},
},
http.StatusBadRequest},
}

Expand Down

0 comments on commit e27451e

Please sign in to comment.