summaryrefslogtreecommitdiff
path: root/test/utils/utils.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-01-14 13:23:13 -0600
committerbaude <bbaude@redhat.com>2019-01-14 14:51:32 -0600
commitb30a56c15613428c80033b97e81db7d3d8ed84e6 (patch)
treea9aac949e6b94cd46557fa82f29ca30aa7bdedff /test/utils/utils.go
parent30f115a96034275fc7136b1ec576d57ec2cf099e (diff)
downloadpodman-b30a56c15613428c80033b97e81db7d3d8ed84e6.tar.gz
podman-b30a56c15613428c80033b97e81db7d3d8ed84e6.tar.bz2
podman-b30a56c15613428c80033b97e81db7d3d8ed84e6.zip
Run integrations test with remote-client
Add the ability to run the integration (ginkgo) suite using the remote client. Only the images_test.go file is run right now; all the rest are isolated with a // +build !remotelinux. As more content is developed for the remote client, we can unblock the files and just block single tests as needed. Signed-off-by: baude <bbaude@redhat.com>
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