diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-22 10:57:05 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-27 21:10:15 +0100 |
commit | 266c4952a89be89b1741f9fa69443f51387dd5c6 (patch) | |
tree | 4a2c8b6162053964625906ee99cf6f6b5dad1220 /test | |
parent | 6df7409cb5a41c710164c42ed35e33b28f3f7214 (diff) | |
download | podman-266c4952a89be89b1741f9fa69443f51387dd5c6.tar.gz podman-266c4952a89be89b1741f9fa69443f51387dd5c6.tar.bz2 podman-266c4952a89be89b1741f9fa69443f51387dd5c6.zip |
tests: change return type for PodmanAsUser to PodmanTestIntegration
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/libpod_suite_test.go | 6 | ||||
-rw-r--r-- | test/utils/podmantest_test.go | 4 | ||||
-rw-r--r-- | test/utils/utils.go | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index 52507c083..f4f154ef2 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -181,6 +181,12 @@ func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration return &PodmanSessionIntegration{podmanSession} } +// PodmanAsUser is the exec call to podman on the filesystem with the specified uid/gid and environment +func (p *PodmanTestIntegration) PodmanAsUser(args []string, uid, gid uint32, env []string) *PodmanSessionIntegration { + podmanSession := p.PodmanAsUserBase(args, uid, gid, env) + return &PodmanSessionIntegration{podmanSession} +} + // PodmanPID execs podman and returns its PID func (p *PodmanTestIntegration) PodmanPID(args []string) (*PodmanSessionIntegration, int) { podmanOptions := p.MakeOptions(args) diff --git a/test/utils/podmantest_test.go b/test/utils/podmantest_test.go index 87f756920..60e3e2a97 100644 --- a/test/utils/podmantest_test.go +++ b/test/utils/podmantest_test.go @@ -19,11 +19,11 @@ var _ = Describe("PodmanTest test", func() { FakeOutputs = make(map[string][]string) }) - It("Test PodmanAsUser", func() { + It("Test PodmanAsUserBase", func() { FakeOutputs["check"] = []string{"check"} os.Setenv("HOOK_OPTION", "hook_option") env := os.Environ() - session := podmanTest.PodmanAsUser([]string{"check"}, 1000, 1000, env) + session := podmanTest.PodmanAsUserBase([]string{"check"}, 1000, 1000, env) os.Unsetenv("HOOK_OPTION") session.WaitWithDefaultTimeout() Expect(session.Command.Process).ShouldNot(BeNil()) diff --git a/test/utils/utils.go b/test/utils/utils.go index c9409c9d4..288c768d4 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -56,9 +56,9 @@ func (p *PodmanTest) MakeOptions(args []string) []string { return p.PodmanMakeOptions(args) } -// PodmanAsUser exec podman as user. uid and gid is set for credentials useage. env is used +// PodmanAsUserBase exec podman as user. uid and gid is set for credentials useage. env is used // to record the env for debugging -func (p *PodmanTest) PodmanAsUser(args []string, uid, gid uint32, env []string) *PodmanSession { +func (p *PodmanTest) PodmanAsUserBase(args []string, uid, gid uint32, env []string) *PodmanSession { var command *exec.Cmd podmanOptions := p.MakeOptions(args) @@ -86,7 +86,7 @@ func (p *PodmanTest) PodmanAsUser(args []string, uid, gid uint32, env []string) // PodmanBase exec podman with default env. func (p *PodmanTest) PodmanBase(args []string) *PodmanSession { - return p.PodmanAsUser(args, 0, 0, nil) + return p.PodmanAsUserBase(args, 0, 0, nil) } // WaitForContainer waits on a started container |