Skip to content

Commit 358ea7d

Browse files
authored
Merge pull request #12 from QiWang19/fix_ci
Fix tests failure #11
2 parents 03309a8 + 2f433c6 commit 358ea7d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

pkg/config/config_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,18 @@ var _ = Describe("Config", func() {
2525

2626
It("should succeed with additional devices", func() {
2727
// Given
28+
validDirPath, err := ioutil.TempDir("", "config-empty")
29+
if err != nil {
30+
panic(err)
31+
}
32+
defer os.RemoveAll(validDirPath)
33+
34+
sut.HooksDir = []string{validDirPath}
35+
2836
sut.AdditionalDevices = []string{"/dev/null:/dev/null:rw"}
2937

3038
// When
31-
err := sut.ContainersConfig.Validate(nil, true)
39+
err = sut.ContainersConfig.Validate(nil, true)
3240

3341
// Then
3442
Expect(err).To(BeNil())
@@ -364,16 +372,6 @@ var _ = Describe("Config", func() {
364372
})
365373

366374
Describe("New", func() {
367-
It("should return default configuration if pass nil path", func() {
368-
// Given
369-
// When
370-
config, err := config.New("")
371-
// Then
372-
Expect(err).To(BeNil())
373-
Expect(config.CgroupManager).To(Equal("systemd"))
374-
Expect(config.PidsLimit).To(BeEquivalentTo(1024))
375-
})
376-
377375
It("should success with valid user file path", func() {
378376
// Given
379377
// When

0 commit comments

Comments
 (0)