mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-25 21:43:58 +00:00
Fix unit tests
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
@@ -19,9 +19,10 @@ package action_test
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
sdkTypes "github.com/kairos-io/kairos-sdk/types"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
sdkTypes "github.com/kairos-io/kairos-sdk/types"
|
||||||
|
|
||||||
agentConfig "github.com/kairos-io/kairos-agent/v2/pkg/config"
|
agentConfig "github.com/kairos-io/kairos-agent/v2/pkg/config"
|
||||||
fsutils "github.com/kairos-io/kairos-agent/v2/pkg/utils/fs"
|
fsutils "github.com/kairos-io/kairos-agent/v2/pkg/utils/fs"
|
||||||
|
|
||||||
@@ -449,8 +450,7 @@ var _ = Describe("Runtime Actions", func() {
|
|||||||
spec.Active.Size = 10
|
spec.Active.Size = 10
|
||||||
spec.Passive.Size = 10
|
spec.Passive.Size = 10
|
||||||
spec.Recovery.Size = 10
|
spec.Recovery.Size = 10
|
||||||
|
spec.Entry = constants.BootEntryRecovery
|
||||||
spec.RecoveryUpgrade = true
|
|
||||||
|
|
||||||
err = fsutils.MkdirAll(config.Fs, "/proc", constants.DirPerm)
|
err = fsutils.MkdirAll(config.Fs, "/proc", constants.DirPerm)
|
||||||
Expect(err).ShouldNot(HaveOccurred())
|
Expect(err).ShouldNot(HaveOccurred())
|
||||||
@@ -542,8 +542,7 @@ var _ = Describe("Runtime Actions", func() {
|
|||||||
spec.Active.Size = 10
|
spec.Active.Size = 10
|
||||||
spec.Passive.Size = 10
|
spec.Passive.Size = 10
|
||||||
spec.Recovery.Size = 10
|
spec.Recovery.Size = 10
|
||||||
|
spec.Entry = constants.BootEntryRecovery
|
||||||
spec.RecoveryUpgrade = true
|
|
||||||
|
|
||||||
err = fsutils.MkdirAll(config.Fs, "/proc", constants.DirPerm)
|
err = fsutils.MkdirAll(config.Fs, "/proc", constants.DirPerm)
|
||||||
Expect(err).ShouldNot(HaveOccurred())
|
Expect(err).ShouldNot(HaveOccurred())
|
||||||
|
@@ -17,11 +17,12 @@ limitations under the License.
|
|||||||
package v1_test
|
package v1_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/kairos-io/kairos-agent/v2/pkg/constants"
|
"github.com/kairos-io/kairos-agent/v2/pkg/constants"
|
||||||
v1 "github.com/kairos-io/kairos-agent/v2/pkg/types/v1"
|
v1 "github.com/kairos-io/kairos-agent/v2/pkg/types/v1"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
"path/filepath"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Types", Label("types", "config"), func() {
|
var _ = Describe("Types", Label("types", "config"), func() {
|
||||||
@@ -444,7 +445,7 @@ var _ = Describe("Types", Label("types", "config"), func() {
|
|||||||
})
|
})
|
||||||
Describe("Recovery upgrade", func() {
|
Describe("Recovery upgrade", func() {
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
spec.RecoveryUpgrade = true
|
spec.Entry = constants.BootEntryRecovery
|
||||||
})
|
})
|
||||||
It("fails with empty source", func() {
|
It("fails with empty source", func() {
|
||||||
err := spec.Sanitize()
|
err := spec.Sanitize()
|
||||||
|
Reference in New Issue
Block a user