From 3e744e52b5e765a2d2ab4bbe35f88a6fdf2d6d45 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 23 Aug 2022 13:00:38 -0600 Subject: [PATCH] System tests for podman-update The e2e tests are incomplete, because they're just too hard for any human to read/maintain. This defines tests in a table, so they're easily reviewed and updated. This makes it very easy to see which options are actually tested and which are not, under root/rootless cgroups v1/v2. Signed-off-by: Ed Santiago --- test/system/280-update.bats | 130 ++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 test/system/280-update.bats diff --git a/test/system/280-update.bats b/test/system/280-update.bats new file mode 100644 index 000000000000..c7037c2865c3 --- /dev/null +++ b/test/system/280-update.bats @@ -0,0 +1,130 @@ +#!/usr/bin/env bats -*- bats -*- +# +# Tests for podman update +# + +load helpers + +LOOPDEVICE= + +function teardown() { + if [[ -n "$LOOPDEVICE" ]]; then + losetup -d $LOOPDEVICE + LOOPDEVICE= + fi + basic_teardown +} + + +@test "podman update - test all options" { + + local cgv=1 + if is_cgroupsv2; then + cgv=2; + fi + + # Need a block device for blkio-weight-device testing + local pass_loop_device= + if ! is_rootless; then + if is_cgroupsv2; then + lofile=${PODMAN_TMPDIR}/disk.img + fallocate -l 1k ${lofile} + LOOPDEVICE=$(losetup --show -f $lofile) + pass_loop_device="--device $LOOPDEVICE" + + # Get maj:min (tr needed because losetup seems to use %2d) + lomajmin=$(losetup -l --noheadings --output MAJ:MIN $LOOPDEVICE | tr -d ' ') + fi + fi + + # Shortcuts to make the table narrower + local -a gig=(0 1073741824 2147483648 3221225472) + local devicemax="1:5 rbps=10485760 wbps=31457280 riops=2000 wiops=4000" + local mm=memory/memory + + # Format: + # --