mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Merge pull request #3789 from giuseppe/cirrus-add-crun
cirrus: run tests with crun
This commit is contained in:
45
.cirrus.yml
45
.cirrus.yml
@ -345,6 +345,49 @@ testing_task:
|
|||||||
audit_log_script: '$SCRIPT_BASE/logcollector.sh audit'
|
audit_log_script: '$SCRIPT_BASE/logcollector.sh audit'
|
||||||
journal_script: '$SCRIPT_BASE/logcollector.sh journal'
|
journal_script: '$SCRIPT_BASE/logcollector.sh journal'
|
||||||
|
|
||||||
|
# Test crun on last Fedora
|
||||||
|
testing_crun_task:
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- "gating"
|
||||||
|
- "vendor"
|
||||||
|
- "varlink_api"
|
||||||
|
- "build_each_commit"
|
||||||
|
- "build_without_cgo"
|
||||||
|
|
||||||
|
# Only test build cache-images, if that's what's requested
|
||||||
|
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\*\*\*\s*CIRRUS:\s*TEST\s*IMAGES\s*\*\*\*.*'
|
||||||
|
|
||||||
|
gce_instance:
|
||||||
|
matrix:
|
||||||
|
# Images are generated separately, from build_images_task (below)
|
||||||
|
image_name: "${FEDORA_CACHE_IMAGE_NAME}"
|
||||||
|
|
||||||
|
timeout_in: 120m
|
||||||
|
|
||||||
|
env:
|
||||||
|
ADD_SECOND_PARTITION: true
|
||||||
|
OCI_RUNTIME: "/usr/bin/crun"
|
||||||
|
matrix:
|
||||||
|
TEST_REMOTE_CLIENT: false
|
||||||
|
|
||||||
|
setup_environment_script: '$SCRIPT_BASE/setup_environment.sh |& ${TIMESTAMP}'
|
||||||
|
unit_test_script: '$SCRIPT_BASE/unit_test.sh |& ${TIMESTAMP}'
|
||||||
|
integration_test_script: '$SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP}'
|
||||||
|
system_test_script: '$SCRIPT_BASE/system_test.sh |& ${TIMESTAMP}'
|
||||||
|
cache_release_archive_script: >-
|
||||||
|
[[ "$TEST_REMOTE_CLIENT" == "false" ]] || \
|
||||||
|
$SCRIPT_BASE/cache_release_archive.sh |& ${TIMESTAMP}
|
||||||
|
|
||||||
|
on_failure:
|
||||||
|
failed_branch_script: '$CIRRUS_WORKING_DIR/$SCRIPT_BASE/notice_branch_failure.sh'
|
||||||
|
|
||||||
|
always: &crunstandardlogs
|
||||||
|
ginkgo_node_logs_script: '$SCRIPT_BASE/logcollector.sh ginkgo'
|
||||||
|
df_script: '$SCRIPT_BASE/logcollector.sh df'
|
||||||
|
audit_log_script: '$SCRIPT_BASE/logcollector.sh audit'
|
||||||
|
journal_script: '$SCRIPT_BASE/logcollector.sh journal'
|
||||||
|
|
||||||
|
|
||||||
# This task executes tests under unique environments/conditions
|
# This task executes tests under unique environments/conditions
|
||||||
special_testing_rootless_task:
|
special_testing_rootless_task:
|
||||||
@ -518,6 +561,7 @@ success_task:
|
|||||||
- "meta"
|
- "meta"
|
||||||
- "image_prune"
|
- "image_prune"
|
||||||
- "testing"
|
- "testing"
|
||||||
|
- "testing_crun"
|
||||||
- "special_testing_rootless"
|
- "special_testing_rootless"
|
||||||
- "special_testing_in_podman"
|
- "special_testing_in_podman"
|
||||||
- "special_testing_cross"
|
- "special_testing_cross"
|
||||||
@ -556,6 +600,7 @@ release_task:
|
|||||||
- "meta"
|
- "meta"
|
||||||
- "image_prune"
|
- "image_prune"
|
||||||
- "testing"
|
- "testing"
|
||||||
|
- "testing_crun"
|
||||||
- "special_testing_rootless"
|
- "special_testing_rootless"
|
||||||
- "special_testing_in_podman"
|
- "special_testing_in_podman"
|
||||||
- "special_testing_cross"
|
- "special_testing_cross"
|
||||||
|
@ -44,6 +44,11 @@ case "${OS_REL_VER}" in
|
|||||||
;;
|
;;
|
||||||
fedora-30) ;& # continue to next item
|
fedora-30) ;& # continue to next item
|
||||||
fedora-29)
|
fedora-29)
|
||||||
|
# There is no crun package on Fedora29
|
||||||
|
if test "${OS_REL_VER}" != "fedora-29"; then
|
||||||
|
yum install -y crun
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$ADD_SECOND_PARTITION" == "true" ]]; then
|
if [[ "$ADD_SECOND_PARTITION" == "true" ]]; then
|
||||||
bash "$SCRIPT_BASE/add_second_partition.sh"; fi
|
bash "$SCRIPT_BASE/add_second_partition.sh"; fi
|
||||||
;;
|
;;
|
||||||
|
@ -342,7 +342,7 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode
|
|||||||
if err := ctr.Start(ctx, c.IsSet("pod")); err != nil {
|
if err := ctr.Start(ctx, c.IsSet("pod")); err != nil {
|
||||||
// This means the command did not exist
|
// This means the command did not exist
|
||||||
exitCode = 127
|
exitCode = 127
|
||||||
if strings.Contains(err.Error(), "permission denied") {
|
if strings.Contains(err.Error(), "permission denied") || strings.Contains(err.Error(), "file not found") {
|
||||||
exitCode = 126
|
exitCode = 126
|
||||||
}
|
}
|
||||||
return exitCode, err
|
return exitCode, err
|
||||||
|
@ -179,6 +179,8 @@ var _ = Describe("Podman exec", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman exec cannot be invoked", func() {
|
It("podman exec cannot be invoked", func() {
|
||||||
|
SkipIfNotRunc()
|
||||||
|
|
||||||
setup := podmanTest.RunTopContainer("test1")
|
setup := podmanTest.RunTopContainer("test1")
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
Expect(setup.ExitCode()).To(Equal(0))
|
Expect(setup.ExitCode()).To(Equal(0))
|
||||||
@ -189,6 +191,8 @@ var _ = Describe("Podman exec", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman exec command not found", func() {
|
It("podman exec command not found", func() {
|
||||||
|
SkipIfNotRunc()
|
||||||
|
|
||||||
setup := podmanTest.RunTopContainer("test1")
|
setup := podmanTest.RunTopContainer("test1")
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
Expect(setup.ExitCode()).To(Equal(0))
|
Expect(setup.ExitCode()).To(Equal(0))
|
||||||
|
@ -28,6 +28,13 @@ func SkipIfRootless() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SkipIfNotRunc() {
|
||||||
|
runtime := os.Getenv("OCI_RUNTIME")
|
||||||
|
if runtime != "" && filepath.Base(runtime) != "runc" {
|
||||||
|
ginkgo.Skip("Not using runc as runtime")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Podman is the exec call to podman on the filesystem
|
// Podman is the exec call to podman on the filesystem
|
||||||
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
|
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
|
||||||
podmanSession := p.PodmanBase(args, false, false)
|
podmanSession := p.PodmanBase(args, false, false)
|
||||||
|
@ -21,6 +21,13 @@ func SkipIfRootless() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SkipIfNotRunc() {
|
||||||
|
runtime := os.Getenv("OCI_RUNTIME")
|
||||||
|
if runtime != "" && filepath.Base(runtime) != "runc" {
|
||||||
|
ginkgo.Skip("Not using runc as runtime")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Podman is the exec call to podman on the filesystem
|
// Podman is the exec call to podman on the filesystem
|
||||||
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
|
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
|
||||||
podmanSession := p.PodmanBase(args, false, false)
|
podmanSession := p.PodmanBase(args, false, false)
|
||||||
|
@ -41,12 +41,16 @@ var _ = Describe("Podman run exit", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run exit 126", func() {
|
It("podman run exit 126", func() {
|
||||||
|
SkipIfNotRunc()
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
|
result := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result.ExitCode()).To(Equal(126))
|
Expect(result.ExitCode()).To(Equal(126))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman run exit 127", func() {
|
It("podman run exit 127", func() {
|
||||||
|
SkipIfNotRunc()
|
||||||
|
|
||||||
result := podmanTest.Podman([]string{"run", ALPINE, "foobar"})
|
result := podmanTest.Podman([]string{"run", ALPINE, "foobar"})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result.ExitCode()).To(Equal(127))
|
Expect(result.ExitCode()).To(Equal(127))
|
||||||
|
@ -353,6 +353,8 @@ var _ = Describe("Podman run", func() {
|
|||||||
|
|
||||||
It("podman run notify_socket", func() {
|
It("podman run notify_socket", func() {
|
||||||
SkipIfRemote()
|
SkipIfRemote()
|
||||||
|
SkipIfNotRunc()
|
||||||
|
|
||||||
host := GetHostDistributionInfo()
|
host := GetHostDistributionInfo()
|
||||||
if host.Distribution != "rhel" && host.Distribution != "centos" && host.Distribution != "fedora" {
|
if host.Distribution != "rhel" && host.Distribution != "centos" && host.Distribution != "fedora" {
|
||||||
Skip("this test requires a working runc")
|
Skip("this test requires a working runc")
|
||||||
@ -563,6 +565,7 @@ var _ = Describe("Podman run", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run exit code on failure to exec", func() {
|
It("podman run exit code on failure to exec", func() {
|
||||||
|
SkipIfNotRunc()
|
||||||
session := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
|
session := podmanTest.Podman([]string{"run", ALPINE, "/etc"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(126))
|
Expect(session.ExitCode()).To(Equal(126))
|
||||||
|
@ -101,6 +101,8 @@ var _ = Describe("Podman start", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman failed to start with --rm should delete the container", func() {
|
It("podman failed to start with --rm should delete the container", func() {
|
||||||
|
SkipIfNotRunc()
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"create", "-it", "--rm", ALPINE, "foo"})
|
session := podmanTest.Podman([]string{"create", "-it", "--rm", ALPINE, "foo"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
@ -114,6 +116,8 @@ var _ = Describe("Podman start", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman failed to start without --rm should NOT delete the container", func() {
|
It("podman failed to start without --rm should NOT delete the container", func() {
|
||||||
|
SkipIfNotRunc()
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"create", "-it", ALPINE, "foo"})
|
session := podmanTest.Podman([]string{"create", "-it", ALPINE, "foo"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
Reference in New Issue
Block a user