fix volume-plugin-test flake

Wait for the socket to be ready befor trying to create a volume with the
driver.

Fixes: #17956
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg committed 2023-03-30 09:15:13 +02:00
1 parent 411693c769
commit 70abb4ae5b
1 file changed
+24
+24
View File
@@ -66,6 +66,10 @@ var _ = Describe("Podman volume plugins", func() {
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))
// Make sure the socket is available (see #17956)
err = WaitForFile(fmt.Sprintf("/run/docker/plugins/%s.sock", pluginName))
Expect(err).ToNot(HaveOccurred())
volName := "testVolume1"
create := podmanTest.Podman([]string{"volume", "create", "--driver", pluginName, volName})
create.WaitWithDefaultTimeout()
@@ -107,6 +111,10 @@ var _ = Describe("Podman volume plugins", func() {
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))
// Make sure the socket is available (see #17956)
err = WaitForFile(fmt.Sprintf("/run/docker/plugins/%s.sock", pluginName))
Expect(err).ToNot(HaveOccurred())
volName := "testVolume1"
create := podmanTest.Podman([]string{"volume", "create", "--driver", pluginName, volName})
create.WaitWithDefaultTimeout()
@@ -132,6 +140,10 @@ var _ = Describe("Podman volume plugins", func() {
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))
// Make sure the socket is available (see #17956)
err = WaitForFile(fmt.Sprintf("/run/docker/plugins/%s.sock", pluginName))
Expect(err).ToNot(HaveOccurred())
volName := "testVolume1"
create := podmanTest.Podman([]string{"volume", "create", "--driver", pluginName, volName})
create.WaitWithDefaultTimeout()
@@ -173,6 +185,10 @@ var _ = Describe("Podman volume plugins", func() {
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))
// Make sure the socket is available (see #17956)
err = WaitForFile(fmt.Sprintf("/run/docker/plugins/%s.sock", pluginName))
Expect(err).ToNot(HaveOccurred())
volName := "testVolume1"
create := podmanTest.Podman([]string{"volume", "create", "--driver", pluginName, volName})
create.WaitWithDefaultTimeout()
@@ -219,6 +235,10 @@ testvol5 = "/run/docker/plugins/testvol5.sock"`), 0o644)
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))
// Make sure the socket is available (see #17956)
err = WaitForFile(fmt.Sprintf("/run/docker/plugins/%s.sock", pluginName))
Expect(err).ToNot(HaveOccurred())
localvol := "local-" + stringid.GenerateRandomID()
// create local volume
session := podmanTest.Podman([]string{"volume", "create", localvol})
@@ -277,6 +297,10 @@ Removed:
plugin.WaitWithDefaultTimeout()
Expect(plugin).Should(Exit(0))
// Make sure the socket is available (see #17956)
err = WaitForFile(fmt.Sprintf("/run/docker/plugins/%s.sock", pluginName))
Expect(err).ToNot(HaveOccurred())
volName := "testVolume1"
create := podmanTest.Podman([]string{"volume", "create", "--driver", pluginName, volName})
create.WaitWithDefaultTimeout()