Skip to content

Commit

Permalink
Adapt tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
  • Loading branch information
kke committed Jan 4, 2024
1 parent a08415b commit 6eeb781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions configurer/linux/linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package linux

import (
"fmt"
"io"
"testing"

"github.com/k0sproject/rig/exec"
Expand Down Expand Up @@ -35,6 +36,10 @@ func (m mockHost) ExecOutputf(string, ...interface{}) (string, error) {
return "", nil
}

func (m mockHost) ExecStreams(cmd string, stdin io.ReadCloser, stdout io.Writer, stderr io.Writer, opts ...exec.Option) (exec.Waiter, error) {
return nil, nil
}

func (m mockHost) String() string {
return ""
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

cfg "github.com/k0sproject/k0sctl/configurer"
"github.com/k0sproject/k0sctl/configurer/linux"
"github.com/k0sproject/rig"
"github.com/k0sproject/rig/exec"
"github.com/k0sproject/rig/os"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -69,7 +70,8 @@ func TestUnQE(t *testing.T) {
}

func TestK0sInstallCommand(t *testing.T) {
h := Host{Role: "worker", DataDir: "/tmp/k0s"}
h := Host{Role: "worker", DataDir: "/tmp/k0s", Connection: rig.Connection{Localhost: &rig.Localhost{Enabled: true}}}
_ = h.Connect()
h.Configurer = &mockconfigurer{}
h.Configurer.SetPath("K0sConfigPath", "from-configurer")
h.Configurer.SetPath("K0sJoinTokenPath", "from-configurer")
Expand Down

0 comments on commit 6eeb781

Please sign in to comment.