Update machine init/set tests

Init/Set with --rootful
Init/Set  with --user-mode-networking

Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
Ashley Cui
2023-08-17 02:29:57 -04:00
parent da81bc13a1
commit b6b300c798
5 changed files with 101 additions and 16 deletions

View File

@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"time"
@ -201,3 +202,16 @@ 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)
}
}