mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
pkg/machine/e2e: move windows-specific function to windows file
This allows to remove the 'nolint' annotation. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@ -259,21 +259,3 @@ func isVmtype(vmType define.VMType) bool {
|
||||
func isWSL() bool {
|
||||
return isVmtype(define.WSLVirt)
|
||||
}
|
||||
|
||||
// Only used on Windows
|
||||
//
|
||||
//nolint:unparam,unused
|
||||
func runSystemCommand(binary string, cmdArgs []string, timeout time.Duration, wait bool) (*machineSession, error) {
|
||||
GinkgoWriter.Println(binary + " " + strings.Join(cmdArgs, " "))
|
||||
c := exec.Command(binary, cmdArgs...)
|
||||
session, err := Start(c, GinkgoWriter, GinkgoWriter)
|
||||
if err != nil {
|
||||
Fail(fmt.Sprintf("Unable to start session: %q", err))
|
||||
return nil, err
|
||||
}
|
||||
ms := machineSession{session}
|
||||
if wait {
|
||||
ms.waitWithTimeout(timeout)
|
||||
}
|
||||
return &ms, nil
|
||||
}
|
||||
|
@ -4,6 +4,10 @@ import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega/gexec"
|
||||
|
||||
"github.com/containers/podman/v5/pkg/machine/define"
|
||||
)
|
||||
@ -34,3 +38,18 @@ func getOtherProvider() string {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func runSystemCommand(binary string, cmdArgs []string, timeout time.Duration, wait bool) (*machineSession, error) {
|
||||
GinkgoWriter.Println(binary + " " + strings.Join(cmdArgs, " "))
|
||||
c := exec.Command(binary, cmdArgs...)
|
||||
session, err := Start(c, GinkgoWriter, GinkgoWriter)
|
||||
if err != nil {
|
||||
Fail(fmt.Sprintf("Unable to start session: %q", err))
|
||||
return nil, err
|
||||
}
|
||||
ms := machineSession{session}
|
||||
if wait {
|
||||
ms.waitWithTimeout(timeout)
|
||||
}
|
||||
return &ms, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user