art: Drop provider from c3os code

Part of: https://github.com/c3os-io/c3os/issues/68
This commit is contained in:
mudler
2022-08-10 18:56:07 +02:00
committed by Itxaka
parent 7a148fe5bb
commit 52cb8cbc29
8 changed files with 531 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package machine_test
import (
"io/ioutil"
"os"
. "github.com/c3os-io/c3os/pkg/machine"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("BootCMDLine", func() {
Context("parses data", func() {
It("returns cmdline if provided", func() {
f, err := ioutil.TempFile("", "test")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(f.Name())
err = ioutil.WriteFile(f.Name(), []byte(`config_url="foo bar" baz.bar=""`), os.ModePerm)
Expect(err).ToNot(HaveOccurred())
b, err := DotToYAML(f.Name())
Expect(err).ToNot(HaveOccurred())
Expect(string(b)).To(Equal("baz:\n bar: \"\"\nconfig_url: foo bar\n"))
})
})
})