summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-08 18:53:29 +0100
committerGitHub <noreply@github.com>2021-11-08 18:53:29 +0100
commitd0a44755c75763d2f5c656dca15b6bb928c961c4 (patch)
tree9f30abae7a8125f98290dc945476854357b1bfe9 /test/e2e
parentabfec8144a57265e644dbfec93f5b6201b7da945 (diff)
parente907f095b24632ebf25348bc17ba3ff3468a979b (diff)
downloadpodman-d0a44755c75763d2f5c656dca15b6bb928c961c4.tar.gz
podman-d0a44755c75763d2f5c656dca15b6bb928c961c4.tar.bz2
podman-d0a44755c75763d2f5c656dca15b6bb928c961c4.zip
Merge pull request #12036 from jwhonce/issues/11984
test connection add
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/common_test.go76
-rw-r--r--test/e2e/libpod_suite_remote_test.go8
-rw-r--r--test/e2e/libpod_suite_test.go3
-rw-r--r--test/e2e/system_connection_test.go420
4 files changed, 280 insertions, 227 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index e598f7ab9..200faae2d 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -208,9 +208,7 @@ var _ = SynchronizedAfterSuite(func() {},
// PodmanTestCreate creates a PodmanTestIntegration instance for the tests
func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
- var (
- podmanRemoteBinary string
- )
+ var podmanRemoteBinary string
host := GetHostDistributionInfo()
cwd, _ := os.Getwd()
@@ -220,12 +218,11 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
podmanBinary = os.Getenv("PODMAN_BINARY")
}
- if remote {
- podmanRemoteBinary = filepath.Join(cwd, "../../bin/podman-remote")
- if os.Getenv("PODMAN_REMOTE_BINARY") != "" {
- podmanRemoteBinary = os.Getenv("PODMAN_REMOTE_BINARY")
- }
+ podmanRemoteBinary = filepath.Join(cwd, "../../bin/podman-remote")
+ if os.Getenv("PODMAN_REMOTE_BINARY") != "" {
+ podmanRemoteBinary = os.Getenv("PODMAN_REMOTE_BINARY")
}
+
conmonBinary := filepath.Join("/usr/libexec/podman/conmon")
altConmonBinary := "/usr/bin/conmon"
if _, err := os.Stat(conmonBinary); os.IsNotExist(err) {
@@ -271,12 +268,13 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
p := &PodmanTestIntegration{
PodmanTest: PodmanTest{
- PodmanBinary: podmanBinary,
- ArtifactPath: ARTIFACT_DIR,
- TempDir: tempDir,
- RemoteTest: remote,
- ImageCacheFS: storageFs,
- ImageCacheDir: ImageCacheDir,
+ PodmanBinary: podmanBinary,
+ RemotePodmanBinary: podmanRemoteBinary,
+ ArtifactPath: ARTIFACT_DIR,
+ TempDir: tempDir,
+ RemoteTest: remote,
+ ImageCacheFS: storageFs,
+ ImageCacheDir: ImageCacheDir,
},
ConmonBinary: conmonBinary,
CrioRoot: filepath.Join(tempDir, "crio"),
@@ -289,8 +287,8 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
CgroupManager: cgroupManager,
Host: host,
}
+
if remote {
- p.PodmanTest.RemotePodmanBinary = podmanRemoteBinary
uuid := stringid.GenerateNonCryptoID()
if !rootless.IsRootless() {
p.RemoteSocket = fmt.Sprintf("unix:/run/podman/podman-%s.sock", uuid)
@@ -632,6 +630,19 @@ func SkipIfNotRootless(reason string) {
}
}
+func SkipIfSystemdNotRunning(reason string) {
+ checkReason(reason)
+
+ cmd := exec.Command("systemctl", "list-units")
+ err := cmd.Run()
+ if err != nil {
+ if _, ok := err.(*exec.Error); ok {
+ ginkgo.Skip("[notSystemd]: not running " + reason)
+ }
+ Expect(err).ToNot(HaveOccurred())
+ }
+}
+
func SkipIfNotSystemd(manager, reason string) {
checkReason(reason)
if manager != "systemd" {
@@ -683,6 +694,41 @@ func SkipIfContainerized(reason string) {
}
}
+func SkipIfRemote(reason string) {
+ checkReason(reason)
+ if !IsRemote() {
+ return
+ }
+ ginkgo.Skip("[remote]: " + reason)
+}
+
+// SkipIfInContainer skips a test if the test is run inside a container
+func SkipIfInContainer(reason string) {
+ checkReason(reason)
+ if os.Getenv("TEST_ENVIRON") == "container" {
+ Skip("[container]: " + reason)
+ }
+}
+
+// SkipIfNotActive skips a test if the given systemd unit is not active
+func SkipIfNotActive(unit string, reason string) {
+ checkReason(reason)
+
+ var buffer bytes.Buffer
+ cmd := exec.Command("systemctl", "is-active", unit)
+ cmd.Stdout = &buffer
+ err := cmd.Start()
+ Expect(err).ToNot(HaveOccurred())
+
+ err = cmd.Wait()
+ Expect(err).ToNot(HaveOccurred())
+
+ Expect(err).ToNot(HaveOccurred())
+ if strings.TrimSpace(buffer.String()) != "active" {
+ Skip(fmt.Sprintf("[systemd]: unit %s is not active: %s", unit, reason))
+ }
+}
+
// 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, cwd string, env []string) *PodmanSessionIntegration {
podmanSession := p.PodmanAsUserBase(args, uid, gid, cwd, env, false, false, nil, nil)
diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go
index ad511cc9e..1fa29daa1 100644
--- a/test/e2e/libpod_suite_remote_test.go
+++ b/test/e2e/libpod_suite_remote_test.go
@@ -16,20 +16,12 @@ import (
"time"
"github.com/containers/podman/v3/pkg/rootless"
- "github.com/onsi/ginkgo"
)
func IsRemote() bool {
return true
}
-func SkipIfRemote(reason string) {
- if len(reason) < 5 {
- panic("SkipIfRemote must specify a reason to skip")
- }
- ginkgo.Skip("[remote]: " + reason)
-}
-
// Podman is the exec call to podman on the filesystem
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
var remoteArgs = []string{"--remote", "--url", p.RemoteSocket}
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go
index 6d2d3fee8..001a869b1 100644
--- a/test/e2e/libpod_suite_test.go
+++ b/test/e2e/libpod_suite_test.go
@@ -16,9 +16,6 @@ func IsRemote() bool {
return false
}
-func SkipIfRemote(string) {
-}
-
// Podman is the exec call to podman on the filesystem
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
podmanSession := p.PodmanBase(args, false, false)
diff --git a/test/e2e/system_connection_test.go b/test/e2e/system_connection_test.go
index d80e6d5a0..c0e29d525 100644
--- a/test/e2e/system_connection_test.go
+++ b/test/e2e/system_connection_test.go
@@ -3,7 +3,11 @@ package integration
import (
"fmt"
"io/ioutil"
+ "net/url"
"os"
+ "os/exec"
+ "os/user"
+ "path/filepath"
"github.com/containers/common/pkg/config"
. "github.com/containers/podman/v3/test/utils"
@@ -19,22 +23,16 @@ var _ = Describe("podman system connection", func() {
IsSet bool
}{}
- var (
- podmanTest *PodmanTestIntegration
- )
+ var podmanTest *PodmanTestIntegration
BeforeEach(func() {
ConfPath.Value, ConfPath.IsSet = os.LookupEnv("CONTAINERS_CONF")
conf, err := ioutil.TempFile("", "containersconf")
- if err != nil {
- panic(err)
- }
+ Expect(err).ToNot(HaveOccurred())
os.Setenv("CONTAINERS_CONF", conf.Name())
tempdir, err := CreateTempDirInTempDir()
- if err != nil {
- panic(err)
- }
+ Expect(err).ToNot(HaveOccurred())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
})
@@ -49,221 +47,241 @@ var _ = Describe("podman system connection", func() {
}
f := CurrentGinkgoTestDescription()
- timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ GinkgoWriter.Write(
+ []byte(
+ fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())))
})
- It("add ssh://", func() {
- cmd := []string{"system", "connection", "add",
- "--default",
- "--identity", "~/.ssh/id_rsa",
- "QA",
- "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
- }
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
-
- cfg, err := config.ReadCustomConfig()
- Expect(err).ShouldNot(HaveOccurred())
- Expect(cfg.Engine.ActiveService).To(Equal("QA"))
- Expect(cfg.Engine.ServiceDestinations["QA"]).To(Equal(
- config.Destination{
- URI: "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
- Identity: "~/.ssh/id_rsa",
- },
- ))
-
- cmd = []string{"system", "connection", "rename",
- "QA",
- "QE",
- }
- session = podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
-
- cfg, err = config.ReadCustomConfig()
- Expect(err).ShouldNot(HaveOccurred())
- Expect(cfg.Engine.ActiveService).To(Equal("QE"))
- Expect(cfg.Engine.ServiceDestinations["QE"]).To(Equal(
- config.Destination{
- URI: "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
- Identity: "~/.ssh/id_rsa",
- },
- ))
- })
+ Context("without running API service", func() {
+ It("add ssh://", func() {
+ cmd := []string{"system", "connection", "add",
+ "--default",
+ "--identity", "~/.ssh/id_rsa",
+ "QA",
+ "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
+ }
+ session := podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.Out.Contents()).Should(BeEmpty())
- It("add UDS", func() {
- cmd := []string{"system", "connection", "add",
- "QA-UDS",
- "unix:///run/podman/podman.sock",
- }
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
-
- cfg, err := config.ReadCustomConfig()
- Expect(err).ShouldNot(HaveOccurred())
- Expect(cfg.Engine.ActiveService).To(Equal("QA-UDS"))
- Expect(cfg.Engine.ServiceDestinations["QA-UDS"]).To(Equal(
- config.Destination{
- URI: "unix:///run/podman/podman.sock",
- Identity: "",
- },
- ))
-
- cmd = []string{"system", "connection", "add",
- "QA-UDS1",
- "--socket-path", "/run/user/podman/podman.sock",
- "unix:///run/podman/podman.sock",
- }
- session = podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
-
- cfg, err = config.ReadCustomConfig()
- Expect(err).ShouldNot(HaveOccurred())
- Expect(cfg.Engine.ActiveService).To(Equal("QA-UDS"))
- Expect(cfg.Engine.ServiceDestinations["QA-UDS1"]).To(Equal(
- config.Destination{
- URI: "unix:///run/user/podman/podman.sock",
- Identity: "",
- },
- ))
- })
+ cfg, err := config.ReadCustomConfig()
+ Expect(err).ShouldNot(HaveOccurred())
+ Expect(cfg).To(HaveActiveService("QA"))
+ Expect(cfg).Should(VerifyService(
+ "QA",
+ "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
+ "~/.ssh/id_rsa",
+ ))
- It("add tcp", func() {
- cmd := []string{"system", "connection", "add",
- "QA-TCP",
- "tcp://localhost:8888",
- }
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
-
- cfg, err := config.ReadCustomConfig()
- Expect(err).ShouldNot(HaveOccurred())
- Expect(cfg.Engine.ActiveService).To(Equal("QA-TCP"))
- Expect(cfg.Engine.ServiceDestinations["QA-TCP"]).To(Equal(
- config.Destination{
- URI: "tcp://localhost:8888",
- Identity: "",
- },
- ))
- })
+ cmd = []string{"system", "connection", "rename",
+ "QA",
+ "QE",
+ }
+ session = podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
- It("remove", func() {
- cmd := []string{"system", "connection", "add",
- "--default",
- "--identity", "~/.ssh/id_rsa",
- "QA",
- "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
- }
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
+ Expect(config.ReadCustomConfig()).To(HaveActiveService("QE"))
+ })
- for i := 0; i < 2; i++ {
- cmd = []string{"system", "connection", "remove", "QA"}
+ It("add UDS", func() {
+ cmd := []string{"system", "connection", "add",
+ "QA-UDS",
+ "unix:///run/podman/podman.sock",
+ }
+ session := podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.Out.Contents()).Should(BeEmpty())
+
+ Expect(config.ReadCustomConfig()).Should(VerifyService(
+ "QA-UDS",
+ "unix:///run/podman/podman.sock",
+ "",
+ ))
+
+ cmd = []string{"system", "connection", "add",
+ "QA-UDS1",
+ "--socket-path", "/run/user/podman/podman.sock",
+ "unix:///run/podman/podman.sock",
+ }
session = podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
+ Expect(session.Out.Contents()).Should(BeEmpty())
- cfg, err := config.ReadCustomConfig()
- Expect(err).ShouldNot(HaveOccurred())
- Expect(cfg.Engine.ActiveService).To(BeEmpty())
- Expect(cfg.Engine.ServiceDestinations).To(BeEmpty())
- }
- })
-
- It("remove --all", func() {
- cmd := []string{"system", "connection", "add",
- "--default",
- "--identity", "~/.ssh/id_rsa",
- "QA",
- "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
- }
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
-
- cmd = []string{"system", "connection", "remove", "--all"}
- session = podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
-
- cmd = []string{"system", "connection", "list"}
- session = podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
- Expect(session.Err).Should(Say(""))
- })
+ Expect(config.ReadCustomConfig()).Should(HaveActiveService("QA-UDS"))
+ Expect(config.ReadCustomConfig()).Should(VerifyService(
+ "QA-UDS1",
+ "unix:///run/user/podman/podman.sock",
+ "",
+ ))
+ })
- It("default", func() {
- for _, name := range []string{"devl", "qe"} {
+ It("add tcp", func() {
cmd := []string{"system", "connection", "add",
+ "QA-TCP",
+ "tcp://localhost:8888",
+ }
+ session := podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.Out.Contents()).Should(BeEmpty())
+
+ Expect(config.ReadCustomConfig()).Should(VerifyService(
+ "QA-TCP",
+ "tcp://localhost:8888",
+ "",
+ ))
+ })
+
+ It("remove", func() {
+ session := podmanTest.Podman([]string{"system", "connection", "add",
"--default",
"--identity", "~/.ssh/id_rsa",
- name,
+ "QA",
"ssh://root@server.fubar.com:2222/run/podman/podman.sock",
+ })
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ // two passes to test that removing non-existent connection is not an error
+ for i := 0; i < 2; i++ {
+ session = podmanTest.Podman([]string{"system", "connection", "remove", "QA"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.Out.Contents()).Should(BeEmpty())
+
+ cfg, err := config.ReadCustomConfig()
+ Expect(err).ShouldNot(HaveOccurred())
+ Expect(cfg.Engine.ActiveService).To(BeEmpty())
+ Expect(cfg.Engine.ServiceDestinations).To(BeEmpty())
+ }
+ })
+
+ It("remove --all", func() {
+ session := podmanTest.Podman([]string{"system", "connection", "add",
+ "--default",
+ "--identity", "~/.ssh/id_rsa",
+ "QA",
+ "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
+ })
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"system", "connection", "remove", "--all"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.Out.Contents()).Should(BeEmpty())
+ Expect(session.Err.Contents()).Should(BeEmpty())
+
+ session = podmanTest.Podman([]string{"system", "connection", "list"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ })
+
+ It("default", func() {
+ for _, name := range []string{"devl", "qe"} {
+ cmd := []string{"system", "connection", "add",
+ "--default",
+ "--identity", "~/.ssh/id_rsa",
+ name,
+ "ssh://root@server.fubar.com:2222/run/podman/podman.sock",
+ }
+ session := podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
}
+
+ cmd := []string{"system", "connection", "default", "devl"}
session := podmanTest.Podman(cmd)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- }
+ Expect(session.Out.Contents()).Should(BeEmpty())
- cmd := []string{"system", "connection", "default", "devl"}
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
-
- cfg, err := config.ReadCustomConfig()
- Expect(err).ShouldNot(HaveOccurred())
- Expect(cfg.Engine.ActiveService).To(Equal("devl"))
-
- cmd = []string{"system", "connection", "list"}
- session = podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say("Name *URI *Identity *Default"))
-
- cmd = []string{"system", "connection", "list", "--format", "{{.Name}}"}
- session = podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.OutputToString()).Should(Equal("devl qe"))
- })
+ Expect(config.ReadCustomConfig()).Should(HaveActiveService("devl"))
- It("failed default", func() {
- cmd := []string{"system", "connection", "default", "devl"}
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).ShouldNot(Exit(0))
- Expect(session.Err).Should(Say("destination is not defined"))
- })
+ cmd = []string{"system", "connection", "list"}
+ session = podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.Out).Should(Say("Name *URI *Identity *Default"))
- It("failed rename", func() {
- cmd := []string{"system", "connection", "rename", "devl", "QE"}
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).ShouldNot(Exit(0))
- Expect(session.Err).Should(Say("destination is not defined"))
+ cmd = []string{"system", "connection", "list", "--format", "{{.Name}}"}
+ session = podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).Should(Equal("devl qe"))
+ })
+
+ It("failed default", func() {
+ cmd := []string{"system", "connection", "default", "devl"}
+ session := podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).ShouldNot(Exit(0))
+ Expect(session.Err).Should(Say("destination is not defined"))
+ })
+
+ It("failed rename", func() {
+ cmd := []string{"system", "connection", "rename", "devl", "QE"}
+ session := podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).ShouldNot(Exit(0))
+ Expect(session.Err).Should(Say("destination is not defined"))
+ })
+
+ It("empty list", func() {
+ cmd := []string{"system", "connection", "list"}
+ session := podmanTest.Podman(cmd)
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.Out.Contents()).Should(BeEmpty())
+ Expect(session.Err.Contents()).Should(BeEmpty())
+ })
})
- It("empty list", func() {
- cmd := []string{"system", "connection", "list"}
- session := podmanTest.Podman(cmd)
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(session.Out).Should(Say(""))
- Expect(session.Err).Should(Say(""))
+ Context("sshd and API services required", func() {
+ BeforeEach(func() {
+ // These tests are unique in as much as they require podman, podman-remote, systemd and sshd.
+ // podman-remote commands will be executed by ginkgo directly.
+ SkipIfContainerized("sshd is not available when running in a container")
+ SkipIfRemote("connection heuristic requires both podman and podman-remote binaries")
+ SkipIfNotRootless("FIXME: setup ssh keys when root")
+ SkipIfSystemdNotRunning("cannot test connection heuristic if systemd is not running")
+ SkipIfNotActive("sshd", "cannot test connection heuristic if sshd is not running")
+ })
+
+ It("add ssh:// socket path using connection heuristic", func() {
+ u, err := user.Current()
+ Expect(err).ShouldNot(HaveOccurred())
+
+ cmd := exec.Command(podmanTest.RemotePodmanBinary,
+ "system", "connection", "add",
+ "--default",
+ "--identity", filepath.Join(u.HomeDir, ".ssh", "id_ed25519"),
+ "QA",
+ fmt.Sprintf("ssh://%s@localhost", u.Username))
+
+ session, err := Start(cmd, GinkgoWriter, GinkgoWriter)
+ Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("%q failed to execute", podmanTest.RemotePodmanBinary))
+ Eventually(session, DefaultWaitTimeout).Should(Exit(0))
+ Expect(session.Out.Contents()).Should(BeEmpty())
+ Expect(session.Err.Contents()).Should(BeEmpty())
+
+ uri := url.URL{
+ Scheme: "ssh",
+ User: url.User(u.Username),
+ Host: "localhost:22",
+ Path: fmt.Sprintf("/run/user/%s/podman/podman.sock", u.Uid),
+ }
+
+ Expect(config.ReadCustomConfig()).Should(HaveActiveService("QA"))
+ Expect(config.ReadCustomConfig()).Should(VerifyService(
+ "QA",
+ uri.String(),
+ filepath.Join(u.HomeDir, ".ssh", "id_ed25519"),
+ ))
+ })
})
})