1
0
mirror of https://github.com/kairos-io/kairos-sdk.git synced 2025-05-10 09:05:38 +00:00
kairos-sdk/bundles/bundle_test.go
Itxaka 3163cfbac0 Extract sdk into its own lib
This had some side effects:

 - Have to add some utils from the kairos/machine modules, which IMHO
   should not be there, they should be here if the are generic enough
 - Dropping the sdk dir, just have the modules in the root dir

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-15 10:56:11 +01:00

34 lines
1.1 KiB
Go

package bundles_test
import (
"os"
"path/filepath"
. "github.com/kairos-io/kairos-sdk/bundles"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("Bundle", func() {
Context("install", func() {
PIt("installs packages from luet repos", func() {
dir, err := os.MkdirTemp("", "test")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(dir)
os.MkdirAll(filepath.Join(dir, "var", "tmp", "luet"), os.ModePerm)
err = RunBundles([]BundleOption{WithDBPath(dir), WithRootFS(dir), WithTarget("package://utils/edgevpn")})
Expect(err).ToNot(HaveOccurred())
Expect(filepath.Join(dir, "usr", "bin", "edgevpn")).To(BeARegularFile())
})
It("installs from container images", func() {
dir, err := os.MkdirTemp("", "test")
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(dir)
err = RunBundles([]BundleOption{WithDBPath(dir), WithRootFS(dir), WithTarget("container://quay.io/mocaccino/extra:edgevpn-utils-0.15.0")})
Expect(err).ToNot(HaveOccurred())
Expect(filepath.Join(dir, "usr", "bin", "edgevpn")).To(BeARegularFile())
})
})
})