Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hyperv: machine e2e tests for set command #20117

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions pkg/machine/e2e/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -202,16 +201,3 @@ func (matcher *ValidJSONMatcher) FailureMessage(actual interface{}) (message str
func (matcher *ValidJSONMatcher) NegatedFailureMessage(actual interface{}) (message string) {
return format.Message(actual, "to _not_ be valid JSON")
}

func checkReason(reason string) {
if len(reason) < 5 {
panic("Test must specify a reason to skip")
}
}

func SkipIfNotWindows(reason string) {
checkReason(reason)
if runtime.GOOS != "windows" {
Skip("[not windows]: " + reason)
}
}
6 changes: 4 additions & 2 deletions pkg/machine/e2e/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"
"strings"

"github.com/containers/podman/v4/pkg/machine"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
Expand Down Expand Up @@ -139,8 +140,9 @@ var _ = Describe("podman machine set", func() {
})

It("set user mode networking", func() {
SkipIfNotWindows("Setting user mode networking is only honored on Windows")

if testProvider.VMType() != machine.WSLVirt {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test now work on Linux or other non windows environments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is only for WSL

Skip("Test is only for WSL")
}
name := randomString()
i := new(initMachine)
session, err := mb.setName(name).setCmd(i.withImagePath(mb.imagePath)).run()
Expand Down