mirror of
https://github.com/kairos-io/kcrypt.git
synced 2025-04-27 19:29:09 +00:00
Add test for header when writing mappings
Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
parent
f977f72e8d
commit
36fafa38cf
@ -6,6 +6,7 @@ import (
|
|||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
|
"github.com/kairos-io/kairos/pkg/config/collector"
|
||||||
configpkg "github.com/kairos-io/kcrypt/pkg/config"
|
configpkg "github.com/kairos-io/kcrypt/pkg/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -125,6 +126,9 @@ kcrypt:
|
|||||||
It("replaces the file contents", func() {
|
It("replaces the file contents", func() {
|
||||||
c.SetMapping("COS_PERSISTENT:the_new_name:the_new_uuid")
|
c.SetMapping("COS_PERSISTENT:the_new_name:the_new_uuid")
|
||||||
c.WriteMappings(tmpFile.Name())
|
c.WriteMappings(tmpFile.Name())
|
||||||
|
data, err := os.ReadFile(tmpFile.Name())
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
Expect(collector.HasValidHeader(string(data))).To(BeTrue())
|
||||||
|
|
||||||
newConfig, err := configpkg.GetConfiguration([]string{tmpDir})
|
newConfig, err := configpkg.GetConfiguration([]string{tmpDir})
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
Loading…
Reference in New Issue
Block a user