mirror of
https://github.com/containers/podman.git
synced 2025-12-19 07:09:39 +08:00
Merge pull request #14037 from rhatdan/remoteuri
Report correct RemoteURI
This commit is contained in:
@@ -119,33 +119,31 @@ var _ = Describe("Podman Info", func() {
|
||||
Expect(string(out)).To(Equal(expect))
|
||||
})
|
||||
|
||||
It("podman info check RemoteSocket", func() {
|
||||
It("check RemoteSocket ", func() {
|
||||
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.RemoteSocket.Path}}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(MatchRegexp("/run/.*podman.*sock"))
|
||||
|
||||
if IsRemote() {
|
||||
session = podmanTest.Podman([]string{"info", "--format", "{{.Host.RemoteSocket.Exists}}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("true"))
|
||||
}
|
||||
})
|
||||
|
||||
It("verify ServiceIsRemote", func() {
|
||||
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.ServiceIsRemote}}"})
|
||||
session = podmanTest.Podman([]string{"info", "--format", "{{.Host.ServiceIsRemote}}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(Exit(0))
|
||||
|
||||
Expect(session).Should(Exit(0))
|
||||
if podmanTest.RemoteTest {
|
||||
Expect(session.OutputToString()).To(ContainSubstring("true"))
|
||||
Expect(session.OutputToString()).To(Equal("true"))
|
||||
} else {
|
||||
Expect(session.OutputToString()).To(ContainSubstring("false"))
|
||||
Expect(session.OutputToString()).To(Equal("false"))
|
||||
}
|
||||
|
||||
session = podmanTest.Podman([]string{"info", "--format", "{{.Host.RemoteSocket.Exists}}"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
if IsRemote() {
|
||||
Expect(session.OutputToString()).To(ContainSubstring("true"))
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
It("Podman info must contain cgroupControllers with ReleventControllers", func() {
|
||||
It("Podman info must contain cgroupControllers with RelevantControllers", func() {
|
||||
SkipIfRootless("Hard to tell which controllers are going to be enabled for rootless")
|
||||
SkipIfRootlessCgroupsV1("Disable cgroups not supported on cgroupv1 for rootless users")
|
||||
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.CgroupControllers}}"})
|
||||
|
||||
@@ -3180,8 +3180,10 @@ invalid kube kind
|
||||
Expect(ls).Should(Exit(0))
|
||||
Expect(ls.OutputToStringArray()).To(HaveLen(1))
|
||||
|
||||
containerLen := podmanTest.Podman([]string{"pod", "inspect", pod.Name, "--format", "'{{len .Containers}}'"})
|
||||
|
||||
containerLen := podmanTest.Podman([]string{"pod", "inspect", pod.Name, "--format", "{{len .Containers}}"})
|
||||
containerLen.WaitWithDefaultTimeout()
|
||||
Expect(containerLen).Should(Exit(0))
|
||||
Expect(containerLen.OutputToString()).To(Equal("2"))
|
||||
ctr01Name := "ctr01"
|
||||
ctr02Name := "ctr02"
|
||||
|
||||
@@ -3199,7 +3201,7 @@ invalid kube kind
|
||||
replace.WaitWithDefaultTimeout()
|
||||
Expect(replace).Should(Exit(0))
|
||||
|
||||
newContainerLen := podmanTest.Podman([]string{"pod", "inspect", newPod.Name, "--format", "'{{len .Containers}}'"})
|
||||
newContainerLen := podmanTest.Podman([]string{"pod", "inspect", newPod.Name, "--format", "{{len .Containers}}"})
|
||||
newContainerLen.WaitWithDefaultTimeout()
|
||||
Expect(newContainerLen).Should(Exit(0))
|
||||
Expect(newContainerLen.OutputToString()).NotTo(Equal(containerLen.OutputToString()))
|
||||
|
||||
@@ -247,7 +247,7 @@ var _ = Describe("podman system connection", func() {
|
||||
// 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")
|
||||
SkipIfNotRootless(fmt.Sprintf("FIXME: setup ssh keys when root. uid(%d) euid(%d)", os.Getuid(), os.Geteuid()))
|
||||
SkipIfSystemdNotRunning("cannot test connection heuristic if systemd is not running")
|
||||
SkipIfNotActive("sshd", "cannot test connection heuristic if sshd is not running")
|
||||
})
|
||||
|
||||
@@ -20,7 +20,7 @@ var _ = Describe("podman system service", func() {
|
||||
|
||||
// The timeout used to for the service to respond. As shown in #12167,
|
||||
// this may take some time on machines under high load.
|
||||
var timeout = 20
|
||||
var timeout = 30
|
||||
|
||||
BeforeEach(func() {
|
||||
tempdir, err := CreateTempDirInTempDir()
|
||||
|
||||
@@ -99,10 +99,9 @@ $c2[ ]\+tcp://localhost:54321[ ]\+true" \
|
||||
_SERVICE_PID=$!
|
||||
wait_for_port localhost $_SERVICE_PORT
|
||||
|
||||
# FIXME: #12023, RemoteSocket is always /run/something
|
||||
# run_podman info --format '{{.Host.RemoteSocket.Path}}'
|
||||
# is "$output" "tcp:localhost:$_SERVICE_PORT" \
|
||||
# "podman info works, and talks to the correct server"
|
||||
_run_podman_remote info --format '{{.Host.RemoteSocket.Path}}'
|
||||
is "$output" "tcp:localhost:$_SERVICE_PORT" \
|
||||
"podman info works, and talks to the correct server"
|
||||
|
||||
_run_podman_remote info --format '{{.Store.GraphRoot}}'
|
||||
is "$output" "${PODMAN_TMPDIR}/root" \
|
||||
|
||||
Reference in New Issue
Block a user