summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/attach_test.go2
-rw-r--r--test/e2e/benchmarks_test.go72
-rw-r--r--test/e2e/build_test.go5
-rw-r--r--test/e2e/checkpoint_image_test.go1
-rw-r--r--test/e2e/checkpoint_test.go2
-rw-r--r--test/e2e/commit_test.go2
-rw-r--r--test/e2e/common_test.go37
-rw-r--r--test/e2e/container_clone_test.go27
-rw-r--r--test/e2e/container_create_volume_test.go1
-rw-r--r--test/e2e/container_inspect_test.go1
-rw-r--r--test/e2e/containers_conf_test.go1
-rw-r--r--test/e2e/cp_test.go1
-rw-r--r--test/e2e/create_staticip_test.go1
-rw-r--r--test/e2e/create_staticmac_test.go1
-rw-r--r--test/e2e/create_test.go8
-rw-r--r--test/e2e/diff_test.go1
-rw-r--r--test/e2e/events_test.go1
-rw-r--r--test/e2e/exec_test.go1
-rw-r--r--test/e2e/export_test.go1
-rw-r--r--test/e2e/generate_kube_test.go1
-rw-r--r--test/e2e/generate_systemd_test.go2
-rw-r--r--test/e2e/healthcheck_run_test.go3
-rw-r--r--test/e2e/history_test.go1
-rw-r--r--test/e2e/hooks/checkhook.json5
-rwxr-xr-xtest/e2e/hooks/checkhook.sh4
-rw-r--r--test/e2e/image_sign_test.go2
-rw-r--r--test/e2e/images_test.go1
-rw-r--r--test/e2e/import_test.go1
-rw-r--r--test/e2e/info_test.go28
-rw-r--r--test/e2e/init_test.go1
-rw-r--r--test/e2e/inspect_test.go1
-rw-r--r--test/e2e/libpod_suite_remote_test.go26
-rw-r--r--test/e2e/libpod_suite_test.go12
-rw-r--r--test/e2e/login_logout_test.go21
-rw-r--r--test/e2e/logs_test.go3
-rw-r--r--test/e2e/manifest_test.go6
-rw-r--r--test/e2e/mount_rootless_test.go1
-rw-r--r--test/e2e/namespace_test.go1
-rw-r--r--test/e2e/network_create_test.go1
-rw-r--r--test/e2e/pause_test.go1
-rw-r--r--test/e2e/play_build_test.go1
-rw-r--r--test/e2e/play_kube_test.go11
-rw-r--r--test/e2e/pod_create_test.go1
-rw-r--r--test/e2e/pod_infra_container_test.go1
-rw-r--r--test/e2e/pod_initcontainers_test.go1
-rw-r--r--test/e2e/pod_inspect_test.go1
-rw-r--r--test/e2e/pod_kill_test.go1
-rw-r--r--test/e2e/pod_pause_test.go1
-rw-r--r--test/e2e/pod_pod_namespaces_test.go1
-rw-r--r--test/e2e/pod_prune_test.go1
-rw-r--r--test/e2e/pod_ps_test.go1
-rw-r--r--test/e2e/pod_restart_test.go1
-rw-r--r--test/e2e/pod_rm_test.go1
-rw-r--r--test/e2e/pod_start_test.go1
-rw-r--r--test/e2e/pod_stats_test.go1
-rw-r--r--test/e2e/pod_stop_test.go1
-rw-r--r--test/e2e/pod_top_test.go1
-rw-r--r--test/e2e/port_test.go1
-rw-r--r--test/e2e/prune_test.go1
-rw-r--r--test/e2e/ps_test.go1
-rw-r--r--test/e2e/pull_test.go103
-rw-r--r--test/e2e/push_test.go18
-rw-r--r--test/e2e/rename_test.go1
-rw-r--r--test/e2e/restart_test.go1
-rw-r--r--test/e2e/rm_test.go1
-rw-r--r--test/e2e/run_aardvark_test.go1
-rw-r--r--test/e2e/run_apparmor_test.go1
-rw-r--r--test/e2e/run_cgroup_parent_test.go1
-rw-r--r--test/e2e/run_cleanup_test.go3
-rw-r--r--test/e2e/run_cpu_test.go1
-rw-r--r--test/e2e/run_device_test.go1
-rw-r--r--test/e2e/run_dns_test.go1
-rw-r--r--test/e2e/run_entrypoint_test.go1
-rw-r--r--test/e2e/run_env_test.go1
-rw-r--r--test/e2e/run_exit_test.go1
-rw-r--r--test/e2e/run_memory_test.go1
-rw-r--r--test/e2e/run_networking_test.go6
-rw-r--r--test/e2e/run_ns_test.go1
-rw-r--r--test/e2e/run_passwd_test.go1
-rw-r--r--test/e2e/run_privileged_test.go1
-rw-r--r--test/e2e/run_restart_test.go1
-rw-r--r--test/e2e/run_seccomp_test.go1
-rw-r--r--test/e2e/run_security_labels_test.go2
-rw-r--r--test/e2e/run_selinux_test.go1
-rw-r--r--test/e2e/run_signal_test.go13
-rw-r--r--test/e2e/run_staticip_test.go1
-rw-r--r--test/e2e/run_test.go38
-rw-r--r--test/e2e/run_userns_test.go1
-rw-r--r--test/e2e/run_volume_test.go34
-rw-r--r--test/e2e/run_working_dir_test.go1
-rw-r--r--test/e2e/runlabel_test.go1
-rw-r--r--test/e2e/save_test.go3
-rw-r--r--test/e2e/search_test.go41
-rw-r--r--test/e2e/secret_test.go1
-rw-r--r--test/e2e/start_test.go1
-rw-r--r--test/e2e/stats_test.go1
-rw-r--r--test/e2e/stop_test.go1
-rw-r--r--test/e2e/system_connection_test.go4
-rw-r--r--test/e2e/system_df_test.go3
-rw-r--r--test/e2e/system_dial_stdio_test.go3
-rw-r--r--test/e2e/system_reset_test.go10
-rw-r--r--test/e2e/system_service_test.go18
-rw-r--r--test/e2e/systemd_activate_test.go1
-rw-r--r--test/e2e/systemd_test.go1
-rw-r--r--test/e2e/toolbox_test.go1
-rw-r--r--test/e2e/top_test.go1
-rw-r--r--test/e2e/tree_test.go2
-rw-r--r--test/e2e/trust_test.go4
-rw-r--r--test/e2e/unshare_test.go1
-rw-r--r--test/e2e/version_test.go2
-rw-r--r--test/e2e/volume_create_test.go1
-rw-r--r--test/e2e/volume_exists_test.go1
-rw-r--r--test/e2e/volume_inspect_test.go1
-rw-r--r--test/e2e/volume_ls_test.go1
-rw-r--r--test/e2e/volume_plugin_test.go16
-rw-r--r--test/e2e/volume_prune_test.go1
-rw-r--r--test/e2e/volume_rm_test.go1
-rw-r--r--test/e2e/wait_test.go1
118 files changed, 338 insertions, 342 deletions
diff --git a/test/e2e/attach_test.go b/test/e2e/attach_test.go
index 74e3a619a..b110f7c5b 100644
--- a/test/e2e/attach_test.go
+++ b/test/e2e/attach_test.go
@@ -22,8 +22,6 @@ var _ = Describe("Podman attach", func() {
Expect(err).To(BeNil())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- err = podmanTest.SeedImages()
- Expect(err).To(BeNil())
})
AfterEach(func() {
diff --git a/test/e2e/benchmarks_test.go b/test/e2e/benchmarks_test.go
index 9653cee3b..ef4d51893 100644
--- a/test/e2e/benchmarks_test.go
+++ b/test/e2e/benchmarks_test.go
@@ -36,11 +36,14 @@ type benchmark struct {
options newBenchmarkOptions
}
+var benchmarkRegistry *podmanRegistry.Registry
+
// Allows for customizing the benchnmark in an easy to extend way.
type newBenchmarkOptions struct {
// Sets the benchmark's init function.
init func()
- // Run a local registry for this benchmark.
+ // Run a local registry for this benchmark. Use `getPortUserPass()` in
+ // the benchmark to get the port, user and password.
needsRegistry bool
}
@@ -53,6 +56,15 @@ func newBenchmark(name string, main func(), options *newBenchmarkOptions) {
allBenchmarks = append(allBenchmarks, bm)
}
+// getPortUserPass returns the port, user and password of the currently running
+// registry.
+func getPortUserPass() (string, string, string) {
+ if benchmarkRegistry == nil {
+ return "", "", ""
+ }
+ return benchmarkRegistry.Port, benchmarkRegistry.User, benchmarkRegistry.Password
+}
+
var _ = Describe("Podman Benchmark Suite", func() {
var (
timedir string
@@ -66,7 +78,6 @@ var _ = Describe("Podman Benchmark Suite", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
-
timedir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -76,6 +87,15 @@ var _ = Describe("Podman Benchmark Suite", func() {
cleanup := func() {
podmanTest.Cleanup()
os.RemoveAll(timedir)
+
+ // Stop the local registry.
+ if benchmarkRegistry != nil {
+ if err := benchmarkRegistry.Stop(); err != nil {
+ logrus.Errorf("Error stopping registry: %v", err)
+ os.Exit(1)
+ }
+ benchmarkRegistry = nil
+ }
}
totalMemoryInKb := func() (total uint64) {
@@ -110,22 +130,23 @@ var _ = Describe("Podman Benchmark Suite", func() {
// All benchmarks are executed here to have *one* table listing all data.
Measure("Podman Benchmark Suite", func(b Benchmarker) {
+
+ registryOptions := &podmanRegistry.Options{
+ Image: "docker-archive:" + imageTarPath(registry),
+ }
+
for i := range allBenchmarks {
setup()
bm := allBenchmarks[i]
// Start a local registry if requested.
- var registry *podmanRegistry.Registry
if bm.options.needsRegistry {
- reg, err := podmanRegistry.Start()
+ reg, err := podmanRegistry.StartWithOptions(registryOptions)
if err != nil {
logrus.Errorf("Error starting registry: %v", err)
os.Exit(1)
}
- registry = reg
- os.Setenv(podmanRegistry.UserKey, reg.User)
- os.Setenv(podmanRegistry.PassKey, reg.Password)
- os.Setenv(podmanRegistry.PortKey, reg.Port)
+ benchmarkRegistry = reg
}
if bm.options.init != nil {
@@ -140,17 +161,6 @@ var _ = Describe("Podman Benchmark Suite", func() {
mem := totalMemoryInKb()
b.RecordValueWithPrecision("[MEM] "+bm.name, float64(mem), "KB", 1)
- // Stop the local registry.
- if bm.options.needsRegistry {
- os.Unsetenv(podmanRegistry.UserKey)
- os.Unsetenv(podmanRegistry.PassKey)
- os.Unsetenv(podmanRegistry.PortKey)
- if err := registry.Stop(); err != nil {
- logrus.Errorf("Error stopping registry: %v", err)
- os.Exit(1)
- }
- }
-
cleanup()
}
}, numBenchmarkSamples)
@@ -167,11 +177,27 @@ var _ = Describe("Podman Benchmark Suite", func() {
Expect(session).Should(Exit(0))
}, nil)
+ newBenchmark("podman push", func() {
+ port, user, pass := getPortUserPass()
+ session := podmanTest.Podman([]string{"push", "--tls-verify=false", "--creds", user + ":" + pass, UBI_INIT, "localhost:" + port + "/repo/image:tag"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ }, &newBenchmarkOptions{needsRegistry: true})
+
newBenchmark("podman pull", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/cirros"})
+ port, user, pass := getPortUserPass()
+ session := podmanTest.Podman([]string{"pull", "--tls-verify=false", "--creds", user + ":" + pass, "localhost:" + port + "/repo/image:tag"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- }, nil)
+ }, &newBenchmarkOptions{
+ needsRegistry: true,
+ init: func() {
+ port, user, pass := getPortUserPass()
+ session := podmanTest.Podman([]string{"push", "--tls-verify=false", "--creds", user + ":" + pass, UBI_INIT, "localhost:" + port + "/repo/image:tag"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ },
+ })
newBenchmark("podman load [docker]", func() {
session := podmanTest.Podman([]string{"load", "-i", "./testdata/docker-two-images.tar.xz"})
@@ -198,9 +224,7 @@ var _ = Describe("Podman Benchmark Suite", func() {
}, nil)
newBenchmark("podman login + logout", func() {
- user := os.Getenv(podmanRegistry.UserKey)
- pass := os.Getenv(podmanRegistry.PassKey)
- port := os.Getenv(podmanRegistry.PortKey)
+ port, user, pass := getPortUserPass()
session := podmanTest.Podman([]string{"login", "-u", user, "-p", pass, "--tls-verify=false", "localhost:" + port})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go
index b8aad1084..b5cec5fff 100644
--- a/test/e2e/build_test.go
+++ b/test/e2e/build_test.go
@@ -533,7 +533,10 @@ subdir**`
// make cwd as context root path
Expect(os.Chdir(contextDir)).ToNot(HaveOccurred())
- defer os.Chdir(cwd)
+ defer func() {
+ err := os.Chdir(cwd)
+ Expect(err).ToNot(HaveOccurred())
+ }()
By("Test .containerignore filtering subdirectory")
err = ioutil.WriteFile(filepath.Join(contextDir, ".containerignore"), []byte(`subdir/`), 0644)
diff --git a/test/e2e/checkpoint_image_test.go b/test/e2e/checkpoint_image_test.go
index 6c2a000e8..94320a70e 100644
--- a/test/e2e/checkpoint_image_test.go
+++ b/test/e2e/checkpoint_image_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman checkpoint", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
// Check if the runtime implements checkpointing. Currently only
// runc's checkpoint/restore implementation is supported.
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help")
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go
index ac1677539..787178cd3 100644
--- a/test/e2e/checkpoint_test.go
+++ b/test/e2e/checkpoint_test.go
@@ -41,8 +41,6 @@ var _ = Describe("Podman checkpoint", func() {
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- err = podmanTest.SeedImages()
- Expect(err).To(BeNil())
// Check if the runtime implements checkpointing. Currently only
// runc's checkpoint/restore implementation is supported.
cmd := exec.Command(podmanTest.OCIRuntime, "checkpoint", "--help")
diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go
index 1de30e423..c82e5e471 100644
--- a/test/e2e/commit_test.go
+++ b/test/e2e/commit_test.go
@@ -24,8 +24,6 @@ var _ = Describe("Podman commit", func() {
Expect(err).To(BeNil())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- err = podmanTest.SeedImages()
- Expect(err).To(BeNil())
})
AfterEach(func() {
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index 59252fcb0..28991af7f 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -6,6 +6,7 @@ import (
"io/ioutil"
"math/rand"
"net"
+ "net/url"
"os"
"os/exec"
"path/filepath"
@@ -861,9 +862,6 @@ func (p *PodmanTestIntegration) makeOptions(args []string, noEvents, noCache boo
podmanOptions := strings.Split(fmt.Sprintf("%s--root %s --runroot %s --runtime %s --conmon %s --network-config-dir %s --cgroup-manager %s --tmpdir %s --events-backend %s",
debug, p.Root, p.RunRoot, p.OCIRuntime, p.ConmonBinary, p.NetworkConfigDir, p.CgroupManager, p.TmpDir, eventsType), " ")
- if os.Getenv("HOOK_OPTION") != "" {
- podmanOptions = append(podmanOptions, os.Getenv("HOOK_OPTION"))
- }
if !p.RemoteTest {
podmanOptions = append(podmanOptions, "--network-backend", p.NetworkBackend.ToString())
@@ -1066,3 +1064,36 @@ func digShort(container, lookupName string, matchNames []string, p *PodmanTestIn
}
Fail("dns is not responding")
}
+
+// WaitForFile to be created in defaultWaitTimeout seconds, returns false if file not created
+func WaitForFile(path string) (err error) {
+ until := time.Now().Add(time.Duration(defaultWaitTimeout) * time.Second)
+ for i := 1; time.Now().Before(until); i++ {
+ _, err = os.Stat(path)
+ switch {
+ case err == nil:
+ return nil
+ case errors.Is(err, os.ErrNotExist):
+ time.Sleep(time.Duration(i) * time.Second)
+ default:
+ return err
+ }
+ }
+ return err
+}
+
+// WaitForService blocks, waiting for some service listening on given host:port
+func WaitForService(address url.URL) {
+ // Wait for podman to be ready
+ var conn net.Conn
+ var err error
+ for i := 1; i <= 5; i++ {
+ conn, err = net.Dial("tcp", address.Host)
+ if err != nil {
+ // Podman not available yet...
+ time.Sleep(time.Duration(i) * time.Second)
+ }
+ }
+ Expect(err).ShouldNot(HaveOccurred())
+ conn.Close()
+}
diff --git a/test/e2e/container_clone_test.go b/test/e2e/container_clone_test.go
index c47a89332..94ccd6ffe 100644
--- a/test/e2e/container_clone_test.go
+++ b/test/e2e/container_clone_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman container clone", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -267,4 +266,30 @@ var _ = Describe("Podman container clone", func() {
Expect(clone).ToNot(Exit(0))
})
+
+ It("podman container clone network passing", func() {
+ networkCreate := podmanTest.Podman([]string{"network", "create", "testing123"})
+ networkCreate.WaitWithDefaultTimeout()
+ defer podmanTest.removeNetwork("testing123")
+ Expect(networkCreate).To(Exit(0))
+ run := podmanTest.Podman([]string{"run", "--network", "bridge", "-dt", ALPINE})
+ run.WaitWithDefaultTimeout()
+ Expect(run).To(Exit(0))
+
+ connect := podmanTest.Podman([]string{"network", "connect", "testing123", run.OutputToString()})
+ connect.WaitWithDefaultTimeout()
+ Expect(connect).To(Exit(0))
+
+ clone := podmanTest.Podman([]string{"container", "clone", run.OutputToString()})
+ clone.WaitWithDefaultTimeout()
+ Expect(clone).To(Exit(0))
+
+ inspect := podmanTest.Podman([]string{"inspect", clone.OutputToString()})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect).To(Exit(0))
+ Expect(inspect.InspectContainerToJSON()[0].NetworkSettings.Networks).To(HaveLen(2))
+ _, ok := inspect.InspectContainerToJSON()[0].NetworkSettings.Networks["testing123"]
+ Expect(ok).To(BeTrue())
+
+ })
})
diff --git a/test/e2e/container_create_volume_test.go b/test/e2e/container_create_volume_test.go
index 015b1742a..6d9f13694 100644
--- a/test/e2e/container_create_volume_test.go
+++ b/test/e2e/container_create_volume_test.go
@@ -83,7 +83,6 @@ var _ = Describe("Podman create data volume", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/container_inspect_test.go b/test/e2e/container_inspect_test.go
index f58f2de29..5aed943da 100644
--- a/test/e2e/container_inspect_test.go
+++ b/test/e2e/container_inspect_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman container inspect", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/containers_conf_test.go b/test/e2e/containers_conf_test.go
index 09cd68042..b48e1ed62 100644
--- a/test/e2e/containers_conf_test.go
+++ b/test/e2e/containers_conf_test.go
@@ -29,7 +29,6 @@ var _ = Describe("Verify podman containers.conf usage", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
os.Setenv("CONTAINERS_CONF", "config/containers.conf")
if IsRemote() {
podmanTest.RestartRemoteService()
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go
index ede6036b9..8a65b85d3 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -31,7 +31,6 @@ var _ = Describe("Podman cp", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/create_staticip_test.go b/test/e2e/create_staticip_test.go
index 4a1d926e0..6fd88753b 100644
--- a/test/e2e/create_staticip_test.go
+++ b/test/e2e/create_staticip_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman create with --ip flag", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
// Cleanup the CNI networks used by the tests
os.RemoveAll("/var/lib/cni/networks/podman")
})
diff --git a/test/e2e/create_staticmac_test.go b/test/e2e/create_staticmac_test.go
index 5fd8e3bd6..f02d9c88b 100644
--- a/test/e2e/create_staticmac_test.go
+++ b/test/e2e/create_staticmac_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman run with --mac-address flag", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
// Cleanup the CNI networks used by the tests
os.RemoveAll("/var/lib/cni/networks/podman")
})
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index d0813459d..63544d579 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -27,8 +27,6 @@ var _ = Describe("Podman create", func() {
Expect(err).To(BeNil())
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- err = podmanTest.SeedImages()
- Expect(err).To(BeNil())
})
AfterEach(func() {
@@ -176,7 +174,8 @@ var _ = Describe("Podman create", func() {
// tests are passing inside a container.
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err := os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
session := podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test", "--mount", fmt.Sprintf("type=bind,src=%s,target=/create/test", mountPath), ALPINE, "grep", "/create/test", "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -212,7 +211,8 @@ var _ = Describe("Podman create", func() {
Expect(session.OutputToString()).To(ContainSubstring("shared"))
mountPath = filepath.Join(podmanTest.TempDir, "scratchpad")
- os.Mkdir(mountPath, 0755)
+ err = os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
session = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test_tmpfs", "--mount", "type=tmpfs,target=/create/test", ALPINE, "grep", "/create/test", "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
diff --git a/test/e2e/diff_test.go b/test/e2e/diff_test.go
index fb6df8f45..a1f57f41b 100644
--- a/test/e2e/diff_test.go
+++ b/test/e2e/diff_test.go
@@ -26,7 +26,6 @@ var _ = Describe("Podman diff", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go
index 1d4560e8e..725118ab0 100644
--- a/test/e2e/events_test.go
+++ b/test/e2e/events_test.go
@@ -29,7 +29,6 @@ var _ = Describe("Podman events", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index 3987746d0..f4ee688b7 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -27,7 +27,6 @@ var _ = Describe("Podman exec", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/export_test.go b/test/e2e/export_test.go
index 78811f1b5..59cbe06ef 100644
--- a/test/e2e/export_test.go
+++ b/test/e2e/export_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman export", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go
index c92c1519f..2ca774a03 100644
--- a/test/e2e/generate_kube_test.go
+++ b/test/e2e/generate_kube_test.go
@@ -32,7 +32,6 @@ var _ = Describe("Podman generate kube", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go
index e4b854332..08e8fbc8c 100644
--- a/test/e2e/generate_systemd_test.go
+++ b/test/e2e/generate_systemd_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman generate systemd", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -581,6 +580,7 @@ var _ = Describe("Podman generate systemd", func() {
})
It("podman generate systemd --new create command with double curly braces", func() {
+ SkipIfInContainer("journald inside a container doesn't work")
// Regression test for #9034
session := podmanTest.Podman([]string{"create", "--name", "foo", "--log-driver=journald", "--log-opt=tag={{.Name}}", ALPINE})
session.WaitWithDefaultTimeout()
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go
index a41c10162..add739988 100644
--- a/test/e2e/healthcheck_run_test.go
+++ b/test/e2e/healthcheck_run_test.go
@@ -28,14 +28,13 @@ var _ = Describe("Podman healthcheck run", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ _, _ = GinkgoWriter.Write([]byte(timedResult))
})
diff --git a/test/e2e/history_test.go b/test/e2e/history_test.go
index 92e0e1b08..d637fd9af 100644
--- a/test/e2e/history_test.go
+++ b/test/e2e/history_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman history", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/hooks/checkhook.json b/test/e2e/hooks/checkhook.json
deleted file mode 100644
index 5a9bc86d1..000000000
--- a/test/e2e/hooks/checkhook.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "cmd" : [".*"],
- "hook" : "/tmp/checkhook.sh",
- "stage" : [ "prestart" ]
-}
diff --git a/test/e2e/hooks/checkhook.sh b/test/e2e/hooks/checkhook.sh
deleted file mode 100755
index 8b755cb40..000000000
--- a/test/e2e/hooks/checkhook.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-echo $@ >> /run/hookscheck
-read line
-echo $line >> /run/hookscheck
diff --git a/test/e2e/image_sign_test.go b/test/e2e/image_sign_test.go
index dbf697bb0..3c819a7d2 100644
--- a/test/e2e/image_sign_test.go
+++ b/test/e2e/image_sign_test.go
@@ -28,8 +28,6 @@ var _ = Describe("Podman image sign", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
-
tempGNUPGHOME := filepath.Join(podmanTest.TempDir, "tmpGPG")
err := os.Mkdir(tempGNUPGHOME, os.ModePerm)
Expect(err).To(BeNil())
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go
index fc1c48c15..2473ec59e 100644
--- a/test/e2e/images_test.go
+++ b/test/e2e/images_test.go
@@ -27,7 +27,6 @@ var _ = Describe("Podman images", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/import_test.go b/test/e2e/import_test.go
index f62df23d9..e6995f0e6 100644
--- a/test/e2e/import_test.go
+++ b/test/e2e/import_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman import", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/info_test.go b/test/e2e/info_test.go
index f989a9d29..2c2c82cb6 100644
--- a/test/e2e/info_test.go
+++ b/test/e2e/info_test.go
@@ -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"))
+ session = podmanTest.Podman([]string{"info", "--format", "{{.Host.ServiceIsRemote}}"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ if podmanTest.RemoteTest {
+ Expect(session.OutputToString()).To(Equal("true"))
+ } else {
+ Expect(session.OutputToString()).To(Equal("false"))
}
- })
- It("verify ServiceIsRemote", func() {
- session := podmanTest.Podman([]string{"info", "--format", "{{.Host.ServiceIsRemote}}"})
+ session = podmanTest.Podman([]string{"info", "--format", "{{.Host.RemoteSocket.Exists}}"})
session.WaitWithDefaultTimeout()
- Expect(session).To(Exit(0))
-
- if podmanTest.RemoteTest {
+ Expect(session).Should(Exit(0))
+ if IsRemote() {
Expect(session.OutputToString()).To(ContainSubstring("true"))
- } else {
- Expect(session.OutputToString()).To(ContainSubstring("false"))
}
+
})
- 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}}"})
diff --git a/test/e2e/init_test.go b/test/e2e/init_test.go
index fdb2b41a1..ccc102fa3 100644
--- a/test/e2e/init_test.go
+++ b/test/e2e/init_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman init", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go
index 25b938d07..6fe850f0b 100644
--- a/test/e2e/inspect_test.go
+++ b/test/e2e/inspect_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman inspect", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go
index 9ad2bf7b9..19affbc6d 100644
--- a/test/e2e/libpod_suite_remote_test.go
+++ b/test/e2e/libpod_suite_remote_test.go
@@ -16,6 +16,7 @@ import (
"time"
"github.com/containers/podman/v4/pkg/rootless"
+ . "github.com/onsi/gomega"
)
func IsRemote() bool {
@@ -57,7 +58,8 @@ func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
func (p *PodmanTestIntegration) setRegistriesConfigEnv(b []byte) {
outfile := filepath.Join(p.TempDir, "registries.conf")
os.Setenv("CONTAINERS_REGISTRIES_CONF", outfile)
- ioutil.WriteFile(outfile, b, 0644)
+ err := ioutil.WriteFile(outfile, b, 0644)
+ Expect(err).ToNot(HaveOccurred())
}
func resetRegistriesConfigEnv() {
@@ -71,7 +73,8 @@ func PodmanTestCreate(tempDir string) *PodmanTestIntegration {
func (p *PodmanTestIntegration) StartRemoteService() {
if os.Geteuid() == 0 {
- os.MkdirAll("/run/podman", 0755)
+ err := os.MkdirAll("/run/podman", 0755)
+ Expect(err).ToNot(HaveOccurred())
}
args := []string{}
@@ -88,7 +91,8 @@ func (p *PodmanTestIntegration) StartRemoteService() {
command.Stdout = os.Stdout
command.Stderr = os.Stderr
fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))
- command.Start()
+ err := command.Start()
+ Expect(err).ToNot(HaveOccurred())
command.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
p.RemoteCommand = command
p.RemoteSession = command.Process
@@ -134,9 +138,6 @@ func getRemoteOptions(p *PodmanTestIntegration, args []string) []string {
networkDir := p.NetworkConfigDir
podmanOptions := strings.Split(fmt.Sprintf("--root %s --runroot %s --runtime %s --conmon %s --network-config-dir %s --cgroup-manager %s",
p.Root, p.RunRoot, p.OCIRuntime, p.ConmonBinary, networkDir, p.CgroupManager), " ")
- if os.Getenv("HOOK_OPTION") != "" {
- podmanOptions = append(podmanOptions, os.Getenv("HOOK_OPTION"))
- }
if p.NetworkBackend.ToString() == "netavark" {
podmanOptions = append(podmanOptions, "--network-backend", "netavark")
}
@@ -145,11 +146,6 @@ func getRemoteOptions(p *PodmanTestIntegration, args []string) []string {
return podmanOptions
}
-// SeedImages restores all the artifacts into the main store for remote tests
-func (p *PodmanTestIntegration) SeedImages() error {
- return nil
-}
-
// RestoreArtifact puts the cached image into our test store
func (p *PodmanTestIntegration) RestoreArtifact(image string) error {
tarball := imageTarPath(image)
@@ -159,8 +155,12 @@ func (p *PodmanTestIntegration) RestoreArtifact(image string) error {
podmanOptions := getRemoteOptions(p, args)
command := exec.Command(p.PodmanBinary, podmanOptions...)
fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))
- command.Start()
- command.Wait()
+ if err := command.Start(); err != nil {
+ return err
+ }
+ if err := command.Wait(); err != nil {
+ return err
+ }
}
return nil
}
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go
index cf81a0348..a633bd3d7 100644
--- a/test/e2e/libpod_suite_test.go
+++ b/test/e2e/libpod_suite_test.go
@@ -10,6 +10,7 @@ import (
"path/filepath"
"github.com/containers/podman/v4/pkg/rootless"
+ . "github.com/onsi/gomega"
)
func IsRemote() bool {
@@ -40,13 +41,15 @@ func (p *PodmanTestIntegration) PodmanExtraFiles(args []string, extraFiles []*os
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
defaultFile := filepath.Join(INTEGRATION_ROOT, "test/registries.conf")
- os.Setenv("CONTAINERS_REGISTRIES_CONF", defaultFile)
+ err := os.Setenv("CONTAINERS_REGISTRIES_CONF", defaultFile)
+ Expect(err).ToNot(HaveOccurred())
}
func (p *PodmanTestIntegration) setRegistriesConfigEnv(b []byte) {
outfile := filepath.Join(p.TempDir, "registries.conf")
os.Setenv("CONTAINERS_REGISTRIES_CONF", outfile)
- ioutil.WriteFile(outfile, b, 0644)
+ err := ioutil.WriteFile(outfile, b, 0644)
+ Expect(err).ToNot(HaveOccurred())
}
func resetRegistriesConfigEnv() {
@@ -70,11 +73,6 @@ func (p *PodmanTestIntegration) RestoreArtifact(image string) error {
func (p *PodmanTestIntegration) StopRemoteService() {}
-// SeedImages is a no-op for localized testing
-func (p *PodmanTestIntegration) SeedImages() error {
- return nil
-}
-
// We don't support running API service when local
func (p *PodmanTestIntegration) StartRemoteService() {
}
diff --git a/test/e2e/login_logout_test.go b/test/e2e/login_logout_test.go
index 001779cdf..bce8b78c6 100644
--- a/test/e2e/login_logout_test.go
+++ b/test/e2e/login_logout_test.go
@@ -36,7 +36,8 @@ var _ = Describe("Podman login and logout", func() {
podmanTest = PodmanTestCreate(tempdir)
authPath = filepath.Join(podmanTest.TempDir, "auth")
- os.Mkdir(authPath, os.ModePerm)
+ err := os.Mkdir(authPath, os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
if IsCommandAvailable("getenforce") {
ge := SystemExec("getenforce", []string{})
@@ -55,11 +56,14 @@ var _ = Describe("Podman login and logout", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- f, _ := os.Create(filepath.Join(authPath, "htpasswd"))
+ f, err := os.Create(filepath.Join(authPath, "htpasswd"))
+ Expect(err).ToNot(HaveOccurred())
defer f.Close()
- f.WriteString(session.OutputToString())
- f.Sync()
+ _, err = f.WriteString(session.OutputToString())
+ Expect(err).ToNot(HaveOccurred())
+ err = f.Sync()
+ Expect(err).ToNot(HaveOccurred())
port := GetPort()
server = strings.Join([]string{"localhost", strconv.Itoa(port)}, ":")
@@ -68,7 +72,8 @@ var _ = Describe("Podman login and logout", func() {
testImg = strings.Join([]string{server, "test-alpine"}, "/")
certDirPath = filepath.Join(os.Getenv("HOME"), ".config/containers/certs.d", server)
- os.MkdirAll(certDirPath, os.ModePerm)
+ err = os.MkdirAll(certDirPath, os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
cwd, _ := os.Getwd()
certPath = filepath.Join(cwd, "../", "certs")
@@ -207,7 +212,8 @@ var _ = Describe("Podman login and logout", func() {
})
It("podman login and logout with --cert-dir", func() {
certDir := filepath.Join(podmanTest.TempDir, "certs")
- os.MkdirAll(certDir, os.ModePerm)
+ err := os.MkdirAll(certDir, os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
setup := SystemExec("cp", []string{filepath.Join(certPath, "domain.crt"), filepath.Join(certDir, "ca.crt")})
setup.WaitWithDefaultTimeout()
@@ -226,7 +232,8 @@ var _ = Describe("Podman login and logout", func() {
})
It("podman login and logout with multi registry", func() {
certDir := filepath.Join(os.Getenv("HOME"), ".config/containers/certs.d", "localhost:9001")
- os.MkdirAll(certDir, os.ModePerm)
+ err = os.MkdirAll(certDir, os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
cwd, _ := os.Getwd()
certPath = filepath.Join(cwd, "../", "certs")
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index 934a306ce..4e6dcb8af 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -37,9 +37,6 @@ var _ = Describe("Podman logs", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- if err := podmanTest.SeedImages(); err != nil {
- os.Exit(1)
- }
})
AfterEach(func() {
diff --git a/test/e2e/manifest_test.go b/test/e2e/manifest_test.go
index 230864891..88ccdc87d 100644
--- a/test/e2e/manifest_test.go
+++ b/test/e2e/manifest_test.go
@@ -36,7 +36,6 @@ var _ = Describe("Podman manifest", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -274,7 +273,10 @@ var _ = Describe("Podman manifest", func() {
})
It("authenticated push", func() {
- registry, err := podmanRegistry.Start()
+ registryOptions := &podmanRegistry.Options{
+ Image: "docker-archive:" + imageTarPath(registry),
+ }
+ registry, err := podmanRegistry.StartWithOptions(registryOptions)
Expect(err).To(BeNil())
session := podmanTest.Podman([]string{"manifest", "create", "foo"})
diff --git a/test/e2e/mount_rootless_test.go b/test/e2e/mount_rootless_test.go
index 30d7ce8a9..994a5899b 100644
--- a/test/e2e/mount_rootless_test.go
+++ b/test/e2e/mount_rootless_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman mount", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/namespace_test.go b/test/e2e/namespace_test.go
index bc9db4cd9..0000a2327 100644
--- a/test/e2e/namespace_test.go
+++ b/test/e2e/namespace_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman namespaces", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go
index a6e927ca2..69966b07e 100644
--- a/test/e2e/network_create_test.go
+++ b/test/e2e/network_create_test.go
@@ -32,7 +32,6 @@ var _ = Describe("Podman network create", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go
index 66638d71c..402719de2 100644
--- a/test/e2e/pause_test.go
+++ b/test/e2e/pause_test.go
@@ -45,7 +45,6 @@ var _ = Describe("Podman pause", func() {
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/play_build_test.go b/test/e2e/play_build_test.go
index 96785c569..914144ae6 100644
--- a/test/e2e/play_build_test.go
+++ b/test/e2e/play_build_test.go
@@ -29,7 +29,6 @@ var _ = Describe("Podman play kube with build", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index fba4a4f09..1b223637e 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -1206,8 +1206,6 @@ var _ = Describe("Podman play kube", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
-
kubeYaml = filepath.Join(podmanTest.TempDir, "kube.yaml")
})
@@ -2744,6 +2742,7 @@ MemoryReservation: {{ .HostConfig.MemoryReservation }}`})
})
It("podman play kube applies log driver to containers", func() {
+ SkipIfInContainer("journald inside a container doesn't work")
pod := getPod()
err := generateKubeYaml("pod", pod, kubeYaml)
Expect(err).To(BeNil())
@@ -3181,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"
@@ -3200,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()))
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index 0c7886a93..dedb1caeb 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -35,7 +35,6 @@ var _ = Describe("Podman pod create", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go
index 2b56502b0..ab204992c 100644
--- a/test/e2e/pod_infra_container_test.go
+++ b/test/e2e/pod_infra_container_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman pod create", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_initcontainers_test.go b/test/e2e/pod_initcontainers_test.go
index 3c660c5bf..ec429f568 100644
--- a/test/e2e/pod_initcontainers_test.go
+++ b/test/e2e/pod_initcontainers_test.go
@@ -26,7 +26,6 @@ var _ = Describe("Podman init containers", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_inspect_test.go b/test/e2e/pod_inspect_test.go
index dcc70e4a5..351317cc5 100644
--- a/test/e2e/pod_inspect_test.go
+++ b/test/e2e/pod_inspect_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman pod inspect", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_kill_test.go b/test/e2e/pod_kill_test.go
index 18f9769a1..0612200d4 100644
--- a/test/e2e/pod_kill_test.go
+++ b/test/e2e/pod_kill_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman pod kill", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_pause_test.go b/test/e2e/pod_pause_test.go
index 57ae75926..d78890347 100644
--- a/test/e2e/pod_pause_test.go
+++ b/test/e2e/pod_pause_test.go
@@ -26,7 +26,6 @@ var _ = Describe("Podman pod pause", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_pod_namespaces_test.go b/test/e2e/pod_pod_namespaces_test.go
index 667a54861..5b288898f 100644
--- a/test/e2e/pod_pod_namespaces_test.go
+++ b/test/e2e/pod_pod_namespaces_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman pod create", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_prune_test.go b/test/e2e/pod_prune_test.go
index 55ecc1593..dce3e34e4 100644
--- a/test/e2e/pod_prune_test.go
+++ b/test/e2e/pod_prune_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman pod prune", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index a0a1e1438..97ca5ff94 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -26,7 +26,6 @@ var _ = Describe("Podman ps", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_restart_test.go b/test/e2e/pod_restart_test.go
index 1897104cc..fab448f92 100644
--- a/test/e2e/pod_restart_test.go
+++ b/test/e2e/pod_restart_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman pod restart", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go
index dbb2d6d13..a5eab7eed 100644
--- a/test/e2e/pod_rm_test.go
+++ b/test/e2e/pod_rm_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman pod rm", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_start_test.go b/test/e2e/pod_start_test.go
index 2f3ef3a11..084a48636 100644
--- a/test/e2e/pod_start_test.go
+++ b/test/e2e/pod_start_test.go
@@ -27,7 +27,6 @@ var _ = Describe("Podman pod start", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go
index 0e94406f8..8f76e6e5a 100644
--- a/test/e2e/pod_stats_test.go
+++ b/test/e2e/pod_stats_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman pod stats", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_stop_test.go b/test/e2e/pod_stop_test.go
index fc78f9ed6..2fe0aa486 100644
--- a/test/e2e/pod_stop_test.go
+++ b/test/e2e/pod_stop_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman pod stop", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pod_top_test.go b/test/e2e/pod_top_test.go
index 564170412..07028da45 100644
--- a/test/e2e/pod_top_test.go
+++ b/test/e2e/pod_top_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman top", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/port_test.go b/test/e2e/port_test.go
index d81c03e5b..03263a198 100644
--- a/test/e2e/port_test.go
+++ b/test/e2e/port_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman port", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/prune_test.go b/test/e2e/prune_test.go
index 01f987b92..75adf1724 100644
--- a/test/e2e/prune_test.go
+++ b/test/e2e/prune_test.go
@@ -35,7 +35,6 @@ var _ = Describe("Podman prune", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go
index 021ebc30b..1100a5d90 100644
--- a/test/e2e/ps_test.go
+++ b/test/e2e/ps_test.go
@@ -29,7 +29,6 @@ var _ = Describe("Podman ps", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go
index d13334651..55e8d637b 100644
--- a/test/e2e/pull_test.go
+++ b/test/e2e/pull_test.go
@@ -5,7 +5,6 @@ import (
"os"
"path/filepath"
"runtime"
- "strings"
. "github.com/containers/podman/v4/test/utils"
. "github.com/onsi/ginkgo"
@@ -53,23 +52,29 @@ var _ = Describe("Podman pull", func() {
Expect(session).Should(Exit(0))
})
- It("podman pull from docker a not existing image", func() {
- session := podmanTest.Podman([]string{"pull", "ibetthisdoesntexistthere:foo"})
+ It("podman pull bogus image", func() {
+ session := podmanTest.Podman([]string{"pull", "quay.io/ibetthis/doesntexistthere:foo"})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
})
- It("podman pull from docker with tag", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2:20200210"})
+ It("podman pull with tag --quiet", func() {
+ session := podmanTest.Podman([]string{"pull", "-q", "quay.io/libpod/testdigest_v2s2:20200210"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ quietOutput := session.OutputToString()
+
+ session = podmanTest.Podman([]string{"inspect", "testdigest_v2s2:20200210", "--format", "{{.ID}}"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(Equal(quietOutput))
session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2:20200210"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
- It("podman pull from docker without tag", func() {
+ It("podman pull without tag", func() {
session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
@@ -79,39 +84,36 @@ var _ = Describe("Podman pull", func() {
Expect(session).Should(Exit(0))
})
- It("podman pull from alternate registry with tag", func() {
- session := podmanTest.Podman([]string{"pull", cirros})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
-
- session = podmanTest.Podman([]string{"rmi", cirros})
+ It("podman pull by digest", func() {
+ session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- })
- It("podman pull from alternate registry without tag", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/cirros"})
+ // Without a tag/digest the input is normalized with the "latest" tag, see #11964
+ session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
+ Expect(session).Should(Exit(1))
- session = podmanTest.Podman([]string{"rmi", "quay.io/libpod/cirros"})
+ session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
})
- It("podman pull by digest", func() {
- session := podmanTest.Podman([]string{"pull", "quay.io/libpod/testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
+ It("podman pull check all tags", func() {
+ session := podmanTest.Podman([]string{"pull", "--all-tags", "quay.io/libpod/testdigest_v2s2"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- // Without a tag/digest the input is normalized with the "latest" tag, see #11964
- session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2"})
+ session = podmanTest.Podman([]string{"images"})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(1))
+ Expect(session).Should(Exit(0))
+ Expect(len(session.OutputToStringArray())).To(BeNumerically(">=", 2), "Expected at least two images")
+ })
- session = podmanTest.Podman([]string{"rmi", "testdigest_v2s2@sha256:755f4d90b3716e2bf57060d249e2cd61c9ac089b1233465c5c2cb2d7ee550fdb"})
+ It("podman pull from docker with nonexistent --authfile", func() {
+ session := podmanTest.Podman([]string{"pull", "--authfile", "/tmp/nonexistent", ALPINE})
session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
+ Expect(session).To(ExitWithError())
})
It("podman pull by digest (image list)", func() {
@@ -251,12 +253,6 @@ var _ = Describe("Podman pull", func() {
Expect(session).Should(Exit(0))
})
- It("podman pull bogus image", func() {
- session := podmanTest.Podman([]string{"pull", "umohnani/get-started"})
- session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
- })
-
It("podman pull from docker-archive", func() {
SkipIfRemote("podman-remote does not support pulling from docker-archive")
@@ -345,7 +341,8 @@ var _ = Describe("Podman pull", func() {
podmanTest.AddImageToRWStore(cirros)
dirpath := filepath.Join(podmanTest.TempDir, "cirros")
- os.MkdirAll(dirpath, os.ModePerm)
+ err = os.MkdirAll(dirpath, os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
imgPath := fmt.Sprintf("dir:%s", dirpath)
session := podmanTest.Podman([]string{"push", "cirros", imgPath})
@@ -368,7 +365,8 @@ var _ = Describe("Podman pull", func() {
podmanTest.AddImageToRWStore(cirros)
dirpath := filepath.Join(podmanTest.TempDir, "cirros")
- os.MkdirAll(dirpath, os.ModePerm)
+ err = os.MkdirAll(dirpath, os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
imgPath := fmt.Sprintf("oci:%s", dirpath)
session := podmanTest.Podman([]string{"push", "cirros", imgPath})
@@ -386,41 +384,6 @@ var _ = Describe("Podman pull", func() {
Expect(session.LineInOutputContainsTag(filepath.Join("localhost", dirpath), "latest")).To(BeTrue())
})
- It("podman pull check quiet", func() {
- podmanTest.RestoreArtifact(ALPINE)
- setup := podmanTest.Podman([]string{"images", ALPINE, "-q", "--no-trunc"})
- setup.WaitWithDefaultTimeout()
- Expect(setup).Should(Exit(0))
- shortImageID := strings.Split(setup.OutputToString(), ":")[1]
-
- rmi := podmanTest.Podman([]string{"rmi", ALPINE})
- rmi.WaitWithDefaultTimeout()
- Expect(rmi).Should(Exit(0))
-
- pull := podmanTest.Podman([]string{"pull", "-q", ALPINE})
- pull.WaitWithDefaultTimeout()
- Expect(pull).Should(Exit(0))
-
- Expect(pull.OutputToString()).To(ContainSubstring(shortImageID))
- })
-
- It("podman pull check all tags", func() {
- session := podmanTest.Podman([]string{"pull", "--all-tags", "k8s.gcr.io/pause"})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
-
- session = podmanTest.Podman([]string{"images"})
- session.WaitWithDefaultTimeout()
- Expect(session).Should(Exit(0))
- Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 4))
- })
-
- It("podman pull from docker with nonexistent --authfile", func() {
- session := podmanTest.Podman([]string{"pull", "--authfile", "/tmp/nonexistent", ALPINE})
- session.WaitWithDefaultTimeout()
- Expect(session).To(ExitWithError())
- })
-
It("podman pull + inspect from unqualified-search registry", func() {
// Regression test for #6381:
// Make sure that `pull shortname` and `inspect shortname`
@@ -428,8 +391,10 @@ var _ = Describe("Podman pull", func() {
// We already tested pulling, so we can save some energy and
// just restore local artifacts and tag them.
- podmanTest.RestoreArtifact(ALPINE)
- podmanTest.RestoreArtifact(BB)
+ err := podmanTest.RestoreArtifact(ALPINE)
+ Expect(err).ToNot(HaveOccurred())
+ err = podmanTest.RestoreArtifact(BB)
+ Expect(err).ToNot(HaveOccurred())
// What we want is at least two images which have the same name
// and are prefixed with two different unqualified-search
diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go
index 3b571ab20..0288bf915 100644
--- a/test/e2e/push_test.go
+++ b/test/e2e/push_test.go
@@ -101,7 +101,8 @@ var _ = Describe("Podman push", func() {
Skip("No registry image for ppc64le")
}
if rootless.IsRootless() {
- podmanTest.RestoreArtifact(registry)
+ err := podmanTest.RestoreArtifact(registry)
+ Expect(err).ToNot(HaveOccurred())
}
lock := GetPortLock("5000")
defer lock.Unlock()
@@ -132,8 +133,10 @@ var _ = Describe("Podman push", func() {
Skip("No registry image for ppc64le")
}
authPath := filepath.Join(podmanTest.TempDir, "auth")
- os.Mkdir(authPath, os.ModePerm)
- os.MkdirAll("/etc/containers/certs.d/localhost:5000", os.ModePerm)
+ err = os.Mkdir(authPath, os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
+ err = os.MkdirAll("/etc/containers/certs.d/localhost:5000", os.ModePerm)
+ Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll("/etc/containers/certs.d/localhost:5000")
cwd, _ := os.Getwd()
@@ -157,11 +160,14 @@ var _ = Describe("Podman push", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
- f, _ := os.Create(filepath.Join(authPath, "htpasswd"))
+ f, err := os.Create(filepath.Join(authPath, "htpasswd"))
+ Expect(err).ToNot(HaveOccurred())
defer f.Close()
- f.WriteString(session.OutputToString())
- f.Sync()
+ _, err = f.WriteString(session.OutputToString())
+ Expect(err).ToNot(HaveOccurred())
+ err = f.Sync()
+ Expect(err).ToNot(HaveOccurred())
session = podmanTest.Podman([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v",
strings.Join([]string{authPath, "/auth"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
diff --git a/test/e2e/rename_test.go b/test/e2e/rename_test.go
index ef90c3f22..341490d9c 100644
--- a/test/e2e/rename_test.go
+++ b/test/e2e/rename_test.go
@@ -24,7 +24,6 @@ var _ = Describe("podman rename", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go
index b8c74d395..b3052623b 100644
--- a/test/e2e/restart_test.go
+++ b/test/e2e/restart_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman restart", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go
index f836540b4..7dbe5fed8 100644
--- a/test/e2e/rm_test.go
+++ b/test/e2e/rm_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman rm", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_aardvark_test.go b/test/e2e/run_aardvark_test.go
index 7b4598423..25eb8b538 100644
--- a/test/e2e/run_aardvark_test.go
+++ b/test/e2e/run_aardvark_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman run networking", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
SkipIfCNI(podmanTest)
})
diff --git a/test/e2e/run_apparmor_test.go b/test/e2e/run_apparmor_test.go
index ed88ab7a0..18d011e6d 100644
--- a/test/e2e/run_apparmor_test.go
+++ b/test/e2e/run_apparmor_test.go
@@ -42,7 +42,6 @@ var _ = Describe("Podman run", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_cgroup_parent_test.go b/test/e2e/run_cgroup_parent_test.go
index 34715be22..24cae43b1 100644
--- a/test/e2e/run_cgroup_parent_test.go
+++ b/test/e2e/run_cgroup_parent_test.go
@@ -30,7 +30,6 @@ var _ = Describe("Podman run with --cgroup-parent", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_cleanup_test.go b/test/e2e/run_cleanup_test.go
index 2282ef913..ea2caf907 100644
--- a/test/e2e/run_cleanup_test.go
+++ b/test/e2e/run_cleanup_test.go
@@ -23,7 +23,8 @@ var _ = Describe("Podman run exit", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.RestoreArtifact(ALPINE)
+ err = podmanTest.RestoreArtifact(ALPINE)
+ Expect(err).ToNot(HaveOccurred())
})
AfterEach(func() {
diff --git a/test/e2e/run_cpu_test.go b/test/e2e/run_cpu_test.go
index fda0a7c24..b21be5729 100644
--- a/test/e2e/run_cpu_test.go
+++ b/test/e2e/run_cpu_test.go
@@ -33,7 +33,6 @@ var _ = Describe("Podman run cpu", func() {
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_device_test.go b/test/e2e/run_device_test.go
index 479837dda..c46afdaca 100644
--- a/test/e2e/run_device_test.go
+++ b/test/e2e/run_device_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman run device", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_dns_test.go b/test/e2e/run_dns_test.go
index 7561a2e85..61177b4c7 100644
--- a/test/e2e/run_dns_test.go
+++ b/test/e2e/run_dns_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman run dns", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_entrypoint_test.go b/test/e2e/run_entrypoint_test.go
index fde43dfec..9f35b9e7e 100644
--- a/test/e2e/run_entrypoint_test.go
+++ b/test/e2e/run_entrypoint_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman run entrypoint", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_env_test.go b/test/e2e/run_env_test.go
index f4c44c23b..bab52efc5 100644
--- a/test/e2e/run_env_test.go
+++ b/test/e2e/run_env_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman run", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_exit_test.go b/test/e2e/run_exit_test.go
index aa9a4295c..0663e4d9a 100644
--- a/test/e2e/run_exit_test.go
+++ b/test/e2e/run_exit_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman run exit", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_memory_test.go b/test/e2e/run_memory_test.go
index d6a67da57..083020f08 100644
--- a/test/e2e/run_memory_test.go
+++ b/test/e2e/run_memory_test.go
@@ -26,7 +26,6 @@ var _ = Describe("Podman run memory", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index 53a91b2b3..c9990b70f 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -32,7 +32,6 @@ var _ = Describe("Podman run networking", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -747,11 +746,12 @@ EXPOSE 2004-2005/tcp`, ALPINE)
routeAdd := func(gateway string) {
gw := net.ParseIP(gateway)
route := &netlink.Route{Dst: nil, Gw: gw}
- netlink.RouteAdd(route)
+ err = netlink.RouteAdd(route)
+ Expect(err).ToNot(HaveOccurred())
}
setupNetworkNs := func(networkNSName string) {
- ns.WithNetNSPath("/run/netns/"+networkNSName, func(_ ns.NetNS) error {
+ _ = ns.WithNetNSPath("/run/netns/"+networkNSName, func(_ ns.NetNS) error {
loopbackup()
linkup("eth0", "46:7f:45:6e:4f:c8", []string{"10.25.40.0/24", "fd04:3e42:4a4e:3381::/64"})
linkup("eth1", "56:6e:35:5d:3e:a8", []string{"10.88.0.0/16"})
diff --git a/test/e2e/run_ns_test.go b/test/e2e/run_ns_test.go
index 23fd298d7..f99d6cf3f 100644
--- a/test/e2e/run_ns_test.go
+++ b/test/e2e/run_ns_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman run ns", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_passwd_test.go b/test/e2e/run_passwd_test.go
index ce6c6ffda..411e12218 100644
--- a/test/e2e/run_passwd_test.go
+++ b/test/e2e/run_passwd_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman run passwd", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_privileged_test.go b/test/e2e/run_privileged_test.go
index 59223c589..4f0b512c6 100644
--- a/test/e2e/run_privileged_test.go
+++ b/test/e2e/run_privileged_test.go
@@ -49,7 +49,6 @@ var _ = Describe("Podman privileged container tests", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_restart_test.go b/test/e2e/run_restart_test.go
index ec8fbfe98..b1002ece4 100644
--- a/test/e2e/run_restart_test.go
+++ b/test/e2e/run_restart_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman run restart containers", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_seccomp_test.go b/test/e2e/run_seccomp_test.go
index 03212b6dc..bd44a3ef1 100644
--- a/test/e2e/run_seccomp_test.go
+++ b/test/e2e/run_seccomp_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman run", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_security_labels_test.go b/test/e2e/run_security_labels_test.go
index 8aebeaebb..915566a2c 100644
--- a/test/e2e/run_security_labels_test.go
+++ b/test/e2e/run_security_labels_test.go
@@ -25,8 +25,6 @@ var _ = Describe("Podman generate kube", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
-
})
AfterEach(func() {
diff --git a/test/e2e/run_selinux_test.go b/test/e2e/run_selinux_test.go
index b71c68baf..4a433f308 100644
--- a/test/e2e/run_selinux_test.go
+++ b/test/e2e/run_selinux_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman run", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
if !selinux.GetEnabled() {
Skip("SELinux not enabled")
}
diff --git a/test/e2e/run_signal_test.go b/test/e2e/run_signal_test.go
index d40a5a1b4..e5d9b6c7b 100644
--- a/test/e2e/run_signal_test.go
+++ b/test/e2e/run_signal_test.go
@@ -34,7 +34,6 @@ var _ = Describe("Podman run with --sig-proxy", func() {
}
podmanTest = PodmanTestCreate(tmpdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -51,11 +50,14 @@ var _ = Describe("Podman run with --sig-proxy", func() {
signal := syscall.SIGFPE
// Set up a socket for communication
udsDir := filepath.Join(tmpdir, "socket")
- os.Mkdir(udsDir, 0700)
+ err := os.Mkdir(udsDir, 0700)
+ Expect(err).ToNot(HaveOccurred())
udsPath := filepath.Join(udsDir, "fifo")
- syscall.Mkfifo(udsPath, 0600)
+ err = syscall.Mkfifo(udsPath, 0600)
+ Expect(err).ToNot(HaveOccurred())
if rootless.IsRootless() {
- podmanTest.RestoreArtifact(fedoraMinimal)
+ err = podmanTest.RestoreArtifact(fedoraMinimal)
+ Expect(err).ToNot(HaveOccurred())
}
_, pid := podmanTest.PodmanPID([]string{"run", "-it", "-v", fmt.Sprintf("%s:/h:Z", udsDir), fedoraMinimal, "bash", "-c", sigCatch})
@@ -112,7 +114,8 @@ var _ = Describe("Podman run with --sig-proxy", func() {
Specify("signals are not forwarded to container with sig-proxy false", func() {
signal := syscall.SIGFPE
if rootless.IsRootless() {
- podmanTest.RestoreArtifact(fedoraMinimal)
+ err = podmanTest.RestoreArtifact(fedoraMinimal)
+ Expect(err).ToNot(HaveOccurred())
}
session, pid := podmanTest.PodmanPID([]string{"run", "--name", "test2", "--sig-proxy=false", fedoraMinimal, "bash", "-c", sigCatch2})
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go
index 7e61e7c5e..af3f98d4b 100644
--- a/test/e2e/run_staticip_test.go
+++ b/test/e2e/run_staticip_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman run with --ip flag", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
// Cleanup the CNI networks used by the tests
os.RemoveAll("/var/lib/cni/networks/podman")
})
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 386a27a2f..182ae1888 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -16,7 +16,6 @@ import (
"github.com/containers/podman/v4/pkg/rootless"
. "github.com/containers/podman/v4/test/utils"
"github.com/containers/storage/pkg/stringid"
- "github.com/mrunalp/fileutils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
@@ -36,7 +35,6 @@ var _ = Describe("Podman run", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -812,16 +810,38 @@ USER bin`, BB)
})
It("podman test hooks", func() {
- hcheck := "/run/hookscheck"
+ SkipIfRemote("--hooks-dir does not work with remote")
hooksDir := tempdir + "/hooks"
- os.Mkdir(hooksDir, 0755)
- fileutils.CopyFile("hooks/hooks.json", hooksDir)
- os.Setenv("HOOK_OPTION", fmt.Sprintf("--hooks-dir=%s", hooksDir))
- os.Remove(hcheck)
- session := podmanTest.Podman([]string{"run", ALPINE, "ls"})
+ err := os.Mkdir(hooksDir, 0755)
+ Expect(err).ToNot(HaveOccurred())
+ hookJSONPath := filepath.Join(hooksDir, "checkhooks.json")
+ hookScriptPath := filepath.Join(hooksDir, "checkhooks.sh")
+ targetFile := filepath.Join(hooksDir, "target")
+
+ hookJSON := fmt.Sprintf(`{
+ "cmd" : [".*"],
+ "hook" : "%s",
+ "stage" : [ "prestart" ]
+}
+`, hookScriptPath)
+ err = ioutil.WriteFile(hookJSONPath, []byte(hookJSON), 0644)
+ Expect(err).ToNot(HaveOccurred())
+
+ random := stringid.GenerateNonCryptoID()
+
+ hookScript := fmt.Sprintf(`#!/bin/sh
+echo -n %s >%s
+`, random, targetFile)
+ err = ioutil.WriteFile(hookScriptPath, []byte(hookScript), 0755)
+ Expect(err).ToNot(HaveOccurred())
+
+ session := podmanTest.Podman([]string{"--hooks-dir", hooksDir, "run", ALPINE, "ls"})
session.Wait(10)
- os.Unsetenv("HOOK_OPTION")
Expect(session).Should(Exit(0))
+
+ b, err := ioutil.ReadFile(targetFile)
+ Expect(err).ToNot(HaveOccurred())
+ Expect(string(b)).To(Equal(random))
})
It("podman run with subscription secrets", func() {
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index 092621c27..613727118 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -33,7 +33,6 @@ var _ = Describe("Podman UserNS support", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index 4f1013f8d..3bef889b7 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -34,7 +34,6 @@ var _ = Describe("Podman run with volumes", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -55,7 +54,8 @@ var _ = Describe("Podman run with volumes", func() {
It("podman run with volume flag", func() {
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err = os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
vol := mountPath + ":" + dest
// [5] is flags
@@ -82,7 +82,8 @@ var _ = Describe("Podman run with volumes", func() {
Skip("skip failing test on ppc64le")
}
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err = os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
mount := "type=bind,src=" + mountPath + ",target=" + dest
session := podmanTest.Podman([]string{"run", "--rm", "--mount", mount, ALPINE, "grep", dest, "/proc/self/mountinfo"})
@@ -141,14 +142,16 @@ var _ = Describe("Podman run with volumes", func() {
It("podman run with conflicting volumes errors", func() {
mountPath := filepath.Join(podmanTest.TmpDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err := os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
session := podmanTest.Podman([]string{"run", "-v", mountPath + ":" + dest, "-v", "/tmp" + ":" + dest, ALPINE, "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(125))
})
It("podman run with conflict between image volume and user mount succeeds", func() {
- podmanTest.RestoreArtifact(redis)
+ err = podmanTest.RestoreArtifact(redis)
+ Expect(err).ToNot(HaveOccurred())
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
err := os.Mkdir(mountPath, 0755)
Expect(err).To(BeNil())
@@ -164,7 +167,8 @@ var _ = Describe("Podman run with volumes", func() {
It("podman run with mount flag and boolean options", func() {
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err := os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
mount := "type=bind,src=" + mountPath + ",target=" + dest
session := podmanTest.Podman([]string{"run", "--rm", "--mount", mount + ",ro=false", ALPINE, "grep", dest, "/proc/self/mountinfo"})
@@ -193,7 +197,8 @@ var _ = Describe("Podman run with volumes", func() {
It("podman run with volumes and suid/dev/exec options", func() {
SkipIfRemote("podman-remote does not support --volumes")
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err := os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
session := podmanTest.Podman([]string{"run", "--rm", "-v", mountPath + ":" + dest + ":suid,dev,exec", ALPINE, "grep", dest, "/proc/self/mountinfo"})
session.WaitWithDefaultTimeout()
@@ -224,7 +229,8 @@ var _ = Describe("Podman run with volumes", func() {
}
}
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err := os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
// Container should be able to start with custom overlay volume
session := podmanTest.Podman([]string{"run", "--rm", "-v", mountPath + ":/data:O", "--workdir=/data", ALPINE, "echo", "hello"})
@@ -603,7 +609,8 @@ VOLUME /test/`, ALPINE)
}
}
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err := os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
testFile := filepath.Join(mountPath, "test1")
f, err := os.Create(testFile)
Expect(err).To(BeNil(), "os.Create "+testFile)
@@ -651,7 +658,8 @@ VOLUME /test/`, ALPINE)
It("overlay volume conflicts with named volume and mounts", func() {
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err := os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
testFile := filepath.Join(mountPath, "test1")
f, err := os.Create(testFile)
Expect(err).To(BeNil())
@@ -716,7 +724,8 @@ VOLUME /test/`, ALPINE)
}
mountPath := filepath.Join(podmanTest.TempDir, "secrets")
- os.Mkdir(mountPath, 0755)
+ err = os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
vol := mountPath + ":" + dest + ":U"
session := podmanTest.Podman([]string{"run", "--rm", "--user", "888:888", "-v", vol, ALPINE, "stat", "-c", "%u:%g", dest})
@@ -754,7 +763,8 @@ VOLUME /test/`, ALPINE)
}
mountPath := filepath.Join(podmanTest.TempDir, "foo")
- os.Mkdir(mountPath, 0755)
+ err = os.Mkdir(mountPath, 0755)
+ Expect(err).ToNot(HaveOccurred())
// false bind mount
vol := "type=bind,src=" + mountPath + ",dst=" + dest + ",U=false"
diff --git a/test/e2e/run_working_dir_test.go b/test/e2e/run_working_dir_test.go
index 50d0a2194..ff91a420f 100644
--- a/test/e2e/run_working_dir_test.go
+++ b/test/e2e/run_working_dir_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman run", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/runlabel_test.go b/test/e2e/runlabel_test.go
index d1e11dd9a..018ed37c2 100644
--- a/test/e2e/runlabel_test.go
+++ b/test/e2e/runlabel_test.go
@@ -37,7 +37,6 @@ var _ = Describe("podman container runlabel", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/save_test.go b/test/e2e/save_test.go
index 39295608e..536eefda7 100644
--- a/test/e2e/save_test.go
+++ b/test/e2e/save_test.go
@@ -170,7 +170,8 @@ var _ = Describe("Podman save", func() {
}
defer func() {
cmd = exec.Command("cp", "default.yaml", "/etc/containers/registries.d/default.yaml")
- cmd.Run()
+ err := cmd.Run()
+ Expect(err).ToNot(HaveOccurred())
}()
cmd = exec.Command("cp", "sign/key.gpg", "/tmp/key.gpg")
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go
index 07198d799..8237f6433 100644
--- a/test/e2e/search_test.go
+++ b/test/e2e/search_test.go
@@ -64,8 +64,6 @@ registries = ['{{.Host}}:{{.Port}}']`
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
-
})
AfterEach(func() {
@@ -242,7 +240,8 @@ registries = ['{{.Host}}:{{.Port}}']`
Fail("Cannot start docker registry on port %s", port)
}
ep := endpoint{Port: fmt.Sprintf("%d", port), Host: "localhost"}
- podmanTest.RestoreArtifact(ALPINE)
+ err = podmanTest.RestoreArtifact(ALPINE)
+ Expect(err).ToNot(HaveOccurred())
image := fmt.Sprintf("%s/my-alpine", ep.Address())
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
push.WaitWithDefaultTimeout()
@@ -277,7 +276,8 @@ registries = ['{{.Host}}:{{.Port}}']`
Fail("unable to start registry on port %s", port)
}
- podmanTest.RestoreArtifact(ALPINE)
+ err = podmanTest.RestoreArtifact(ALPINE)
+ Expect(err).ToNot(HaveOccurred())
image := fmt.Sprintf("%s/my-alpine", ep.Address())
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
push.WaitWithDefaultTimeout()
@@ -285,9 +285,11 @@ registries = ['{{.Host}}:{{.Port}}']`
// registries.conf set up
var buffer bytes.Buffer
- registryFileTmpl.Execute(&buffer, ep)
+ err = registryFileTmpl.Execute(&buffer, ep)
+ Expect(err).ToNot(HaveOccurred())
podmanTest.setRegistriesConfigEnv(buffer.Bytes())
- ioutil.WriteFile(fmt.Sprintf("%s/registry4.conf", tempdir), buffer.Bytes(), 0644)
+ err = ioutil.WriteFile(fmt.Sprintf("%s/registry4.conf", tempdir), buffer.Bytes(), 0644)
+ Expect(err).ToNot(HaveOccurred())
if IsRemote() {
podmanTest.RestartRemoteService()
defer podmanTest.RestartRemoteService()
@@ -319,16 +321,19 @@ registries = ['{{.Host}}:{{.Port}}']`
Fail("Cannot start docker registry on port %s", port)
}
- podmanTest.RestoreArtifact(ALPINE)
+ err = podmanTest.RestoreArtifact(ALPINE)
+ Expect(err).ToNot(HaveOccurred())
image := fmt.Sprintf("%s/my-alpine", ep.Address())
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
var buffer bytes.Buffer
- registryFileTmpl.Execute(&buffer, ep)
+ err = registryFileTmpl.Execute(&buffer, ep)
+ Expect(err).ToNot(HaveOccurred())
podmanTest.setRegistriesConfigEnv(buffer.Bytes())
- ioutil.WriteFile(fmt.Sprintf("%s/registry5.conf", tempdir), buffer.Bytes(), 0644)
+ err = ioutil.WriteFile(fmt.Sprintf("%s/registry5.conf", tempdir), buffer.Bytes(), 0644)
+ Expect(err).ToNot(HaveOccurred())
search := podmanTest.Podman([]string{"search", image, "--tls-verify=true"})
search.WaitWithDefaultTimeout()
@@ -356,16 +361,19 @@ registries = ['{{.Host}}:{{.Port}}']`
Fail("Cannot start docker registry on port %s", port)
}
- podmanTest.RestoreArtifact(ALPINE)
+ err = podmanTest.RestoreArtifact(ALPINE)
+ Expect(err).ToNot(HaveOccurred())
image := fmt.Sprintf("%s/my-alpine", ep.Address())
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, image})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
var buffer bytes.Buffer
- registryFileBadTmpl.Execute(&buffer, ep)
+ err = registryFileBadTmpl.Execute(&buffer, ep)
+ Expect(err).ToNot(HaveOccurred())
podmanTest.setRegistriesConfigEnv(buffer.Bytes())
- ioutil.WriteFile(fmt.Sprintf("%s/registry6.conf", tempdir), buffer.Bytes(), 0644)
+ err = ioutil.WriteFile(fmt.Sprintf("%s/registry6.conf", tempdir), buffer.Bytes(), 0644)
+ Expect(err).ToNot(HaveOccurred())
if IsRemote() {
podmanTest.RestartRemoteService()
@@ -409,16 +417,19 @@ registries = ['{{.Host}}:{{.Port}}']`
Fail("Cannot start docker registry on port %s", port2)
}
- podmanTest.RestoreArtifact(ALPINE)
+ err = podmanTest.RestoreArtifact(ALPINE)
+ Expect(err).ToNot(HaveOccurred())
push := podmanTest.Podman([]string{"push", "--tls-verify=false", "--remove-signatures", ALPINE, fmt.Sprintf("localhost:%d/my-alpine", port2)})
push.WaitWithDefaultTimeout()
Expect(push).Should(Exit(0))
// registries.conf set up
var buffer bytes.Buffer
- registryFileTwoTmpl.Execute(&buffer, ep3)
+ err = registryFileTwoTmpl.Execute(&buffer, ep3)
+ Expect(err).ToNot(HaveOccurred())
podmanTest.setRegistriesConfigEnv(buffer.Bytes())
- ioutil.WriteFile(fmt.Sprintf("%s/registry8.conf", tempdir), buffer.Bytes(), 0644)
+ err = ioutil.WriteFile(fmt.Sprintf("%s/registry8.conf", tempdir), buffer.Bytes(), 0644)
+ Expect(err).ToNot(HaveOccurred())
if IsRemote() {
podmanTest.RestartRemoteService()
diff --git a/test/e2e/secret_test.go b/test/e2e/secret_test.go
index 90d760c81..ed328d84a 100644
--- a/test/e2e/secret_test.go
+++ b/test/e2e/secret_test.go
@@ -26,7 +26,6 @@ var _ = Describe("Podman secret", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/start_test.go b/test/e2e/start_test.go
index 98943c6fc..73af9d12c 100644
--- a/test/e2e/start_test.go
+++ b/test/e2e/start_test.go
@@ -26,7 +26,6 @@ var _ = Describe("Podman start", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index 7435a0e3b..b43a81cd3 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -32,7 +32,6 @@ var _ = Describe("Podman stats", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index 99d7f278c..8864ba5fd 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -25,7 +25,6 @@ var _ = Describe("Podman stop", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/system_connection_test.go b/test/e2e/system_connection_test.go
index ac4c5e5ea..2228c23b2 100644
--- a/test/e2e/system_connection_test.go
+++ b/test/e2e/system_connection_test.go
@@ -47,7 +47,7 @@ var _ = Describe("podman system connection", func() {
}
f := CurrentGinkgoTestDescription()
- GinkgoWriter.Write(
+ _, _ = GinkgoWriter.Write(
[]byte(
fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())))
})
@@ -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")
})
diff --git a/test/e2e/system_df_test.go b/test/e2e/system_df_test.go
index a9fa5f4ac..ba4a40ab4 100644
--- a/test/e2e/system_df_test.go
+++ b/test/e2e/system_df_test.go
@@ -26,14 +26,13 @@ var _ = Describe("podman system df", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ _, _ = GinkgoWriter.Write([]byte(timedResult))
})
It("podman system df", func() {
diff --git a/test/e2e/system_dial_stdio_test.go b/test/e2e/system_dial_stdio_test.go
index 5fcb20cb8..4e4c99bfe 100644
--- a/test/e2e/system_dial_stdio_test.go
+++ b/test/e2e/system_dial_stdio_test.go
@@ -24,14 +24,13 @@ var _ = Describe("podman system dial-stdio", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ _, _ = GinkgoWriter.Write([]byte(timedResult))
})
It("podman system dial-stdio help", func() {
diff --git a/test/e2e/system_reset_test.go b/test/e2e/system_reset_test.go
index f413ce147..28f2e25ca 100644
--- a/test/e2e/system_reset_test.go
+++ b/test/e2e/system_reset_test.go
@@ -24,14 +24,13 @@ var _ = Describe("podman system reset", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ _, _ = GinkgoWriter.Write([]byte(timedResult))
})
It("podman system reset", func() {
@@ -90,5 +89,12 @@ var _ = Describe("podman system reset", func() {
Expect(session).Should(Exit(0))
// default network should exists
Expect(session.OutputToStringArray()).To(HaveLen(1))
+
+ // TODO: machine tests currently don't run outside of the machine test pkg
+ // no machines are created here to cleanup
+ session = podmanTest.Podman([]string{"machine", "list", "-q"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToStringArray()).To(BeEmpty())
})
})
diff --git a/test/e2e/system_service_test.go b/test/e2e/system_service_test.go
index 2bc7756d6..398290426 100644
--- a/test/e2e/system_service_test.go
+++ b/test/e2e/system_service_test.go
@@ -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()
@@ -122,22 +122,6 @@ var _ = Describe("podman system service", func() {
})
})
-// WaitForService blocks, waiting for some service listening on given host:port
-func WaitForService(address url.URL) {
- // Wait for podman to be ready
- var conn net.Conn
- var err error
- for i := 1; i <= 5; i++ {
- conn, err = net.Dial("tcp", address.Host)
- if err != nil {
- // Podman not available yet...
- time.Sleep(time.Duration(i) * time.Second)
- }
- }
- Expect(err).ShouldNot(HaveOccurred())
- conn.Close()
-}
-
// randomPort leans on the go net library to find an available port...
func randomPort() string {
port, err := utils.GetRandomPort()
diff --git a/test/e2e/systemd_activate_test.go b/test/e2e/systemd_activate_test.go
index 04acafe1b..aeea4f932 100644
--- a/test/e2e/systemd_activate_test.go
+++ b/test/e2e/systemd_activate_test.go
@@ -31,7 +31,6 @@ var _ = Describe("Systemd activate", func() {
podmanTest = PodmanTestCreate(tempDir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/systemd_test.go b/test/e2e/systemd_test.go
index 57fc323ce..a1a080904 100644
--- a/test/e2e/systemd_test.go
+++ b/test/e2e/systemd_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman systemd", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
systemdUnitFile = `[Unit]
Description=redis container
[Service]
diff --git a/test/e2e/toolbox_test.go b/test/e2e/toolbox_test.go
index 1fc28a06d..1e9a6da1f 100644
--- a/test/e2e/toolbox_test.go
+++ b/test/e2e/toolbox_test.go
@@ -56,7 +56,6 @@ var _ = Describe("Toolbox-specific testing", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/top_test.go b/test/e2e/top_test.go
index 344568da5..66bb887dc 100644
--- a/test/e2e/top_test.go
+++ b/test/e2e/top_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman top", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/tree_test.go b/test/e2e/tree_test.go
index ab6e49e88..e1282d2b4 100644
--- a/test/e2e/tree_test.go
+++ b/test/e2e/tree_test.go
@@ -31,7 +31,7 @@ var _ = Describe("Podman image tree", func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ _, _ = GinkgoWriter.Write([]byte(timedResult))
})
It("podman image tree", func() {
diff --git a/test/e2e/trust_test.go b/test/e2e/trust_test.go
index d17e34e9c..eee802e43 100644
--- a/test/e2e/trust_test.go
+++ b/test/e2e/trust_test.go
@@ -28,7 +28,6 @@ var _ = Describe("Podman trust", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
@@ -75,7 +74,8 @@ var _ = Describe("Podman trust", func() {
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(BeValidJSON())
var teststruct []map[string]string
- json.Unmarshal(session.Out.Contents(), &teststruct)
+ err = json.Unmarshal(session.Out.Contents(), &teststruct)
+ Expect(err).ToNot(HaveOccurred())
Expect(teststruct).To(HaveLen(3))
// To ease comparison, group the unordered array of repos by repo (and we expect only one entry by repo, so order within groups doesn’t matter)
repoMap := map[string][]map[string]string{}
diff --git a/test/e2e/unshare_test.go b/test/e2e/unshare_test.go
index 8b06dd4f5..520a2f884 100644
--- a/test/e2e/unshare_test.go
+++ b/test/e2e/unshare_test.go
@@ -32,7 +32,6 @@ var _ = Describe("Podman unshare", func() {
podmanTest.CgroupManager = "cgroupfs"
podmanTest.StorageOptions = ROOTLESS_STORAGE_OPTIONS
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/version_test.go b/test/e2e/version_test.go
index a30db80eb..052b9aa39 100644
--- a/test/e2e/version_test.go
+++ b/test/e2e/version_test.go
@@ -30,7 +30,7 @@ var _ = Describe("Podman version", func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
processTestResult(f)
- podmanTest.SeedImages()
+
})
It("podman version", func() {
diff --git a/test/e2e/volume_create_test.go b/test/e2e/volume_create_test.go
index 0ac91abd3..09e5da8a0 100644
--- a/test/e2e/volume_create_test.go
+++ b/test/e2e/volume_create_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman volume create", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/volume_exists_test.go b/test/e2e/volume_exists_test.go
index fdadbda27..0de574968 100644
--- a/test/e2e/volume_exists_test.go
+++ b/test/e2e/volume_exists_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman volume exists", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/volume_inspect_test.go b/test/e2e/volume_inspect_test.go
index 5e3edfe24..344fe8b05 100644
--- a/test/e2e/volume_inspect_test.go
+++ b/test/e2e/volume_inspect_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman volume inspect", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go
index ce4cfc77d..19f87fb8a 100644
--- a/test/e2e/volume_ls_test.go
+++ b/test/e2e/volume_ls_test.go
@@ -24,7 +24,6 @@ var _ = Describe("Podman volume ls", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/volume_plugin_test.go b/test/e2e/volume_plugin_test.go
index fd205805d..4700afdb5 100644
--- a/test/e2e/volume_plugin_test.go
+++ b/test/e2e/volume_plugin_test.go
@@ -25,11 +25,11 @@ var _ = Describe("Podman volume plugins", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
os.Setenv("CONTAINERS_CONF", "config/containers.conf")
SkipIfRemote("Volume plugins only supported as local")
SkipIfRootless("Root is required for volume plugin testing")
- os.MkdirAll("/run/docker/plugins", 0755)
+ err = os.MkdirAll("/run/docker/plugins", 0755)
+ Expect(err).ToNot(HaveOccurred())
})
AfterEach(func() {
@@ -55,7 +55,8 @@ var _ = Describe("Podman volume plugins", func() {
podmanTest.AddImageToRWStore(volumeTest)
pluginStatePath := filepath.Join(podmanTest.TempDir, "volumes")
- os.Mkdir(pluginStatePath, 0755)
+ err := os.Mkdir(pluginStatePath, 0755)
+ Expect(err).ToNot(HaveOccurred())
// Keep this distinct within tests to avoid multiple tests using the same plugin.
pluginName := "testvol1"
@@ -89,7 +90,8 @@ var _ = Describe("Podman volume plugins", func() {
podmanTest.AddImageToRWStore(volumeTest)
pluginStatePath := filepath.Join(podmanTest.TempDir, "volumes")
- os.Mkdir(pluginStatePath, 0755)
+ err := os.Mkdir(pluginStatePath, 0755)
+ Expect(err).ToNot(HaveOccurred())
// Keep this distinct within tests to avoid multiple tests using the same plugin.
pluginName := "testvol2"
@@ -112,7 +114,8 @@ var _ = Describe("Podman volume plugins", func() {
podmanTest.AddImageToRWStore(volumeTest)
pluginStatePath := filepath.Join(podmanTest.TempDir, "volumes")
- os.Mkdir(pluginStatePath, 0755)
+ err := os.Mkdir(pluginStatePath, 0755)
+ Expect(err).ToNot(HaveOccurred())
// Keep this distinct within tests to avoid multiple tests using the same plugin.
pluginName := "testvol3"
@@ -153,7 +156,8 @@ var _ = Describe("Podman volume plugins", func() {
podmanTest.AddImageToRWStore(volumeTest)
pluginStatePath := filepath.Join(podmanTest.TempDir, "volumes")
- os.Mkdir(pluginStatePath, 0755)
+ err := os.Mkdir(pluginStatePath, 0755)
+ Expect(err).ToNot(HaveOccurred())
// Keep this distinct within tests to avoid multiple tests using the same plugin.
pluginName := "testvol4"
diff --git a/test/e2e/volume_prune_test.go b/test/e2e/volume_prune_test.go
index 0b4c30a48..600f1b887 100644
--- a/test/e2e/volume_prune_test.go
+++ b/test/e2e/volume_prune_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman volume prune", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/volume_rm_test.go b/test/e2e/volume_rm_test.go
index 2a2de0920..0180b7a46 100644
--- a/test/e2e/volume_rm_test.go
+++ b/test/e2e/volume_rm_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman volume rm", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {
diff --git a/test/e2e/wait_test.go b/test/e2e/wait_test.go
index 098780c70..16e876af9 100644
--- a/test/e2e/wait_test.go
+++ b/test/e2e/wait_test.go
@@ -23,7 +23,6 @@ var _ = Describe("Podman wait", func() {
}
podmanTest = PodmanTestCreate(tempdir)
podmanTest.Setup()
- podmanTest.SeedImages()
})
AfterEach(func() {