mirror of
https://github.com/containers/podman.git
synced 2025-06-30 07:26:39 +08:00
Merge pull request #22207 from edsantiago/e2e-var-tmp
e2e tests: use /var/tmp, not $TMPDIR, as workdirs
This commit is contained in:
@ -33,7 +33,7 @@ env:
|
|||||||
DEBIAN_NAME: "debian-13"
|
DEBIAN_NAME: "debian-13"
|
||||||
|
|
||||||
# Image identifiers
|
# Image identifiers
|
||||||
IMAGE_SUFFIX: "c20240409t192511z-f39f38d13"
|
IMAGE_SUFFIX: "c20240411t124913z-f39f38d13"
|
||||||
|
|
||||||
# EC2 images
|
# EC2 images
|
||||||
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
|
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
|
||||||
|
@ -143,7 +143,7 @@ exec_container() {
|
|||||||
set -x
|
set -x
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
exec bin/podman run --rm --privileged --net=host --cgroupns=host \
|
exec bin/podman run --rm --privileged --net=host --cgroupns=host \
|
||||||
-v `mktemp -d -p /var/tmp`:/tmp:Z \
|
-v `mktemp -d -p /var/tmp`:/var/tmp:Z \
|
||||||
-v /dev/fuse:/dev/fuse \
|
-v /dev/fuse:/dev/fuse \
|
||||||
-v "$GOPATH:$GOPATH:Z" \
|
-v "$GOPATH:$GOPATH:Z" \
|
||||||
--workdir "$GOSRC" \
|
--workdir "$GOSRC" \
|
||||||
|
@ -62,6 +62,7 @@ type PodmanTestIntegration struct {
|
|||||||
TmpDir string
|
TmpDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var GlobalTmpDir string // Single top-level tmpdir for all tests
|
||||||
var LockTmpDir string
|
var LockTmpDir string
|
||||||
|
|
||||||
// PodmanSessionIntegration struct for command line session
|
// PodmanSessionIntegration struct for command line session
|
||||||
@ -101,14 +102,14 @@ func TestLibpod(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
tempdir string
|
tempdir string // Working dir for _one_ subtest
|
||||||
err error
|
err error
|
||||||
podmanTest *PodmanTestIntegration
|
podmanTest *PodmanTestIntegration
|
||||||
safeIPOctets [2]uint8
|
safeIPOctets [2]uint8
|
||||||
timingsFile *os.File
|
timingsFile *os.File
|
||||||
|
|
||||||
_ = BeforeEach(func() {
|
_ = BeforeEach(func() {
|
||||||
tempdir, err = CreateTempDirInTempDir()
|
tempdir, err = os.MkdirTemp(GlobalTmpDir, "subtest-")
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
podmanTest = PodmanTestCreate(tempdir)
|
podmanTest = PodmanTestCreate(tempdir)
|
||||||
podmanTest.Setup()
|
podmanTest.Setup()
|
||||||
@ -130,26 +131,34 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// lockdir - do not use directly use LockTmpDir
|
// lockdir - do not use directly; use LockTmpDir
|
||||||
lockdir = "libpodlock"
|
lockdir = "libpodlock"
|
||||||
// imageCacheDir - do not use directly use ImageCacheDir
|
// imageCacheDir - do not use directly use ImageCacheDir
|
||||||
imageCacheDir = "imagecachedir"
|
imageCacheDir = "imagecachedir"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = SynchronizedBeforeSuite(func() []byte {
|
var _ = SynchronizedBeforeSuite(func() []byte {
|
||||||
globalTmpDir := GinkgoT().TempDir()
|
// One global scratch directory under which all test files will live.
|
||||||
|
// The usual case is that these tests are running in CI, on VMs
|
||||||
|
// with limited RAM, so we use /var/tmp.
|
||||||
|
baseTmpDir := "/var/tmp"
|
||||||
|
if os.Getenv("CI") == "" {
|
||||||
|
// Almost certainly a manual run, e.g., a developer with
|
||||||
|
// a hotrod workstation. Assume they know what they're doing.
|
||||||
|
baseTmpDir = ""
|
||||||
|
}
|
||||||
|
globalTmpDir, err := os.MkdirTemp(baseTmpDir, "podman-e2e-")
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
// make cache dir
|
// make cache dir
|
||||||
ImageCacheDir = filepath.Join(globalTmpDir, imageCacheDir)
|
ImageCacheDir = filepath.Join(globalTmpDir, imageCacheDir)
|
||||||
if err := os.MkdirAll(ImageCacheDir, 0700); err != nil {
|
err = os.MkdirAll(ImageCacheDir, 0700)
|
||||||
GinkgoWriter.Printf("%q\n", err)
|
Expect(err).ToNot(HaveOccurred())
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cache images
|
// Cache images
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
INTEGRATION_ROOT = filepath.Join(cwd, "../../")
|
INTEGRATION_ROOT = filepath.Join(cwd, "../../")
|
||||||
podman := PodmanTestSetup(GinkgoT().TempDir())
|
podman := PodmanTestSetup(filepath.Join(globalTmpDir, "image-init"))
|
||||||
|
|
||||||
// Pull cirros but don't put it into the cache
|
// Pull cirros but don't put it into the cache
|
||||||
pullImages := []string{CIRROS_IMAGE, fedoraToolbox, volumeTest}
|
pullImages := []string{CIRROS_IMAGE, fedoraToolbox, volumeTest}
|
||||||
@ -177,16 +186,16 @@ var _ = SynchronizedBeforeSuite(func() []byte {
|
|||||||
podman.StopRemoteService()
|
podman.StopRemoteService()
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove temporary podman files, images are now cached in ImageCacheDir
|
// remove temporary podman files; images are now cached in ImageCacheDir
|
||||||
rmAll(podman.PodmanBinary, podman.TempDir)
|
rmAll(podman.PodmanBinary, podman.TempDir)
|
||||||
|
|
||||||
return []byte(globalTmpDir)
|
return []byte(globalTmpDir)
|
||||||
}, func(data []byte) {
|
}, func(data []byte) {
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
INTEGRATION_ROOT = filepath.Join(cwd, "../../")
|
INTEGRATION_ROOT = filepath.Join(cwd, "../../")
|
||||||
globalTmpDir := string(data)
|
GlobalTmpDir = string(data)
|
||||||
ImageCacheDir = filepath.Join(globalTmpDir, imageCacheDir)
|
ImageCacheDir = filepath.Join(GlobalTmpDir, imageCacheDir)
|
||||||
LockTmpDir = filepath.Join(globalTmpDir, lockdir)
|
LockTmpDir = filepath.Join(GlobalTmpDir, lockdir)
|
||||||
|
|
||||||
timingsFile, err = os.Create(fmt.Sprintf("%s/timings-%d", LockTmpDir, GinkgoParallelProcess()))
|
timingsFile, err = os.Create(fmt.Sprintf("%s/timings-%d", LockTmpDir, GinkgoParallelProcess()))
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
@ -229,7 +238,7 @@ var _ = SynchronizedAfterSuite(func() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
rmAll(getPodmanBinary(cwd), ImageCacheDir)
|
rmAll(getPodmanBinary(cwd), GlobalTmpDir)
|
||||||
})
|
})
|
||||||
|
|
||||||
func getPodmanBinary(cwd string) string {
|
func getPodmanBinary(cwd string) string {
|
||||||
@ -242,40 +251,38 @@ func getPodmanBinary(cwd string) string {
|
|||||||
|
|
||||||
// PodmanTestCreate creates a PodmanTestIntegration instance for the tests
|
// PodmanTestCreate creates a PodmanTestIntegration instance for the tests
|
||||||
func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
|
func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
|
||||||
var podmanRemoteBinary string
|
|
||||||
|
|
||||||
host := GetHostDistributionInfo()
|
host := GetHostDistributionInfo()
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
|
|
||||||
root := filepath.Join(tempDir, "root")
|
root := filepath.Join(tempDir, "root")
|
||||||
podmanBinary := getPodmanBinary(cwd)
|
podmanBinary := getPodmanBinary(cwd)
|
||||||
|
|
||||||
podmanRemoteBinary = filepath.Join(cwd, "../../bin/podman-remote")
|
podmanRemoteBinary := os.Getenv("PODMAN_REMOTE_BINARY")
|
||||||
if os.Getenv("PODMAN_REMOTE_BINARY") != "" {
|
if podmanRemoteBinary == "" {
|
||||||
podmanRemoteBinary = os.Getenv("PODMAN_REMOTE_BINARY")
|
podmanRemoteBinary = filepath.Join(cwd, "../../bin/podman-remote")
|
||||||
}
|
}
|
||||||
|
|
||||||
quadletBinary := filepath.Join(cwd, "../../bin/quadlet")
|
quadletBinary := os.Getenv("QUADLET_BINARY")
|
||||||
if os.Getenv("QUADLET_BINARY") != "" {
|
if quadletBinary == "" {
|
||||||
quadletBinary = os.Getenv("QUADLET_BINARY")
|
quadletBinary = filepath.Join(cwd, "../../bin/quadlet")
|
||||||
}
|
}
|
||||||
|
|
||||||
conmonBinary := "/usr/libexec/podman/conmon"
|
conmonBinary := os.Getenv("CONMON_BINARY")
|
||||||
altConmonBinary := "/usr/bin/conmon"
|
if conmonBinary == "" {
|
||||||
if _, err := os.Stat(conmonBinary); os.IsNotExist(err) {
|
conmonBinary = "/usr/libexec/podman/conmon"
|
||||||
conmonBinary = altConmonBinary
|
if _, err := os.Stat(conmonBinary); errors.Is(err, os.ErrNotExist) {
|
||||||
}
|
conmonBinary = "/usr/bin/conmon"
|
||||||
if os.Getenv("CONMON_BINARY") != "" {
|
}
|
||||||
conmonBinary = os.Getenv("CONMON_BINARY")
|
|
||||||
}
|
|
||||||
storageOptions := STORAGE_OPTIONS
|
|
||||||
if os.Getenv("STORAGE_OPTIONS") != "" {
|
|
||||||
storageOptions = os.Getenv("STORAGE_OPTIONS")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cgroupManager := CGROUP_MANAGER
|
storageOptions := os.Getenv("STORAGE_OPTIONS")
|
||||||
if os.Getenv("CGROUP_MANAGER") != "" {
|
if storageOptions == "" {
|
||||||
cgroupManager = os.Getenv("CGROUP_MANAGER")
|
storageOptions = STORAGE_OPTIONS
|
||||||
|
}
|
||||||
|
|
||||||
|
cgroupManager := os.Getenv("CGROUP_MANAGER")
|
||||||
|
if cgroupManager == "" {
|
||||||
|
cgroupManager = CGROUP_MANAGER
|
||||||
}
|
}
|
||||||
|
|
||||||
ociRuntime := os.Getenv("OCI_RUNTIME")
|
ociRuntime := os.Getenv("OCI_RUNTIME")
|
||||||
@ -390,10 +397,8 @@ func (p PodmanTestIntegration) AddImageToRWStore(image string) {
|
|||||||
func imageTarPath(image string) string {
|
func imageTarPath(image string) string {
|
||||||
cacheDir := os.Getenv("PODMAN_TEST_IMAGE_CACHE_DIR")
|
cacheDir := os.Getenv("PODMAN_TEST_IMAGE_CACHE_DIR")
|
||||||
if cacheDir == "" {
|
if cacheDir == "" {
|
||||||
cacheDir = os.Getenv("TMPDIR")
|
// Avoid /tmp: it may be tmpfs, and these images are large
|
||||||
if cacheDir == "" {
|
cacheDir = "/var/tmp"
|
||||||
cacheDir = "/tmp"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// e.g., registry.com/fubar:latest -> registry.com-fubar-latest.tar
|
// e.g., registry.com/fubar:latest -> registry.com-fubar-latest.tar
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
## assert-podman-args "kube"
|
## assert-podman-args "kube"
|
||||||
## assert-podman-args "play"
|
## assert-podman-args "play"
|
||||||
## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
## assert-podman-final-args-regex .*/podman-e2e-.*/subtest-.*/quadlet/deployment.yml
|
||||||
## assert-podman-args "--replace"
|
## assert-podman-args "--replace"
|
||||||
## assert-podman-args "--service-container=true"
|
## assert-podman-args "--service-container=true"
|
||||||
## assert-podman-stop-post-args "kube"
|
## assert-podman-stop-post-args "kube"
|
||||||
## assert-podman-stop-post-args "down"
|
## assert-podman-stop-post-args "down"
|
||||||
## assert-podman-stop-post-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
## assert-podman-stop-post-final-args-regex .*/podman-e2e-.*/subtest-.*/quadlet/deployment.yml
|
||||||
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
||||||
## assert-key-is "Service" "KillMode" "mixed"
|
## assert-key-is "Service" "KillMode" "mixed"
|
||||||
## assert-key-is "Service" "Type" "notify"
|
## assert-key-is "Service" "Type" "notify"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
## assert-podman-args "--configmap" "/opt/k8s/abs.yml"
|
## assert-podman-args "--configmap" "/opt/k8s/abs.yml"
|
||||||
## assert-podman-args-regex "--configmap" ".*/podman_test.*/quadlet/rel.yml"
|
## assert-podman-args-regex "--configmap" ".*/podman-e2e-.*/subtest-.*/quadlet/rel.yml"
|
||||||
|
|
||||||
[Kube]
|
[Kube]
|
||||||
Yaml=deployment.yml
|
Yaml=deployment.yml
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## assert-podman-stop-post-args "kube"
|
## assert-podman-stop-post-args "kube"
|
||||||
## assert-podman-stop-post-args "down"
|
## assert-podman-stop-post-args "down"
|
||||||
## assert-podman-stop-post-args "--force"
|
## assert-podman-stop-post-args "--force"
|
||||||
## assert-podman-stop-post-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
## assert-podman-stop-post-final-args-regex .*/podman-e2e-.*/subtest-.*/quadlet/deployment.yml
|
||||||
|
|
||||||
[Kube]
|
[Kube]
|
||||||
Yaml=deployment.yml
|
Yaml=deployment.yml
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## assert-podman-final-args localhost/imagename
|
## assert-podman-final-args localhost/imagename
|
||||||
## assert-podman-args --env-file /opt/env/abs-1
|
## assert-podman-args --env-file /opt/env/abs-1
|
||||||
## assert-podman-args --env-file /opt/env/abs-2
|
## assert-podman-args --env-file /opt/env/abs-2
|
||||||
## assert-podman-args-regex --env-file /.*/podman_test.*/quadlet/rel-1
|
## assert-podman-args-regex --env-file /.*/podman-e2e-.*/subtest-.*/quadlet/rel-1
|
||||||
## assert-podman-args --env-file %h/env
|
## assert-podman-args --env-file %h/env
|
||||||
|
|
||||||
[Container]
|
[Container]
|
||||||
|
@ -18,11 +18,11 @@ Mount=type=tmpfs,tmpfs-size=512M,destination=/path/in/container
|
|||||||
Mount=type=image,source=fedora,destination=/fedora-image,rw=true
|
Mount=type=image,source=fedora,destination=/fedora-image,rw=true
|
||||||
## assert-podman-args-key-val "--mount" "," "type=devpts,destination=/dev/pts"
|
## assert-podman-args-key-val "--mount" "," "type=devpts,destination=/dev/pts"
|
||||||
Mount=type=devpts,destination=/dev/pts
|
Mount=type=devpts,destination=/dev/pts
|
||||||
## assert-podman-args-key-val-regex "--mount" "," "type=bind,source=.*/podman_test.*/quadlet/path/on/host,destination=/path/in/container"
|
## assert-podman-args-key-val-regex "--mount" "," "type=bind,source=.*/podman-e2e-.*/subtest-.*/quadlet/path/on/host,destination=/path/in/container"
|
||||||
Mount=type=bind,source=./path/on/host,destination=/path/in/container
|
Mount=type=bind,source=./path/on/host,destination=/path/in/container
|
||||||
## assert-podman-args-key-val "--mount" "," "type=volume,source=vol1,destination=/path/in/container,ro"
|
## assert-podman-args-key-val "--mount" "," "type=volume,source=vol1,destination=/path/in/container,ro"
|
||||||
Mount=type=volume,source=vol1,destination=/path/in/container,ro
|
Mount=type=volume,source=vol1,destination=/path/in/container,ro
|
||||||
## assert-podman-args-key-val "--mount" "," "type=bind,source=/tmp,\"dst=/path,1\""
|
## assert-podman-args-key-val "--mount" "," "type=bind,source=/tmp,\"dst=/path,1\""
|
||||||
Mount=type=bind,src=/tmp,\"dst=/path,1\"
|
Mount=type=bind,src=/tmp,\"dst=/path,1\"
|
||||||
## assert-podman-args-key-val-regex "--mount" "," "type=bind,source=.*/podman_test.*/quadlet/src,destination=/dst/,idmap=uids=12-34-1;gids=56-78-1"
|
## assert-podman-args-key-val-regex "--mount" "," "type=bind,source=.*/podman-e2e-.*/subtest-.*/quadlet/src,destination=/dst/,idmap=uids=12-34-1;gids=56-78-1"
|
||||||
Mount=type=bind,source=./src/,destination=/dst/,idmap=uids=12-34-1;gids=56-78-1
|
Mount=type=bind,source=./src/,destination=/dst/,idmap=uids=12-34-1;gids=56-78-1
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
## assert-podman-args "kube"
|
## assert-podman-args "kube"
|
||||||
## assert-podman-args "play"
|
## assert-podman-args "play"
|
||||||
## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
## assert-podman-final-args-regex .*/podman-e2e-.*/subtest-.*/quadlet/deployment.yml
|
||||||
## assert-podman-args "--replace"
|
## assert-podman-args "--replace"
|
||||||
## assert-podman-args "--service-container=true"
|
## assert-podman-args "--service-container=true"
|
||||||
## assert-podman-stop-post-args "kube"
|
## assert-podman-stop-post-args "kube"
|
||||||
## assert-podman-stop-post-args "down"
|
## assert-podman-stop-post-args "down"
|
||||||
## assert-podman-stop-post-final-args-regex .*/podman_test.*/quadlet/deployment.yml
|
## assert-podman-stop-post-final-args-regex .*/podman-e2e-.*/subtest-.*/quadlet/deployment.yml
|
||||||
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
||||||
## assert-key-is "Service" "KillMode" "mixed"
|
## assert-key-is "Service" "KillMode" "mixed"
|
||||||
## assert-key-is "Service" "Type" "oneshot"
|
## assert-key-is "Service" "Type" "oneshot"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
## assert-podman-args -v /host/dir:/container/volume
|
## assert-podman-args -v /host/dir:/container/volume
|
||||||
## assert-podman-args -v /host/dir2:/container/volume2:Z
|
## assert-podman-args -v /host/dir2:/container/volume2:Z
|
||||||
## assert-podman-args-regex -v .*/podman_test.*/quadlet/host/dir3:/container/volume3
|
## assert-podman-args-regex -v .*/podman-e2e-.*/subtest-.*/quadlet/host/dir3:/container/volume3
|
||||||
## assert-podman-args -v named:/container/named
|
## assert-podman-args -v named:/container/named
|
||||||
## assert-podman-args -v systemd-quadlet:/container/quadlet
|
## assert-podman-args -v systemd-quadlet:/container/quadlet
|
||||||
## assert-podman-args -v %h/container:/container/volume4
|
## assert-podman-args -v %h/container:/container/volume4
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
## assert-podman-pre-args -v /host/dir:/container/volume
|
## assert-podman-pre-args -v /host/dir:/container/volume
|
||||||
## assert-podman-pre-args -v /host/dir2:/container/volume2:Z
|
## assert-podman-pre-args -v /host/dir2:/container/volume2:Z
|
||||||
## assert-podman-pre-args-regex -v .*/podman_test.*/quadlet/host/dir3:/container/volume3
|
## assert-podman-pre-args-regex -v .*/podman-e2e-.*/subtest-.*/quadlet/host/dir3:/container/volume3
|
||||||
## assert-podman-pre-args -v named:/container/named
|
## assert-podman-pre-args -v named:/container/named
|
||||||
## assert-podman-pre-args -v systemd-quadlet:/container/quadlet
|
## assert-podman-pre-args -v systemd-quadlet:/container/quadlet
|
||||||
## assert-podman-pre-args -v %h/container:/container/volume4
|
## assert-podman-pre-args -v %h/container:/container/volume4
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## assert-key-is-regex "Service" "WorkingDirectory" ".*/podman_test.*/quadlet"
|
## assert-key-is-regex "Service" "WorkingDirectory" ".*/podman-e2e-.*/subtest-.*/quadlet"
|
||||||
|
|
||||||
[Kube]
|
[Kube]
|
||||||
Yaml=deployment.yml
|
Yaml=deployment.yml
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## assert-key-is-regex "Service" "WorkingDirectory" ".*/podman_test.*/quadlet/myservice"
|
## assert-key-is-regex "Service" "WorkingDirectory" ".*/podman-e2e-.*/subtest-.*/quadlet/myservice"
|
||||||
|
|
||||||
[Kube]
|
[Kube]
|
||||||
Yaml=./myservice/deployment.yml
|
Yaml=./myservice/deployment.yml
|
||||||
|
@ -695,12 +695,12 @@ BOGUS=foo
|
|||||||
"---basic.service---",
|
"---basic.service---",
|
||||||
"## assert-podman-args \"kube\"",
|
"## assert-podman-args \"kube\"",
|
||||||
"## assert-podman-args \"play\"",
|
"## assert-podman-args \"play\"",
|
||||||
"## assert-podman-final-args-regex .*/podman_test.*/quadlet/deployment.yml",
|
"## assert-podman-final-args-regex .*/podman-e2e-.*/subtest-.*/quadlet/deployment.yml",
|
||||||
"## assert-podman-args \"--replace\"",
|
"## assert-podman-args \"--replace\"",
|
||||||
"## assert-podman-args \"--service-container=true\"",
|
"## assert-podman-args \"--service-container=true\"",
|
||||||
"## assert-podman-stop-post-args \"kube\"",
|
"## assert-podman-stop-post-args \"kube\"",
|
||||||
"## assert-podman-stop-post-args \"down\"",
|
"## assert-podman-stop-post-args \"down\"",
|
||||||
"## assert-podman-stop-post-final-args-regex .*/podman_test.*/quadlet/deployment.yml",
|
"## assert-podman-stop-post-final-args-regex .*/podman-e2e-.*/subtest-.*/quadlet/deployment.yml",
|
||||||
"## assert-key-is \"Unit\" \"RequiresMountsFor\" \"%t/containers\"",
|
"## assert-key-is \"Unit\" \"RequiresMountsFor\" \"%t/containers\"",
|
||||||
"## assert-key-is \"Service\" \"KillMode\" \"mixed\"",
|
"## assert-key-is \"Service\" \"KillMode\" \"mixed\"",
|
||||||
"## assert-key-is \"Service\" \"Type\" \"notify\"",
|
"## assert-key-is \"Service\" \"Type\" \"notify\"",
|
||||||
|
@ -532,14 +532,6 @@ EXPOSE 2004-2005/tcp`, ALPINE)
|
|||||||
Expect(session.OutputToString()).To(Equal(sysctlValue))
|
Expect(session.OutputToString()).To(Equal(sysctlValue))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman run network expose host port 18082 to container port 8000 using slirp4netns port handler", func() {
|
|
||||||
session := podmanTest.Podman([]string{"run", "--network", "slirp4netns:port_handler=slirp4netns", "-dt", "-p", "18082:8000", ALPINE, "/bin/sh"})
|
|
||||||
session.Wait(30)
|
|
||||||
Expect(session).Should(ExitCleanly())
|
|
||||||
ncBusy := SystemExec("nc", []string{"-l", "-p", "18082"})
|
|
||||||
Expect(ncBusy).To(ExitWithError())
|
|
||||||
})
|
|
||||||
|
|
||||||
It("podman run network expose host port 8080 to container port 8000 using invalid port handler", func() {
|
It("podman run network expose host port 8080 to container port 8000 using invalid port handler", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--network", "slirp4netns:port_handler=invalid", "-dt", "-p", "8080:8000", ALPINE, "/bin/sh"})
|
session := podmanTest.Podman([]string{"run", "--network", "slirp4netns:port_handler=invalid", "-dt", "-p", "8080:8000", ALPINE, "/bin/sh"})
|
||||||
session.Wait(30)
|
session.Wait(30)
|
||||||
|
@ -27,12 +27,6 @@ var _ = Describe("Common functions test", func() {
|
|||||||
ProcessOneCgroupPath = defaultCgroupPath
|
ProcessOneCgroupPath = defaultCgroupPath
|
||||||
})
|
})
|
||||||
|
|
||||||
It("Test CreateTempDirInTempDir", func() {
|
|
||||||
tmpDir, _ := CreateTempDirInTempDir()
|
|
||||||
_, err := os.Stat(tmpDir)
|
|
||||||
Expect(os.IsNotExist(err)).ShouldNot(BeTrue(), "Directory is not created as expect")
|
|
||||||
})
|
|
||||||
|
|
||||||
It("Test SystemExec", func() {
|
It("Test SystemExec", func() {
|
||||||
session := SystemExec(GoechoPath, []string{})
|
session := SystemExec(GoechoPath, []string{})
|
||||||
Expect(session.Command.Process).ShouldNot(BeNil(), "SystemExec cannot start a process")
|
Expect(session.Command.Process).ShouldNot(BeNil(), "SystemExec cannot start a process")
|
||||||
|
@ -376,11 +376,6 @@ func (s *PodmanSession) WaitWithTimeout(timeout int) {
|
|||||||
os.Stderr.Sync()
|
os.Stderr.Sync()
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTempDirInTempDir create a temp dir with prefix podman_test
|
|
||||||
func CreateTempDirInTempDir() (string, error) {
|
|
||||||
return os.MkdirTemp("", "podman_test")
|
|
||||||
}
|
|
||||||
|
|
||||||
// SystemExec is used to exec a system command to check its exit code or output
|
// SystemExec is used to exec a system command to check its exit code or output
|
||||||
func SystemExec(command string, args []string) *PodmanSession {
|
func SystemExec(command string, args []string) *PodmanSession {
|
||||||
c := exec.Command(command, args...)
|
c := exec.Command(command, args...)
|
||||||
|
Reference in New Issue
Block a user