summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/checkpoint_test.go22
-rw-r--r--test/e2e/common_test.go6
-rw-r--r--test/e2e/container_clone_test.go13
-rw-r--r--test/e2e/create_staticmac_test.go2
-rw-r--r--test/e2e/create_test.go2
-rw-r--r--test/e2e/diff_test.go10
-rw-r--r--test/e2e/events_test.go6
-rw-r--r--test/e2e/generate_kube_test.go2
-rw-r--r--test/e2e/generate_systemd_test.go38
-rw-r--r--test/e2e/logs_test.go2
-rw-r--r--test/e2e/network_connect_disconnect_test.go30
-rw-r--r--test/e2e/network_create_test.go46
-rw-r--r--test/e2e/network_test.go40
-rw-r--r--test/e2e/play_kube_test.go6
-rw-r--r--test/e2e/pod_ps_test.go6
-rw-r--r--test/e2e/pod_rm_test.go27
-rw-r--r--test/e2e/ps_test.go6
-rw-r--r--test/e2e/run_networking_test.go10
-rw-r--r--test/e2e/run_staticip_test.go2
-rw-r--r--test/e2e/run_test.go4
-rw-r--r--test/e2e/run_working_dir_test.go9
-rw-r--r--test/e2e/volume_exists_test.go4
-rw-r--r--test/e2e/volume_ls_test.go5
-rw-r--r--test/e2e/volume_plugin_test.go6
24 files changed, 188 insertions, 116 deletions
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go
index 16e43aa73..a33936549 100644
--- a/test/e2e/checkpoint_test.go
+++ b/test/e2e/checkpoint_test.go
@@ -95,13 +95,15 @@ var _ = Describe("Podman checkpoint", func() {
It("podman checkpoint bogus container", func() {
session := podmanTest.Podman([]string{"container", "checkpoint", "foobar"})
session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
+ Expect(session).Should(Exit(125))
+ Expect(session.ErrorToString()).To(ContainSubstring("no such container"))
})
It("podman restore bogus container", func() {
session := podmanTest.Podman([]string{"container", "restore", "foobar"})
session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
+ Expect(session).Should(Exit(125))
+ Expect(session.ErrorToString()).To(ContainSubstring("no such container or image"))
})
It("podman checkpoint a running container by id", func() {
@@ -585,6 +587,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -604,6 +607,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -623,6 +627,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -642,6 +647,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -659,6 +665,7 @@ var _ = Describe("Podman checkpoint", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(125))
+ Expect(result.ErrorToString()).To(ContainSubstring("not supported"))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
Expect(podmanTest.NumberOfContainers()).To(Equal(1))
@@ -704,6 +711,7 @@ var _ = Describe("Podman checkpoint", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -754,6 +762,7 @@ var _ = Describe("Podman checkpoint", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -796,6 +805,7 @@ var _ = Describe("Podman checkpoint", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -834,6 +844,7 @@ var _ = Describe("Podman checkpoint", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -884,6 +895,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -954,6 +966,7 @@ var _ = Describe("Podman checkpoint", func() {
result = podmanTest.Podman([]string{"container", "checkpoint", cid, "-e", checkpointFileName})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -1057,6 +1070,7 @@ var _ = Describe("Podman checkpoint", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring("Exited"))
@@ -1103,6 +1117,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -1317,6 +1332,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -1648,6 +1664,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
@@ -1802,6 +1819,7 @@ var _ = Describe("Podman checkpoint", func() {
// As the container has been started with '--rm' it will be completely
// cleaned up after checkpointing.
Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(cid))
fixmeFixme14653(podmanTest, cid)
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.NumberOfContainers()).To(Equal(0))
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index 8fe89f32e..690e2f22c 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -306,7 +306,7 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
// happens. So, use a podman-%s.sock-lock empty file as a marker.
tries := 0
for {
- uuid := stringid.GenerateNonCryptoID()
+ uuid := stringid.GenerateRandomID()
lockPath := fmt.Sprintf("%s-%s.sock-lock", pathPrefix, uuid)
lockFile, err := os.OpenFile(lockPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0700)
if err == nil {
@@ -894,7 +894,7 @@ func generateNetworkConfig(p *PodmanTestIntegration) (string, string) {
conf string
)
// generate a random name to prevent conflicts with other tests
- name := "net" + stringid.GenerateNonCryptoID()
+ name := "net" + stringid.GenerateRandomID()
if p.NetworkBackend != Netavark {
path = filepath.Join(p.NetworkConfigDir, fmt.Sprintf("%s.conflist", name))
conf = fmt.Sprintf(`{
@@ -1030,7 +1030,7 @@ func ncz(port int) bool {
}
func createNetworkName(name string) string {
- return name + stringid.GenerateNonCryptoID()[:10]
+ return name + stringid.GenerateRandomID()[:10]
}
var IPRegex = `(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}`
diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go
index 1ba5de1a3..29ef3bc2a 100644
--- a/test/e2e/container_clone_test.go
+++ b/test/e2e/container_clone_test.go
@@ -308,5 +308,18 @@ var _ = Describe("Podman container clone", func() {
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).Should(ContainSubstring("123"))
+ session = podmanTest.Podman([]string{"run", "--name", "env_ctr2", "-e", "ENV_TEST=12=3", ALPINE, "printenv", "ENV_TEST"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"container", "clone", "env_ctr2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"start", "-a", "env_ctr2-clone"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).Should(ContainSubstring("12=3"))
+
})
})
diff --git a/test/e2e/create_staticmac_test.go b/test/e2e/create_staticmac_test.go
index 32deb04a8..f7ddfe50c 100644
--- a/test/e2e/create_staticmac_test.go
+++ b/test/e2e/create_staticmac_test.go
@@ -48,7 +48,7 @@ var _ = Describe("Podman run with --mac-address flag", func() {
})
It("Podman run --mac-address with custom network", func() {
- net := "n1" + stringid.GenerateNonCryptoID()
+ net := "n1" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", net})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index b35d0f3c5..d5920dc3e 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -595,7 +595,7 @@ var _ = Describe("Podman create", func() {
pod.WaitWithDefaultTimeout()
Expect(pod).Should(Exit(0))
- netName := "pod" + stringid.GenerateNonCryptoID()
+ netName := "pod" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/diff_test.go b/test/e2e/diff_test.go
index a1f57f41b..c7f235e29 100644
--- a/test/e2e/diff_test.go
+++ b/test/e2e/diff_test.go
@@ -93,9 +93,9 @@ var _ = Describe("Podman diff", func() {
})
It("podman image diff", func() {
- file1 := "/" + stringid.GenerateNonCryptoID()
- file2 := "/" + stringid.GenerateNonCryptoID()
- file3 := "/" + stringid.GenerateNonCryptoID()
+ file1 := "/" + stringid.GenerateRandomID()
+ file2 := "/" + stringid.GenerateRandomID()
+ file3 := "/" + stringid.GenerateRandomID()
// Create container image with the files
containerfile := fmt.Sprintf(`
@@ -152,8 +152,8 @@ RUN echo test
})
It("podman diff container and image with same name", func() {
- imagefile := "/" + stringid.GenerateNonCryptoID()
- confile := "/" + stringid.GenerateNonCryptoID()
+ imagefile := "/" + stringid.GenerateRandomID()
+ confile := "/" + stringid.GenerateRandomID()
// Create container image with the files
containerfile := fmt.Sprintf(`
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go
index d54265558..bba42c3f4 100644
--- a/test/e2e/events_test.go
+++ b/test/e2e/events_test.go
@@ -154,9 +154,9 @@ var _ = Describe("Podman events", func() {
})
It("podman events --until future", func() {
- name1 := stringid.GenerateNonCryptoID()
- name2 := stringid.GenerateNonCryptoID()
- name3 := stringid.GenerateNonCryptoID()
+ name1 := stringid.GenerateRandomID()
+ name2 := stringid.GenerateRandomID()
+ name3 := stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"create", "--name", name1, ALPINE})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index d8308aeea..cd2378bdf 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -912,7 +912,7 @@ var _ = Describe("Podman generate kube", func() {
})
It("podman generate kube on a container with dns options", func() {
- top := podmanTest.Podman([]string{"run", "-dt", "--name", "top", "--dns", "8.8.8.8", "--dns-search", "foobar.com", "--dns-opt", "color:blue", ALPINE, "top"})
+ top := podmanTest.Podman([]string{"run", "-dt", "--name", "top", "--dns", "8.8.8.8", "--dns-search", "foobar.com", "--dns-option", "color:blue", ALPINE, "top"})
top.WaitWithDefaultTimeout()
Expect(top).Should(Exit(0))
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index f47abbc13..347440faf 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -3,6 +3,7 @@ package integration
import (
"io/ioutil"
"os"
+ "strings"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo"
@@ -220,19 +221,20 @@ var _ = Describe("Podman generate systemd", func() {
Expect(session).Should(Exit(0))
// Grepping the output (in addition to unit tests)
- Expect(session.OutputToString()).To(ContainSubstring("# pod-foo.service"))
- Expect(session.OutputToString()).To(ContainSubstring("Requires=container-foo-1.service container-foo-2.service"))
- Expect(session.OutputToString()).To(ContainSubstring("# container-foo-1.service"))
- Expect(session.OutputToString()).To(ContainSubstring(" start foo-1"))
- Expect(session.OutputToString()).To(ContainSubstring("-infra")) // infra container
- Expect(session.OutputToString()).To(ContainSubstring("# container-foo-2.service"))
- Expect(session.OutputToString()).To(ContainSubstring(" stop -t 42 foo-2"))
- Expect(session.OutputToString()).To(ContainSubstring("BindsTo=pod-foo.service"))
- Expect(session.OutputToString()).To(ContainSubstring("PIDFile="))
- Expect(session.OutputToString()).To(ContainSubstring("/userdata/conmon.pid"))
-
+ output := session.OutputToString()
+ Expect(output).To(ContainSubstring("# pod-foo.service"))
+ Expect(output).To(ContainSubstring("Wants=container-foo-1.service container-foo-2.service"))
+ Expect(output).To(ContainSubstring("# container-foo-1.service"))
+ Expect(output).To(ContainSubstring(" start foo-1"))
+ Expect(output).To(ContainSubstring("-infra")) // infra container
+ Expect(output).To(ContainSubstring("# container-foo-2.service"))
+ Expect(output).To(ContainSubstring(" stop -t 42 foo-2"))
+ Expect(output).To(ContainSubstring("BindsTo=pod-foo.service"))
+ Expect(output).To(ContainSubstring("PIDFile="))
+ Expect(output).To(ContainSubstring("/userdata/conmon.pid"))
+ Expect(strings.Count(output, "RequiresMountsFor="+podmanTest.RunRoot)).To(Equal(3))
// The podman commands in the unit should not contain the root flags
- Expect(session.OutputToString()).ToNot(ContainSubstring(" --runroot"))
+ Expect(output).ToNot(ContainSubstring(" --runroot"))
})
It("podman generate systemd pod --name --files", func() {
@@ -468,7 +470,7 @@ var _ = Describe("Podman generate systemd", func() {
// Grepping the output (in addition to unit tests)
Expect(session.OutputToString()).To(ContainSubstring("# p-foo.service"))
- Expect(session.OutputToString()).To(ContainSubstring("Requires=container-foo-1.service container-foo-2.service"))
+ Expect(session.OutputToString()).To(ContainSubstring("Wants=container-foo-1.service container-foo-2.service"))
Expect(session.OutputToString()).To(ContainSubstring("# container-foo-1.service"))
Expect(session.OutputToString()).To(ContainSubstring("BindsTo=p-foo.service"))
})
@@ -492,7 +494,7 @@ var _ = Describe("Podman generate systemd", func() {
// Grepping the output (in addition to unit tests)
Expect(session.OutputToString()).To(ContainSubstring("# p_foo.service"))
- Expect(session.OutputToString()).To(ContainSubstring("Requires=con_foo-1.service con_foo-2.service"))
+ Expect(session.OutputToString()).To(ContainSubstring("Wants=con_foo-1.service con_foo-2.service"))
Expect(session.OutputToString()).To(ContainSubstring("# con_foo-1.service"))
Expect(session.OutputToString()).To(ContainSubstring("# con_foo-2.service"))
Expect(session.OutputToString()).To(ContainSubstring("BindsTo=p_foo.service"))
@@ -518,7 +520,7 @@ var _ = Describe("Podman generate systemd", func() {
// Grepping the output (in addition to unit tests)
Expect(session1.OutputToString()).To(ContainSubstring("# foo.service"))
- Expect(session1.OutputToString()).To(ContainSubstring("Requires=container-foo-1.service container-foo-2.service"))
+ Expect(session1.OutputToString()).To(ContainSubstring("Wants=container-foo-1.service container-foo-2.service"))
Expect(session1.OutputToString()).To(ContainSubstring("# container-foo-1.service"))
Expect(session1.OutputToString()).To(ContainSubstring("BindsTo=foo.service"))
@@ -529,7 +531,7 @@ var _ = Describe("Podman generate systemd", func() {
// Grepping the output (in addition to unit tests)
Expect(session2.OutputToString()).To(ContainSubstring("# foo.service"))
- Expect(session2.OutputToString()).To(ContainSubstring("Requires=foo-1.service foo-2.service"))
+ Expect(session2.OutputToString()).To(ContainSubstring("Wants=foo-1.service foo-2.service"))
Expect(session2.OutputToString()).To(ContainSubstring("# foo-1.service"))
Expect(session2.OutputToString()).To(ContainSubstring("# foo-2.service"))
Expect(session2.OutputToString()).To(ContainSubstring("BindsTo=foo.service"))
@@ -560,9 +562,9 @@ var _ = Describe("Podman generate systemd", func() {
// Grepping the output (in addition to unit tests)
Expect(session.OutputToString()).To(ContainSubstring("# pod-foo.service"))
- Expect(session.OutputToString()).To(ContainSubstring("Requires=container-foo-1.service container-foo-2.service"))
+ Expect(session.OutputToString()).To(ContainSubstring("Wants=container-foo-1.service container-foo-2.service"))
Expect(session.OutputToString()).To(ContainSubstring("BindsTo=pod-foo.service"))
- Expect(session.OutputToString()).To(ContainSubstring("pod create --infra-conmon-pidfile %t/pod-foo.pid --pod-id-file %t/pod-foo.pod-id --name foo"))
+ Expect(session.OutputToString()).To(ContainSubstring("pod create --infra-conmon-pidfile %t/pod-foo.pid --pod-id-file %t/pod-foo.pod-id --exit-policy=stop --name foo"))
Expect(session.OutputToString()).To(ContainSubstring("ExecStartPre=/bin/rm -f %t/pod-foo.pid %t/pod-foo.pod-id"))
Expect(session.OutputToString()).To(ContainSubstring("pod stop --ignore --pod-id-file %t/pod-foo.pod-id -t 10"))
Expect(session.OutputToString()).To(ContainSubstring("pod rm --ignore -f --pod-id-file %t/pod-foo.pod-id"))
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index 14dd6b6b8..c680cae2a 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -376,7 +376,7 @@ var _ = Describe("Podman logs", func() {
skipIfJournaldInContainer()
cname := "log-test"
- content := stringid.GenerateNonCryptoID()
+ content := stringid.GenerateRandomID()
// use printf to print no extra newline
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "--name", cname, ALPINE, "printf", content})
logc.WaitWithDefaultTimeout()
diff --git a/test/e2e/network_connect_disconnect_test.go b/test/e2e/network_connect_disconnect_test.go
index 30a5c6482..6e6a7fb39 100644
--- a/test/e2e/network_connect_disconnect_test.go
+++ b/test/e2e/network_connect_disconnect_test.go
@@ -41,7 +41,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("bad container name in network disconnect should result in error", func() {
- netName := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName := "aliasTest" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -53,7 +53,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("network disconnect with net mode slirp4netns should result in error", func() {
- netName := "slirp" + stringid.GenerateNonCryptoID()
+ netName := "slirp" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -72,7 +72,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
It("podman network disconnect", func() {
SkipIfRootlessCgroupsV1("stats not supported under rootless CgroupsV1")
- netName := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName := "aliasTest" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -128,7 +128,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("bad container name in network connect should result in error", func() {
- netName := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName := "aliasTest" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -140,7 +140,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("network connect with net mode slirp4netns should result in error", func() {
- netName := "slirp" + stringid.GenerateNonCryptoID()
+ netName := "slirp" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -158,7 +158,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("podman connect on a container that already is connected to the network should error after init", func() {
- netName := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName := "aliasTest" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -190,7 +190,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
It("podman network connect", func() {
SkipIfRootlessCgroupsV1("stats not supported under rootless CgroupsV1")
- netName := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName := "aliasTest" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -206,7 +206,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
Expect(exec).Should(Exit(0))
// Create a second network
- newNetName := "aliasTest" + stringid.GenerateNonCryptoID()
+ newNetName := "aliasTest" + stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", newNetName, "--subnet", "10.11.100.0/24"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -264,13 +264,13 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("podman network connect when not running", func() {
- netName1 := "connect1" + stringid.GenerateNonCryptoID()
+ netName1 := "connect1" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName1})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
defer podmanTest.removeNetwork(netName1)
- netName2 := "connect2" + stringid.GenerateNonCryptoID()
+ netName2 := "connect2" + stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", netName2})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -303,7 +303,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("podman network connect and run with network ID", func() {
- netName := "ID" + stringid.GenerateNonCryptoID()
+ netName := "ID" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -323,7 +323,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
Expect(exec).Should(Exit(0))
// Create a second network
- newNetName := "ID2" + stringid.GenerateNonCryptoID()
+ newNetName := "ID2" + stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", newNetName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -350,13 +350,13 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("podman network disconnect when not running", func() {
- netName1 := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName1 := "aliasTest" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName1})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
defer podmanTest.removeNetwork(netName1)
- netName2 := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName2 := "aliasTest" + stringid.GenerateRandomID()
session2 := podmanTest.Podman([]string{"network", "create", netName2})
session2.WaitWithDefaultTimeout()
Expect(session2).Should(Exit(0))
@@ -395,7 +395,7 @@ var _ = Describe("Podman network connect and disconnect", func() {
})
It("podman network disconnect and run with network ID", func() {
- netName := "aliasTest" + stringid.GenerateNonCryptoID()
+ netName := "aliasTest" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go
index 69966b07e..f7855581b 100644
--- a/test/e2e/network_create_test.go
+++ b/test/e2e/network_create_test.go
@@ -41,7 +41,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with name and subnet", func() {
- netName := "subnet-" + stringid.GenerateNonCryptoID()
+ netName := "subnet-" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", "--ip-range", "10.11.12.0/26", netName})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName)
@@ -84,7 +84,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with name and IPv6 subnet", func() {
- netName := "ipv6-" + stringid.GenerateNonCryptoID()
+ netName := "ipv6-" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:1:2:3:4::/64", netName})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName)
@@ -123,7 +123,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with name and IPv6 flag (dual-stack)", func() {
- netName := "dual-" + stringid.GenerateNonCryptoID()
+ netName := "dual-" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:4:3:2::/64", "--ipv6", netName})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName)
@@ -156,7 +156,7 @@ var _ = Describe("Podman network create", func() {
// create a second network to check the auto assigned ipv4 subnet does not overlap
// https://github.com/containers/podman/issues/11032
- netName2 := "dual-" + stringid.GenerateNonCryptoID()
+ netName2 := "dual-" + stringid.GenerateRandomID()
nc = podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:10:3:2::/64", "--ipv6", netName2})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName2)
@@ -204,13 +204,13 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with invalid subnet", func() {
- nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/17000", stringid.GenerateNonCryptoID()})
+ nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/17000", stringid.GenerateRandomID()})
nc.WaitWithDefaultTimeout()
Expect(nc).To(ExitWithError())
})
It("podman network create with ipv4 subnet and ipv6 flag", func() {
- name := stringid.GenerateNonCryptoID()
+ name := stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", "--ipv6", name})
nc.WaitWithDefaultTimeout()
Expect(nc).To(Exit(0))
@@ -224,7 +224,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with empty subnet and ipv6 flag", func() {
- name := stringid.GenerateNonCryptoID()
+ name := stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--ipv6", name})
nc.WaitWithDefaultTimeout()
Expect(nc).To(Exit(0))
@@ -238,19 +238,19 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with invalid IP", func() {
- nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.0/17000", stringid.GenerateNonCryptoID()})
+ nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.0/17000", stringid.GenerateRandomID()})
nc.WaitWithDefaultTimeout()
Expect(nc).To(ExitWithError())
})
It("podman network create with invalid gateway for subnet", func() {
- nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", "--gateway", "192.168.1.1", stringid.GenerateNonCryptoID()})
+ nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", "--gateway", "192.168.1.1", stringid.GenerateRandomID()})
nc.WaitWithDefaultTimeout()
Expect(nc).To(ExitWithError())
})
It("podman network create two networks with same name should fail", func() {
- netName := "same-" + stringid.GenerateNonCryptoID()
+ netName := "same-" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", netName})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName)
@@ -262,13 +262,13 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create two networks with same subnet should fail", func() {
- netName1 := "sub1-" + stringid.GenerateNonCryptoID()
+ netName1 := "sub1-" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.13.0/24", netName1})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName1)
Expect(nc).Should(Exit(0))
- netName2 := "sub2-" + stringid.GenerateNonCryptoID()
+ netName2 := "sub2-" + stringid.GenerateRandomID()
ncFail := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.13.0/24", netName2})
ncFail.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName2)
@@ -276,13 +276,13 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create two IPv6 networks with same subnet should fail", func() {
- netName1 := "subipv61-" + stringid.GenerateNonCryptoID()
+ netName1 := "subipv61-" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:4:4:4:4::/64", "--ipv6", netName1})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName1)
Expect(nc).Should(Exit(0))
- netName2 := "subipv62-" + stringid.GenerateNonCryptoID()
+ netName2 := "subipv62-" + stringid.GenerateRandomID()
ncFail := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:4:4:4:4::/64", "--ipv6", netName2})
ncFail.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName2)
@@ -296,7 +296,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with mtu option", func() {
- net := "mtu-test" + stringid.GenerateNonCryptoID()
+ net := "mtu-test" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--opt", "mtu=9000", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -309,7 +309,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with vlan option", func() {
- net := "vlan-test" + stringid.GenerateNonCryptoID()
+ net := "vlan-test" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--opt", "vlan=9", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -322,7 +322,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with invalid option", func() {
- net := "invalid-test" + stringid.GenerateNonCryptoID()
+ net := "invalid-test" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--opt", "foo=bar", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -331,7 +331,7 @@ var _ = Describe("Podman network create", func() {
It("podman CNI network create with internal should not have dnsname", func() {
SkipIfNetavark(podmanTest)
- net := "internal-test" + stringid.GenerateNonCryptoID()
+ net := "internal-test" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--internal", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -349,7 +349,7 @@ var _ = Describe("Podman network create", func() {
It("podman Netavark network create with internal should have dnsname", func() {
SkipIfCNI(podmanTest)
- net := "internal-test" + stringid.GenerateNonCryptoID()
+ net := "internal-test" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--internal", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -375,7 +375,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with multiple subnets", func() {
- name := "subnets-" + stringid.GenerateNonCryptoID()
+ name := "subnets-" + stringid.GenerateRandomID()
subnet1 := "10.10.0.0/24"
subnet2 := "10.10.1.0/24"
nc := podmanTest.Podman([]string{"network", "create", "--subnet", subnet1, "--subnet", subnet2, name})
@@ -393,7 +393,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with multiple subnets dual stack", func() {
- name := "subnets-" + stringid.GenerateNonCryptoID()
+ name := "subnets-" + stringid.GenerateRandomID()
subnet1 := "10.10.2.0/24"
subnet2 := "fd52:2a5a:747e:3acd::/64"
nc := podmanTest.Podman([]string{"network", "create", "--subnet", subnet1, "--subnet", subnet2, name})
@@ -411,7 +411,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create with multiple subnets dual stack with gateway and range", func() {
- name := "subnets-" + stringid.GenerateNonCryptoID()
+ name := "subnets-" + stringid.GenerateRandomID()
subnet1 := "10.10.3.0/24"
gw1 := "10.10.3.10"
range1 := "10.10.3.0/26"
@@ -436,7 +436,7 @@ var _ = Describe("Podman network create", func() {
})
It("podman network create invalid options with multiple subnets", func() {
- name := "subnets-" + stringid.GenerateNonCryptoID()
+ name := "subnets-" + stringid.GenerateRandomID()
subnet1 := "10.10.3.0/24"
gw1 := "10.10.3.10"
gw2 := "fd52:2a5a:747e:3acf::10"
diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go
index d4f60d3e4..b2f50ca55 100644
--- a/test/e2e/network_test.go
+++ b/test/e2e/network_test.go
@@ -113,7 +113,7 @@ var _ = Describe("Podman network", func() {
})
It("podman network list --filter labels", func() {
- net1 := "labelnet" + stringid.GenerateNonCryptoID()
+ net1 := "labelnet" + stringid.GenerateRandomID()
label1 := "testlabel1=abc"
label2 := "abcdef"
session := podmanTest.Podman([]string{"network", "create", "--label", label1, net1})
@@ -121,7 +121,7 @@ var _ = Describe("Podman network", func() {
defer podmanTest.removeNetwork(net1)
Expect(session).Should(Exit(0))
- net2 := "labelnet" + stringid.GenerateNonCryptoID()
+ net2 := "labelnet" + stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", "--label", label1, "--label", label2, net2})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net2)
@@ -141,7 +141,7 @@ var _ = Describe("Podman network", func() {
})
It("podman network list --filter invalid value", func() {
- net := "net" + stringid.GenerateNonCryptoID()
+ net := "net" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", net})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -294,7 +294,7 @@ var _ = Describe("Podman network", func() {
})
It("podman inspect container single CNI network", func() {
- netName := "net-" + stringid.GenerateNonCryptoID()
+ netName := "net-" + stringid.GenerateRandomID()
network := podmanTest.Podman([]string{"network", "create", "--subnet", "10.50.50.0/24", netName})
network.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName)
@@ -324,13 +324,13 @@ var _ = Describe("Podman network", func() {
})
It("podman inspect container two CNI networks (container not running)", func() {
- netName1 := "net1-" + stringid.GenerateNonCryptoID()
+ netName1 := "net1-" + stringid.GenerateRandomID()
network1 := podmanTest.Podman([]string{"network", "create", netName1})
network1.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName1)
Expect(network1).Should(Exit(0))
- netName2 := "net2-" + stringid.GenerateNonCryptoID()
+ netName2 := "net2-" + stringid.GenerateRandomID()
network2 := podmanTest.Podman([]string{"network", "create", netName2})
network2.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName2)
@@ -361,13 +361,13 @@ var _ = Describe("Podman network", func() {
})
It("podman inspect container two CNI networks", func() {
- netName1 := "net1-" + stringid.GenerateNonCryptoID()
+ netName1 := "net1-" + stringid.GenerateRandomID()
network1 := podmanTest.Podman([]string{"network", "create", "--subnet", "10.50.51.0/25", netName1})
network1.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName1)
Expect(network1).Should(Exit(0))
- netName2 := "net2-" + stringid.GenerateNonCryptoID()
+ netName2 := "net2-" + stringid.GenerateRandomID()
network2 := podmanTest.Podman([]string{"network", "create", "--subnet", "10.50.51.128/26", netName2})
network2.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName2)
@@ -403,7 +403,7 @@ var _ = Describe("Podman network", func() {
It("podman network remove after disconnect when container initially created with the network", func() {
container := "test"
- network := "foo" + stringid.GenerateNonCryptoID()
+ network := "foo" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", network})
session.WaitWithDefaultTimeout()
@@ -430,7 +430,7 @@ var _ = Describe("Podman network", func() {
})
It("podman network remove --force with pod", func() {
- netName := "net-" + stringid.GenerateNonCryptoID()
+ netName := "net-" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName)
@@ -466,13 +466,13 @@ var _ = Describe("Podman network", func() {
})
It("podman network remove with two networks", func() {
- netName1 := "net1-" + stringid.GenerateNonCryptoID()
+ netName1 := "net1-" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", netName1})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName1)
Expect(session).Should(Exit(0))
- netName2 := "net2-" + stringid.GenerateNonCryptoID()
+ netName2 := "net2-" + stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", netName2})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(netName2)
@@ -591,7 +591,7 @@ var _ = Describe("Podman network", func() {
It("podman network create/remove macvlan", func() {
// Netavark currently does not do dhcp so the this test fails
SkipIfNetavark(podmanTest)
- net := "macvlan" + stringid.GenerateNonCryptoID()
+ net := "macvlan" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "--macvlan", "lo", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -605,7 +605,7 @@ var _ = Describe("Podman network", func() {
It("podman network create/remove macvlan as driver (-d) no device name", func() {
// Netavark currently does not do dhcp so the this test fails
SkipIfNetavark(podmanTest)
- net := "macvlan" + stringid.GenerateNonCryptoID()
+ net := "macvlan" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "-d", "macvlan", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -632,7 +632,7 @@ var _ = Describe("Podman network", func() {
It("podman network create/remove macvlan as driver (-d) with device name", func() {
// Netavark currently does not do dhcp so the this test fails
SkipIfNetavark(podmanTest)
- net := "macvlan" + stringid.GenerateNonCryptoID()
+ net := "macvlan" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "-d", "macvlan", "-o", "parent=lo", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -659,7 +659,7 @@ var _ = Describe("Podman network", func() {
})
It("podman network exists", func() {
- net := "net" + stringid.GenerateNonCryptoID()
+ net := "net" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", net})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -669,13 +669,13 @@ var _ = Describe("Podman network", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- session = podmanTest.Podman([]string{"network", "exists", stringid.GenerateNonCryptoID()})
+ session = podmanTest.Podman([]string{"network", "exists", stringid.GenerateRandomID()})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(1))
})
It("podman network create macvlan with network info and options", func() {
- net := "macvlan" + stringid.GenerateNonCryptoID()
+ net := "macvlan" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "-d", "macvlan", "-o", "parent=lo", "-o", "mtu=1500", "--gateway", "192.168.1.254", "--subnet", "192.168.1.0/24", net})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -711,7 +711,7 @@ var _ = Describe("Podman network", func() {
if IsRemote() {
podmanTest.RestartRemoteService()
}
- net1 := "macvlan" + stringid.GenerateNonCryptoID() + "net1"
+ net1 := "macvlan" + stringid.GenerateRandomID() + "net1"
nc := podmanTest.Podman([]string{"network", "create", net1})
nc.WaitWithDefaultTimeout()
@@ -764,7 +764,7 @@ var _ = Describe("Podman network", func() {
// Run a container on one of them
// Network Prune
// Check that one has been pruned, other remains
- net := "macvlan" + stringid.GenerateNonCryptoID()
+ net := "macvlan" + stringid.GenerateRandomID()
net1 := net + "1"
net2 := net + "2"
nc := podmanTest.Podman([]string{"network", "create", net1})
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index baa74cb51..26460c937 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -2433,7 +2433,7 @@ spec:
err := generateKubeYaml("deployment", deployment, kubeYaml)
Expect(err).To(BeNil())
- net := "playkube" + stringid.GenerateNonCryptoID()
+ net := "playkube" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.31.0/24", net})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -2475,8 +2475,8 @@ spec:
err := generateKubeYaml("pod", pod, kubeYaml)
Expect(err).To(BeNil())
- net1 := "net1" + stringid.GenerateNonCryptoID()
- net2 := "net2" + stringid.GenerateNonCryptoID()
+ net1 := "net1" + stringid.GenerateRandomID()
+ net2 := "net2" + stringid.GenerateRandomID()
net := podmanTest.Podman([]string{"network", "create", "--subnet", "10.0.11.0/24", net1})
net.WaitWithDefaultTimeout()
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index 97ca5ff94..20335f322 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -294,7 +294,7 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps filter network", func() {
- net := stringid.GenerateNonCryptoID()
+ net := stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", net})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -333,12 +333,12 @@ var _ = Describe("Podman ps", func() {
Expect(session.OutputToString()).To(Equal("podman"))
}
- net1 := stringid.GenerateNonCryptoID()
+ net1 := stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", net1})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
defer podmanTest.removeNetwork(net1)
- net2 := stringid.GenerateNonCryptoID()
+ net2 := stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", net2})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go
index a5eab7eed..364ef54d5 100644
--- a/test/e2e/pod_rm_test.go
+++ b/test/e2e/pod_rm_test.go
@@ -318,4 +318,31 @@ var _ = Describe("Podman pod rm", func() {
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
})
+
+ It("podman pod rm pod with infra container and running container", func() {
+ podName := "testPod"
+ ctrName := "testCtr"
+
+ ctrAndPod := podmanTest.Podman([]string{"run", "-d", "--pod", fmt.Sprintf("new:%s", podName), "--name", ctrName, ALPINE, "top"})
+ ctrAndPod.WaitWithDefaultTimeout()
+ Expect(ctrAndPod).Should(Exit(0))
+
+ removePod := podmanTest.Podman([]string{"pod", "rm", "-a"})
+ removePod.WaitWithDefaultTimeout()
+ Expect(removePod).Should(Not(Exit(0)))
+
+ ps := podmanTest.Podman([]string{"pod", "ps"})
+ ps.WaitWithDefaultTimeout()
+ Expect(ps).Should(Exit(0))
+ Expect(ps.OutputToString()).To(ContainSubstring(podName))
+
+ removePodForce := podmanTest.Podman([]string{"pod", "rm", "-af"})
+ removePodForce.WaitWithDefaultTimeout()
+ Expect(removePodForce).Should(Exit(0))
+
+ ps2 := podmanTest.Podman([]string{"pod", "ps"})
+ ps2.WaitWithDefaultTimeout()
+ Expect(ps2).Should(Exit(0))
+ Expect(ps2.OutputToString()).To(Not(ContainSubstring(podName)))
+ })
})
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go
index 1100a5d90..cc037545c 100644
--- a/test/e2e/ps_test.go
+++ b/test/e2e/ps_test.go
@@ -817,7 +817,7 @@ var _ = Describe("Podman ps", func() {
})
It("podman ps filter network", func() {
- net := stringid.GenerateNonCryptoID()
+ net := stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", net})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -860,12 +860,12 @@ var _ = Describe("Podman ps", func() {
Expect(actual).To(Equal("podman"))
}
- net1 := stringid.GenerateNonCryptoID()
+ net1 := stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", net1})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
defer podmanTest.removeNetwork(net1)
- net2 := stringid.GenerateNonCryptoID()
+ net2 := stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"network", "create", net2})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index 1ad78c950..78e4a62c0 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -869,7 +869,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
})
It("podman run in custom CNI network with --static-ip", func() {
- netName := stringid.GenerateNonCryptoID()
+ netName := stringid.GenerateRandomID()
ipAddr := "10.25.30.128"
create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.30.0/24", netName})
create.WaitWithDefaultTimeout()
@@ -884,7 +884,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
It("podman CNI network works across user ns", func() {
SkipIfNetavark(podmanTest)
- netName := stringid.GenerateNonCryptoID()
+ netName := stringid.GenerateRandomID()
create := podmanTest.Podman([]string{"network", "create", netName})
create.WaitWithDefaultTimeout()
Expect(create).Should(Exit(0))
@@ -933,7 +933,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
})
It("podman run with new:pod and static-ip", func() {
- netName := stringid.GenerateNonCryptoID()
+ netName := stringid.GenerateRandomID()
ipAddr := "10.25.40.128"
podname := "testpod"
create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.40.0/24", netName})
@@ -1121,7 +1121,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
// see https://github.com/containers/podman/issues/12972
It("podman run check network-alias works on networks without dns", func() {
- net := "dns" + stringid.GenerateNonCryptoID()
+ net := "dns" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", "--disable-dns", net})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
@@ -1135,7 +1135,7 @@ EXPOSE 2004-2005/tcp`, ALPINE)
It("podman run with ipam none driver", func() {
// Test fails, issue #13931
SkipIfNetavark(podmanTest)
- net := "ipam" + stringid.GenerateNonCryptoID()
+ net := "ipam" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"network", "create", "--ipam-driver=none", net})
session.WaitWithDefaultTimeout()
defer podmanTest.removeNetwork(net)
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go
index 12783cd29..057fbf775 100644
--- a/test/e2e/run_staticip_test.go
+++ b/test/e2e/run_staticip_test.go
@@ -66,7 +66,7 @@ var _ = Describe("Podman run with --ip flag", func() {
})
It("Podman run with specified static IPv6 has correct IP", func() {
- netName := "ipv6-" + stringid.GenerateNonCryptoID()
+ netName := "ipv6-" + stringid.GenerateRandomID()
ipv6 := "fd46:db93:aa76:ac37::10"
net := podmanTest.Podman([]string{"network", "create", "--subnet", "fd46:db93:aa76:ac37::/64", netName})
net.WaitWithDefaultTimeout()
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 3b10fdff3..3fbdd4339 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -222,7 +222,7 @@ var _ = Describe("Podman run", func() {
It("podman run a container with a --rootfs", func() {
rootfs := filepath.Join(tempdir, "rootfs")
uls := filepath.Join("/", "usr", "local", "share")
- uniqueString := stringid.GenerateNonCryptoID()
+ uniqueString := stringid.GenerateRandomID()
testFilePath := filepath.Join(uls, uniqueString)
tarball := filepath.Join(tempdir, "rootfs.tar")
@@ -848,7 +848,7 @@ USER bin`, BB)
err = ioutil.WriteFile(hookJSONPath, []byte(hookJSON), 0644)
Expect(err).ToNot(HaveOccurred())
- random := stringid.GenerateNonCryptoID()
+ random := stringid.GenerateRandomID()
hookScript := fmt.Sprintf(`#!/bin/sh
echo -n %s >%s
diff --git a/test/e2e/run_working_dir_test.go b/test/e2e/run_working_dir_test.go
index ff91a420f..84792481f 100644
--- a/test/e2e/run_working_dir_test.go
+++ b/test/e2e/run_working_dir_test.go
@@ -46,6 +46,15 @@ var _ = Describe("Podman run", func() {
Expect(session).Should(Exit(126))
})
+ It("podman run a container using a --workdir under a bind mount", func() {
+ volume, err := CreateTempDirInTempDir()
+ Expect(err).To(BeNil())
+
+ session := podmanTest.Podman([]string{"run", "--volume", fmt.Sprintf("%s:/var_ovl/:O", volume), "--workdir", "/var_ovl/log", ALPINE, "true"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ })
+
It("podman run a container on an image with a workdir", func() {
dockerfile := fmt.Sprintf(`FROM %s
RUN mkdir -p /home/foobar /etc/foobar; chown bin:bin /etc/foobar
diff --git a/test/e2e/volume_exists_test.go b/test/e2e/volume_exists_test.go
index 0de574968..0a550bfcb 100644
--- a/test/e2e/volume_exists_test.go
+++ b/test/e2e/volume_exists_test.go
@@ -34,7 +34,7 @@ var _ = Describe("Podman volume exists", func() {
})
It("podman volume exists", func() {
- vol := "vol" + stringid.GenerateNonCryptoID()
+ vol := "vol" + stringid.GenerateRandomID()
session := podmanTest.Podman([]string{"volume", "create", vol})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -43,7 +43,7 @@ var _ = Describe("Podman volume exists", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- session = podmanTest.Podman([]string{"volume", "exists", stringid.GenerateNonCryptoID()})
+ session = podmanTest.Podman([]string{"volume", "exists", stringid.GenerateRandomID()})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(1))
})
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go
index dcfb13f4e..24ea50b26 100644
--- a/test/e2e/volume_ls_test.go
+++ b/test/e2e/volume_ls_test.go
@@ -75,7 +75,10 @@ var _ = Describe("Podman volume ls", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- Expect(session.OutputToStringArray()).To(HaveLen(1), session.OutputToString())
+ arr := session.OutputToStringArray()
+ Expect(arr).To(HaveLen(2))
+ Expect(arr[0]).To(ContainSubstring("NAME"))
+ Expect(arr[1]).To(ContainSubstring("myvol"))
})
It("podman ls volume with --filter flag", func() {
diff --git a/test/e2e/volume_plugin_test.go b/test/e2e/volume_plugin_test.go
index a44e75a54..33cdcce5b 100644
--- a/test/e2e/volume_plugin_test.go
+++ b/test/e2e/volume_plugin_test.go
@@ -212,19 +212,19 @@ testvol5 = "/run/docker/plugins/testvol5.sock"`), 0o644)
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))
- localvol := "local-" + stringid.GenerateNonCryptoID()
+ localvol := "local-" + stringid.GenerateRandomID()
// create local volume
session := podmanTest.Podman([]string{"volume", "create", localvol})
session.WaitWithDefaultTimeout()
Expect(session).To(Exit(0))
- vol1 := "vol1-" + stringid.GenerateNonCryptoID()
+ vol1 := "vol1-" + stringid.GenerateRandomID()
session = podmanTest.Podman([]string{"volume", "create", "--driver", pluginName, vol1})
session.WaitWithDefaultTimeout()
Expect(session).To(Exit(0))
// now create volume in plugin without podman
- vol2 := "vol2-" + stringid.GenerateNonCryptoID()
+ vol2 := "vol2-" + stringid.GenerateRandomID()
plugin = podmanTest.Podman([]string{"exec", ctrName, "/usr/local/bin/testvol", "--sock-name", pluginName, "create", vol2})
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))