mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-06-03 01:44:53 +00:00
robot: Add bundle test
This commit is contained in:
parent
22aaaee52c
commit
fc21b17f0c
34
internal/machine/bundle_test.go
Normal file
34
internal/machine/bundle_test.go
Normal file
@ -0,0 +1,34 @@
|
||||
package machine_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
. "github.com/c3os-io/c3os/internal/machine"
|
||||
. "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 := ioutil.TempDir("", "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 := ioutil.TempDir("", "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())
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user