Merge pull request #27608 from kyounghunJang/feature/Add-DefaultNetwork

feat(info): expose default network name
This commit is contained in:
openshift-merge-bot[bot]
2025-11-28 11:20:27 +00:00
committed by GitHub

View File

@@ -167,6 +167,24 @@ var _ = Describe("Podman Info", func() {
Expect(session.OutputToString()).To(Equal("netavark"))
})
It("Podman info: check default network from configuration", func() {
configPath := filepath.Join(podmanTest.TempDir, "containers.conf")
os.Setenv("CONTAINERS_CONF_OVERRIDE", configPath)
customNetName := "my-custom-test-network"
configContent := fmt.Sprintf("[network]\ndefault_network=%q\n", customNetName)
err := os.WriteFile(configPath, []byte(configContent), os.ModePerm)
Expect(err).ToNot(HaveOccurred())
podmanTest.RestartRemoteService()
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.NetworkBackendInfo.DefaultNetwork}}"})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitCleanly())
Expect(session.OutputToString()).To(Equal(customNetName))
})
It("Podman info: check desired storage driver", func() {
// defined in .cirrus.yml
want := os.Getenv("CI_DESIRED_STORAGE")