Merge pull request #1649 from anderbubble/images-directory

Change image provision directory to "images"
This commit is contained in:
Xu YANG
2025-01-28 09:27:29 +09:00
committed by GitHub
3 changed files with 8 additions and 8 deletions

View File

@@ -28,6 +28,6 @@ func Test_Copy(t *testing.T) {
baseCmd.SetArgs([]string{"-b", "test-image", "test-image-copy"})
err := baseCmd.Execute()
assert.NoError(t, err)
assert.FileExists(t, path.Join(env.BaseDir, testenv.WWProvisiondir, "image", "test-image-copy.img"))
assert.FileExists(t, path.Join(env.BaseDir, testenv.WWProvisiondir, "images", "test-image-copy.img"))
})
}

View File

@@ -82,8 +82,8 @@ func Test_Exec(t *testing.T) {
nodeName = ""
Build = true
SyncUser = false
os.Remove(env.GetPath("/srv/warewulf/image/test.img"))
os.Remove(env.GetPath("/srv/warewulf/image/test.img.gz"))
os.Remove(env.GetPath("/srv/warewulf/images/test.img"))
os.Remove(env.GetPath("/srv/warewulf/images/test.img.gz"))
}()
cmd := GetCommand()
cmd.SetArgs(tt.args)
@@ -95,11 +95,11 @@ func Test_Exec(t *testing.T) {
assert.NotEmpty(t, out.String())
assert.Contains(t, out.String(), tt.stdout)
if tt.build {
assert.FileExists(t, env.GetPath("/srv/warewulf/image/test.img"))
assert.FileExists(t, env.GetPath("/srv/warewulf/image/test.img.gz"))
assert.FileExists(t, env.GetPath("/srv/warewulf/images/test.img"))
assert.FileExists(t, env.GetPath("/srv/warewulf/images/test.img.gz"))
} else {
assert.NoFileExists(t, env.GetPath("/srv/warewulf/image/test.img"))
assert.NoFileExists(t, env.GetPath("/srv/warewulf/image/test.img.gz"))
assert.NoFileExists(t, env.GetPath("/srv/warewulf/images/test.img"))
assert.NoFileExists(t, env.GetPath("/srv/warewulf/images/test.img.gz"))
}
})
}

View File

@@ -25,7 +25,7 @@ func RunDir(name string) string {
func ImageParentDir() string {
conf := warewulfconf.Get()
return path.Join(conf.Paths.WWProvisiondir, "image")
return path.Join(conf.Paths.WWProvisiondir, "images")
}
func ImageFile(name string) string {