Skip to content

Commit f9d8f0e

Browse files
Merge pull request containerd#3794 from fahedouch/server_test
add tests to server_test
2 parents 257a749 + 7c016b6 commit f9d8f0e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

services/server/server_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,23 @@ func TestCreateTopLevelDirectoriesErrorsWithSamePathForRootAndState(t *testing.T
3232
})
3333
assert.Check(t, is.Error(err, "root and state must be different paths"))
3434
}
35+
36+
func TestCreateTopLevelDirectoriesWithEmptyStatePath(t *testing.T) {
37+
statePath := ""
38+
rootPath := "/tmp/path/for/testing"
39+
err := CreateTopLevelDirectories(&srvconfig.Config{
40+
Root: rootPath,
41+
State: statePath,
42+
})
43+
assert.Check(t, is.Error(err, "state must be specified"))
44+
}
45+
46+
func TestCreateTopLevelDirectoriesWithEmptyRootPath(t *testing.T) {
47+
statePath := "/tmp/path/for/testing"
48+
rootPath := ""
49+
err := CreateTopLevelDirectories(&srvconfig.Config{
50+
Root: rootPath,
51+
State: statePath,
52+
})
53+
assert.Check(t, is.Error(err, "root must be specified"))
54+
}

0 commit comments

Comments
 (0)