Skip to content

Commit

Permalink
Debian: switch to crun
Browse files Browse the repository at this point in the history
Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed May 23, 2024
1 parent 43e5482 commit c9f6e9a
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
DEBIAN_NAME: "debian-13"

# Image identifiers
IMAGE_SUFFIX: "c20240513t140131z-f40f39d13"
IMAGE_SUFFIX: "c20240514t134014z-f40f39d13"

# EC2 images
FEDORA_AMI: "fedora-aws-${IMAGE_SUFFIX}"
Expand Down Expand Up @@ -119,7 +119,7 @@ build_task:
- env:
DISTRO_NV: ${DEBIAN_NAME}
VM_IMAGE_NAME: ${DEBIAN_CACHE_IMAGE_NAME}
CI_DESIRED_RUNTIME: runc
CI_DESIRED_RUNTIME: crun
CI_DESIRED_NETWORK: netavark
# Ignore cgroups-v1 warnings on debian
PODMAN_IGNORE_CGROUPSV1_WARNING: true
Expand Down
15 changes: 6 additions & 9 deletions test/e2e/container_iface_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ import (
. "github.com/onsi/gomega"
)

func isDebianRunc(pTest *PodmanTestIntegration) bool {
// FIXME 2024-05-14: "Debian" here is a proxy for "netavark < 1.10"
func isDebian() bool {
info := GetHostDistributionInfo()
if info.Distribution == "debian" && pTest.OCIRuntime == "runc" {
return true
}

return false
return info.Distribution == "debian"
}

func createNetworkDevice(name string) {
Expand Down Expand Up @@ -104,7 +101,7 @@ var _ = Describe("Podman container interface name", func() {
}

for _, driverType := range []string{"macvlan", "ipvlan"} {
if driverType == "ipvlan" && isDebianRunc(podmanTest) {
if driverType == "ipvlan" && isDebian() {
GinkgoWriter.Println("FIXME: Fails with netavark < 1.10. Re-enable once Debian gets an update")
continue
}
Expand Down Expand Up @@ -157,7 +154,7 @@ var _ = Describe("Podman container interface name", func() {
SkipIfRootless("cannot create network device in rootless mode.")

for _, driverType := range []string{"macvlan", "ipvlan"} {
if driverType == "ipvlan" && isDebianRunc(podmanTest) {
if driverType == "ipvlan" && isDebian() {
GinkgoWriter.Println("FIXME: Fails with netavark < 1.10. Re-enable once Debian gets an update")
continue
}
Expand Down Expand Up @@ -223,7 +220,7 @@ var _ = Describe("Podman container interface name", func() {
createContainersConfFileWithDeviceIfaceName(podmanTest)

for _, driverType := range []string{"macvlan", "ipvlan"} {
if driverType == "ipvlan" && isDebianRunc(podmanTest) {
if driverType == "ipvlan" && isDebian() {
GinkgoWriter.Println("FIXME: Fails with netavark < 1.10. Re-enable once Debian gets an update")
continue
}
Expand Down
9 changes: 8 additions & 1 deletion test/e2e/update_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package integration

import (
"os"

"github.com/containers/common/pkg/cgroupv2"
. "github.com/containers/podman/v5/test/utils"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -116,7 +118,12 @@ var _ = Describe("Podman update", func() {
podmanTest.CheckFileInContainerSubstring(ctrID, "/sys/fs/cgroup/cpu.max", "500000")

// checking blkio weight
podmanTest.CheckFileInContainerSubstring(ctrID, "/sys/fs/cgroup/io.bfq.weight", "123")
if _, err := os.Stat("/sys/fs/cgroup/system.slice/io.bfq.weight"); err == nil {
session = podmanTest.Podman([]string{"exec", ctrID, "cat", "/sys/fs/cgroup/io.bfq.weight"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
Expect(session.OutputToString()).Should(ContainSubstring("123"))
}

// checking device-read/write-bps/iops
podmanTest.CheckFileInContainerSubstring(ctrID, "/sys/fs/cgroup/io.max", "rbps=10485760 wbps=10485760 riops=1000 wiops=1000")
Expand Down
17 changes: 16 additions & 1 deletion test/system/260-sdnotify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,22 @@ READY=1" "podman-system-service sends expected data over NOTIFY_SOCKET"
assert "$output" !~ "EXTEND_TIMEOUT_USEC="

# Give the system-service 5sec to terminate before killing it.
/bin/kill --timeout 5000 KILL --signal TERM $mainpid
kill -TERM $mainpid
timeout=5
while :;do
if ! kill -0 $mainpid; then
# Yay, it's gone
break
fi

timeout=$((timeout - 1))
if [[ $timeout -eq 0 ]]; then
kill -KILL $mainpid
break
fi
sleep 1
done

run_podman rmi $image_on_local_registry
_stop_socat
}
Expand Down
8 changes: 8 additions & 0 deletions test/system/280-update.bats
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ device-write-iops = /dev/zero:4000 | - | -
fi
fi

# Determine the "path = newvalue" string for this cgroup
tuple=$cgv1
if is_cgroupsv2; then
tuple=$cgv2
Expand All @@ -99,6 +100,13 @@ device-write-iops = /dev/zero:4000 | - | -
continue
fi

# Sigh. bfq doesn't exist on Debian (2024-03)
read path op expect <<<"$tuple"
if [[ ! -e /sys/fs/cgroup/$path ]]; then
echo "[ skipping --$opt : /sys/fs/cgroup/$path does not exist ]"
continue
fi

# OK: setting is applicable. Preserve it. (First removing whitespace)
opt=${opt// /}
opts+=("--$opt")
Expand Down
6 changes: 6 additions & 0 deletions test/system/520-checkpoint.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ function setup() {
skip "checkpoint does not work rootless"
fi

runtime=$(podman_runtime)
run $runtime checkpoint --help
if [[ $status -ne 0 ]]; then
skip "runtime $runtime does not support checkpoint/restore"
fi

basic_setup
}

Expand Down

0 comments on commit c9f6e9a

Please sign in to comment.