Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wangforthinker committed Jan 29, 2019
1 parent 7cd5f36 commit 23575a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions cri/v1alpha1/cri_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func Test_makeSandboxPouchConfig(t *testing.T) {
want *apitypes.ContainerCreateConfig
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down Expand Up @@ -706,7 +706,7 @@ func Test_makeContainerName(t *testing.T) {
args args
want string
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down Expand Up @@ -1030,7 +1030,7 @@ func Test_applyContainerSecurityContext(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down Expand Up @@ -1058,7 +1058,7 @@ func TestCriManager_updateCreateConfig(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down Expand Up @@ -1331,7 +1331,7 @@ func TestCriManager_ensureSandboxImageExists(t *testing.T) {
args args
wantErr bool
}{
// TODO: Add test cases.
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
24 changes: 12 additions & 12 deletions cri/v1alpha2/cri_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1859,34 +1859,34 @@ func Test_toCNIPortMappings(t *testing.T) {
// CRI test: apply container config by annotation
func Test_applyContainerConfigByAnnotation(t *testing.T) {
tests := []struct {
name string
annotation map[string]string
checkFn func(config *apitypes.ContainerConfig, hc *apitypes.HostConfig) bool
errMsg string
name string
annotation map[string]string
checkFn func(config *apitypes.ContainerConfig, hc *apitypes.HostConfig) bool
errMsg string
}{
{
name: "normalMemorySwapTest",
annotation: map[string]string{
name: "normalMemorySwapTest",
annotation: map[string]string{
anno.MemorySwapExtendAnnotation: "200000000",
},
checkFn: func(config *apitypes.ContainerConfig, hc *apitypes.HostConfig) bool{
checkFn: func(config *apitypes.ContainerConfig, hc *apitypes.HostConfig) bool {
if hc.MemorySwap == 200000000 {
return true
}

return false
},
errMsg: "",
errMsg: "",
},
{
name: "errorMemorySwapTest",
annotation: map[string]string{
name: "errorMemorySwapTest",
annotation: map[string]string{
anno.MemorySwapExtendAnnotation: "1g",
},
checkFn: func(config *apitypes.ContainerConfig, hc *apitypes.HostConfig) bool{
checkFn: func(config *apitypes.ContainerConfig, hc *apitypes.HostConfig) bool {
return false
},
errMsg: "failed to parse resources.memory_swap",
errMsg: "failed to parse resources.memory_swap",
},
}

Expand Down

0 comments on commit 23575a6

Please sign in to comment.