linuxkit/test/cases/040_packages/005_extend/000_ext4/test.sh
Avi Deitcher efb139697e
always tee test linuxkit run to tty, so if it gets stuck, we see why (#4107)
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2025-02-19 19:41:06 +02:00

33 lines
817 B
Bash

#!/bin/sh
# SUMMARY: Check that an ext4 partition can be extended
# LABELS:
# REPEAT:
set -ex
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME_CREATE=create-ext4
NAME_EXTEND=extend-ext4
DISK=disk.img
clean_up() {
rm -rf ${NAME_CREATE}-* ${NAME_EXTEND}-* ${DISK}
}
trap clean_up EXIT
# Test code goes here
linuxkit build --name "${NAME_CREATE}" --format kernel+initrd test-create.yml
linuxkit run --disk file="${DISK}",format=raw,size=256M "${NAME_CREATE}"
[ -f "${DISK}" ] || exit 1
# osx takes issue with bs=1M
dd if=/dev/zero bs=1048576 count=256 >> "${DISK}"
linuxkit build --format kernel+initrd --name ${NAME_EXTEND} test.yml
RESULT="$(linuxkitrun --disk file=${DISK} ${NAME_EXTEND})"
echo "${RESULT}"
echo "${RESULT}" | grep -q "suite PASSED"
exit 0