mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
Merge pull request #20117 from baude/hypervsettest
hyperv: machine e2e tests for set command
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
@ -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 {
|
||||
Skip("Test is only for WSL")
|
||||
}
|
||||
name := randomString()
|
||||
i := new(initMachine)
|
||||
session, err := mb.setName(name).setCmd(i.withImagePath(mb.imagePath)).run()
|
||||
|
Reference in New Issue
Block a user