summaryrefslogtreecommitdiff
path: root/test/utils/utils.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-14 13:39:09 -0800
committerGitHub <noreply@github.com>2019-01-14 13:39:09 -0800
commit6301f6a0a9e3989ecdf59fd5395d06c44f8bac14 (patch)
treea9aac949e6b94cd46557fa82f29ca30aa7bdedff /test/utils/utils.go
parent30f115a96034275fc7136b1ec576d57ec2cf099e (diff)
parentb30a56c15613428c80033b97e81db7d3d8ed84e6 (diff)
downloadpodman-6301f6a0a9e3989ecdf59fd5395d06c44f8bac14.tar.gz
podman-6301f6a0a9e3989ecdf59fd5395d06c44f8bac14.tar.bz2
podman-6301f6a0a9e3989ecdf59fd5395d06c44f8bac14.zip
Merge pull request #2155 from baude/remotetestenable
Run integrations test with remote-client
Diffstat (limited to 'test/utils/utils.go')
-rw-r--r--test/utils/utils.go24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/utils/utils.go b/test/utils/utils.go
index 288c768d4..23dcb95e3 100644
--- a/test/utils/utils.go
+++ b/test/utils/utils.go
@@ -33,10 +33,13 @@ type PodmanTestCommon interface {
// PodmanTest struct for command line options
type PodmanTest struct {
- PodmanMakeOptions func(args []string) []string
- PodmanBinary string
- ArtifactPath string
- TempDir string
+ PodmanMakeOptions func(args []string) []string
+ PodmanBinary string
+ ArtifactPath string
+ TempDir string
+ RemoteTest bool
+ RemotePodmanBinary string
+ VarlinkSession *os.Process
}
// PodmanSession wraps the gexec.session so we can extend it
@@ -61,17 +64,20 @@ func (p *PodmanTest) MakeOptions(args []string) []string {
func (p *PodmanTest) PodmanAsUserBase(args []string, uid, gid uint32, env []string) *PodmanSession {
var command *exec.Cmd
podmanOptions := p.MakeOptions(args)
-
+ podmanBinary := p.PodmanBinary
+ if p.RemoteTest {
+ podmanBinary = p.RemotePodmanBinary
+ }
if env == nil {
- fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))
+ fmt.Printf("Running: %s %s\n", podmanBinary, strings.Join(podmanOptions, " "))
} else {
- fmt.Printf("Running: (env: %v) %s %s\n", env, p.PodmanBinary, strings.Join(podmanOptions, " "))
+ fmt.Printf("Running: (env: %v) %s %s\n", env, podmanBinary, strings.Join(podmanOptions, " "))
}
if uid != 0 || gid != 0 {
- nsEnterOpts := append([]string{"--userspec", fmt.Sprintf("%d:%d", uid, gid), "/", p.PodmanBinary}, podmanOptions...)
+ nsEnterOpts := append([]string{"--userspec", fmt.Sprintf("%d:%d", uid, gid), "/", podmanBinary}, podmanOptions...)
command = exec.Command("chroot", nsEnterOpts...)
} else {
- command = exec.Command(p.PodmanBinary, podmanOptions...)
+ command = exec.Command(podmanBinary, podmanOptions...)
}
if env != nil {
command.Env = env