diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/apiv2/20-containers.at | 4 | ||||
-rw-r--r-- | test/apiv2/python/rest_api/fixtures/podman.py | 4 | ||||
-rw-r--r-- | test/e2e/common_test.go | 10 | ||||
-rw-r--r-- | test/e2e/config_amd64.go | 16 | ||||
-rw-r--r-- | test/e2e/exec_test.go | 2 | ||||
-rw-r--r-- | test/e2e/generate_kube_test.go | 2 | ||||
-rw-r--r-- | test/e2e/mount_rootless_test.go | 2 | ||||
-rw-r--r-- | test/e2e/network_test.go | 2 | ||||
-rw-r--r-- | test/system/005-info.bats | 8 | ||||
-rw-r--r-- | test/system/270-socket-activation.bats | 2 | ||||
-rw-r--r-- | test/system/450-interactive.bats | 2 | ||||
-rw-r--r-- | test/system/500-networking.bats | 7 | ||||
-rw-r--r-- | test/system/helpers.bash | 4 | ||||
-rw-r--r-- | test/testvol/main.go | 2 | ||||
-rw-r--r-- | test/utils/matchers.go | 2 | ||||
-rw-r--r-- | test/utils/utils.go | 6 |
16 files changed, 42 insertions, 33 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index 2d5754077..7a38dfea0 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -321,7 +321,11 @@ t GET containers/json?filters='garb1age}' 500 \ t GET containers/json?filters='{"label":["testl' 500 \ .cause="unexpected end of JSON input" + #libpod api list containers sanity checks +t GET libpod/containers/json?filters='{"status":["removing"]}' 200 length=0 +t GET libpod/containers/json?filters='{"status":["bogus"]}' 500 \ + .cause="invalid argument" t GET libpod/containers/json?filters='garb1age}' 500 \ .cause="invalid character 'g' looking for beginning of value" t GET libpod/containers/json?filters='{"label":["testl' 500 \ diff --git a/test/apiv2/python/rest_api/fixtures/podman.py b/test/apiv2/python/rest_api/fixtures/podman.py index c700571b9..f2db6f498 100644 --- a/test/apiv2/python/rest_api/fixtures/podman.py +++ b/test/apiv2/python/rest_api/fixtures/podman.py @@ -20,10 +20,6 @@ class Podman: cgroupfs = os.getenv("CGROUP_MANAGER", "systemd") self.cmd.append(f"--cgroup-manager={cgroupfs}") - if os.getenv("DEBUG"): - self.cmd.append("--log-level=debug") - self.cmd.append("--syslog=true") - self.anchor_directory = tempfile.mkdtemp(prefix="podman_restapi_") self.cmd.append("--root=" + os.path.join(self.anchor_directory, "crio")) self.cmd.append("--runroot=" + os.path.join(self.anchor_directory, "crio-run")) diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index c5cdd2c1d..766f39964 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -35,12 +35,12 @@ import ( var ( //lint:ignore ST1003 - PODMAN_BINARY string //nolint:golint,stylecheck - INTEGRATION_ROOT string //nolint:golint,stylecheck - CGROUP_MANAGER = "systemd" //nolint:golint,stylecheck - RESTORE_IMAGES = []string{ALPINE, BB, nginx} //nolint:golint,stylecheck + PODMAN_BINARY string //nolint:revive,stylecheck + INTEGRATION_ROOT string //nolint:revive,stylecheck + CGROUP_MANAGER = "systemd" //nolint:revive,stylecheck + RESTORE_IMAGES = []string{ALPINE, BB, nginx} //nolint:revive,stylecheck defaultWaitTimeout = 90 - CGROUPSV2, _ = cgroups.IsCgroup2UnifiedMode() //nolint:golint,stylecheck + CGROUPSV2, _ = cgroups.IsCgroup2UnifiedMode() //nolint:revive,stylecheck ) // PodmanTestIntegration struct for command line options diff --git a/test/e2e/config_amd64.go b/test/e2e/config_amd64.go index 9293fdd44..c4cb97b2e 100644 --- a/test/e2e/config_amd64.go +++ b/test/e2e/config_amd64.go @@ -1,16 +1,16 @@ package integration var ( - STORAGE_FS = "vfs" //nolint:golint,stylecheck - STORAGE_OPTIONS = "--storage-driver vfs" //nolint:golint,stylecheck - ROOTLESS_STORAGE_FS = "vfs" //nolint:golint,stylecheck - ROOTLESS_STORAGE_OPTIONS = "--storage-driver vfs" //nolint:golint,stylecheck - CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry, infra, labels, healthcheck, UBI_INIT, UBI_MINIMAL, fedoraToolbox} //nolint:golint,stylecheck + STORAGE_FS = "vfs" //nolint:revive,stylecheck + STORAGE_OPTIONS = "--storage-driver vfs" //nolint:revive,stylecheck + ROOTLESS_STORAGE_FS = "vfs" //nolint:revive,stylecheck + ROOTLESS_STORAGE_OPTIONS = "--storage-driver vfs" //nolint:revive,stylecheck + CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, nginx, redis, registry, infra, labels, healthcheck, UBI_INIT, UBI_MINIMAL, fedoraToolbox} //nolint:revive,stylecheck nginx = "quay.io/libpod/alpine_nginx:latest" - BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:golint,stylecheck + BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck registry = "quay.io/libpod/registry:2.6" labels = "quay.io/libpod/alpine_labels:latest" - UBI_MINIMAL = "registry.access.redhat.com/ubi8-minimal" //nolint:golint,stylecheck - UBI_INIT = "registry.access.redhat.com/ubi8-init" //nolint:golint,stylecheck + UBI_MINIMAL = "registry.access.redhat.com/ubi8-minimal" //nolint:revive,stylecheck + UBI_INIT = "registry.access.redhat.com/ubi8-init" //nolint:revive,stylecheck cirros = "quay.io/libpod/cirros:latest" ) diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index 4cfaa9a2e..3987746d0 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -123,7 +123,7 @@ var _ = Describe("Podman exec", func() { }) It("podman exec in keep-id container drops privileges", func() { - SkipIfNotRootless("This function is not enabled for rootfull podman") + SkipIfNotRootless("This function is not enabled for rootful podman") ctrName := "testctr1" testCtr := podmanTest.Podman([]string{"run", "-d", "--name", ctrName, "--userns=keep-id", ALPINE, "top"}) testCtr.WaitWithDefaultTimeout() diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index 44c906eed..9c99c3d93 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -71,7 +71,7 @@ var _ = Describe("Podman generate kube", func() { Expect(pod.Spec.DNSConfig).To(BeNil()) Expect(pod.Spec.Containers[0].WorkingDir).To(Equal("")) Expect(pod.Spec.Containers[0].Env).To(BeNil()) - Expect(pod.Name).To(Equal("top_pod")) + Expect(pod.Name).To(Equal("top-pod")) numContainers := 0 for range pod.Spec.Containers { diff --git a/test/e2e/mount_rootless_test.go b/test/e2e/mount_rootless_test.go index 830c2dcda..30d7ce8a9 100644 --- a/test/e2e/mount_rootless_test.go +++ b/test/e2e/mount_rootless_test.go @@ -17,7 +17,7 @@ var _ = Describe("Podman mount", func() { ) BeforeEach(func() { - SkipIfNotRootless("This function is not enabled for rootfull podman") + SkipIfNotRootless("This function is not enabled for rootful podman") SkipIfRemote("Podman mount not supported for remote connections") tempdir, err = CreateTempDirInTempDir() if err != nil { diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go index a7981a4d8..89a9005f5 100644 --- a/test/e2e/network_test.go +++ b/test/e2e/network_test.go @@ -254,7 +254,7 @@ var _ = Describe("Podman network", func() { expectedNetworks := []string{name} if !rootless.IsRootless() { - // rootfull image contains "podman/cni/87-podman-bridge.conflist" for "podman" network + // rootful image contains "podman/cni/87-podman-bridge.conflist" for "podman" network expectedNetworks = append(expectedNetworks, "podman") } session := podmanTest.Podman(append([]string{"network", "inspect"}, expectedNetworks...)) diff --git a/test/system/005-info.bats b/test/system/005-info.bats index 1d84ede9b..333553b07 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -107,4 +107,12 @@ host.slirp4netns.executable | $expr_path fi } +@test "podman --root PATH --volumepath info - basic output" { + volumePath=${PODMAN_TMPDIR}/volumesGoHere + if ! is_remote; then + run_podman --storage-driver=vfs --root ${PODMAN_TMPDIR}/nothing-here-move-along --volumepath ${volumePath} info --format '{{ .Store.VolumePath }}' + is "$output" "${volumePath}" "'podman --volumepath should reset VolumePath" + fi +} + # vim: filetype=sh diff --git a/test/system/270-socket-activation.bats b/test/system/270-socket-activation.bats index 19f68abdd..6d582be18 100644 --- a/test/system/270-socket-activation.bats +++ b/test/system/270-socket-activation.bats @@ -90,7 +90,7 @@ function teardown() { @test "podman system service - socket activation - kill rootless pause" { if ! is_rootless; then - skip "there is no pause process when running rootfull" + skip "there is no pause process when running rootful" fi run_podman run -d $IMAGE sleep 90 cid="$output" diff --git a/test/system/450-interactive.bats b/test/system/450-interactive.bats index a642a2e95..e6e67a8a7 100644 --- a/test/system/450-interactive.bats +++ b/test/system/450-interactive.bats @@ -75,7 +75,7 @@ function teardown() { @test "podman load - will not read from tty" { run_podman 125 load <$PODMAN_TEST_PTY is "$output" \ - "Error: cannot read from terminal. Use command-line redirection or the --input flag." \ + "Error: cannot read from terminal, use command-line redirection or the --input flag" \ "Diagnostic from 'podman load' without redirection or -i" } diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index 0c3062a7e..01571d176 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -83,8 +83,7 @@ load helpers } # Issue #5466 - port-forwarding doesn't work with this option and -d -@test "podman networking: port with --userns=keep-id" { - skip_if_not_rootless "--userns=keep-id only works in rootless mode" +@test "podman networking: port with --userns=keep-id for rootless or --uidmap=* for rootful" { for cidr in "" "$(random_rfc1918_subnet).0/24"; do myport=$(random_free_port 52000-52999) if [[ -z $cidr ]]; then @@ -106,7 +105,9 @@ load helpers # remote IP is not 127.0.0.1 (podman PR #9052). # We could get more parseable output by using $NCAT_REMOTE_ADDR, # but busybox nc doesn't support that. - run_podman run -d --userns=keep-id $network_arg -p 127.0.0.1:$myport:$myport \ + userns="--userns=keep-id" + is_rootless || userns="--uidmap=0:1111111:65536 --gidmap=0:1111111:65536" + run_podman run -d ${userns} $network_arg -p 127.0.0.1:$myport:$myport \ $IMAGE nc -l -n -v -p $myport cid="$output" diff --git a/test/system/helpers.bash b/test/system/helpers.bash index 1a1dc0df9..138d668f4 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -423,7 +423,7 @@ function skip_if_rootless() { ###################### function skip_if_not_rootless() { if ! is_rootless; then - local msg=$(_add_label_if_missing "$1" "rootfull") + local msg=$(_add_label_if_missing "$1" "rootful") skip "${msg:-not applicable under rootlfull podman}" fi } @@ -483,7 +483,7 @@ function skip_if_root_ubuntu { if is_ubuntu; then if ! is_remote; then if ! is_rootless; then - skip "Cannot run this test on rootfull ubuntu, usually due to user errors" + skip "Cannot run this test on rootful ubuntu, usually due to user errors" fi fi fi diff --git a/test/testvol/main.go b/test/testvol/main.go index 00b462eb2..30ab365b3 100644 --- a/test/testvol/main.go +++ b/test/testvol/main.go @@ -31,7 +31,7 @@ type cliConfig struct { } // Default configuration is stored here. Will be overwritten by flags. -var config cliConfig = cliConfig{ +var config = cliConfig{ logLevel: "error", sockName: "test-volume-plugin", } diff --git a/test/utils/matchers.go b/test/utils/matchers.go index 0c0948e4b..c56bd55c3 100644 --- a/test/utils/matchers.go +++ b/test/utils/matchers.go @@ -6,7 +6,7 @@ import ( "net/url" "github.com/containers/common/pkg/config" - . "github.com/onsi/gomega" //nolint:golint,stylecheck + . "github.com/onsi/gomega" //nolint:revive,stylecheck "github.com/onsi/gomega/format" "github.com/onsi/gomega/gexec" "github.com/onsi/gomega/matchers" diff --git a/test/utils/utils.go b/test/utils/utils.go index 9695835e5..0867570c1 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -15,9 +15,9 @@ import ( "github.com/sirupsen/logrus" "github.com/containers/storage/pkg/parsers/kernel" - . "github.com/onsi/ginkgo" //nolint:golint,stylecheck - . "github.com/onsi/gomega" //nolint:golint,stylecheck - . "github.com/onsi/gomega/gexec" //nolint:golint,stylecheck + . "github.com/onsi/ginkgo" //nolint:revive,stylecheck + . "github.com/onsi/gomega" //nolint:revive,stylecheck + . "github.com/onsi/gomega/gexec" //nolint:revive,stylecheck ) type NetworkBackend int |