Align lint checks with containerd

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2020-09-30 22:30:22 -07:00
parent 83e6efc6fc
commit a3c0e8859c
11 changed files with 107 additions and 111 deletions

View File

@@ -903,7 +903,7 @@ func TestGenerateApparmorSpecOpts(t *testing.T) {
profile: runtimeDefault,
privileged: true,
},
// TODO (mikebrow) add success with exising defined profile tests
// TODO (mikebrow) add success with existing defined profile tests
"should return error when undefined local profile is specified": {
profile: profileNamePrefix + "test-profile",
expectErr: true,

View File

@@ -358,7 +358,7 @@ func TestImageLayersLabel(t *testing.T) {
{
name: "many layers",
layersNum: 5, // hits sampleMaxSize (300 chars).
wantNum: 4, // layers should be ommitted for avoiding invalid label.
wantNum: 4, // layers should be omitted for avoiding invalid label.
},
}

View File

@@ -18,7 +18,6 @@ package sandbox
import (
"errors"
"fmt"
"testing"
"time"
@@ -63,8 +62,8 @@ func TestStatus(t *testing.T) {
func TestStateStringConversion(t *testing.T) {
assert := assertlib.New(t)
assert.Equal("SANDBOX_READY", fmt.Sprintf("%s", StateReady))
assert.Equal("SANDBOX_NOTREADY", fmt.Sprintf("%s", StateNotReady))
assert.Equal("SANDBOX_UNKNOWN", fmt.Sprintf("%s", StateUnknown))
assert.Equal("invalid sandbox state value: 123", fmt.Sprintf("%s", State(123)))
assert.Equal("SANDBOX_READY", StateReady.String())
assert.Equal("SANDBOX_NOTREADY", StateNotReady.String())
assert.Equal("SANDBOX_UNKNOWN", StateUnknown.String())
assert.Equal("invalid sandbox state value: 123", State(123).String())
}