no panic if listing non existing container image
Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
c0c93b153a
commit
883de9c4fc
@@ -10,6 +10,7 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
|
||||
|
||||
@@ -131,6 +132,10 @@ func (env *TestEnv) WriteFile(t *testing.T, fileName string, content string) {
|
||||
defer f.Close()
|
||||
_, err = f.WriteString(content)
|
||||
assert.NoError(t, err)
|
||||
err = os.Chtimes(env.GetPath(fileName),
|
||||
time.Date(2006, time.February, 1, 3, 4, 5, 0, time.UTC),
|
||||
time.Date(2006, time.February, 1, 3, 4, 5, 0, time.UTC))
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
// ReadFile returns the content of fileName as converted to a
|
||||
|
||||
Reference in New Issue
Block a user