test: make the root/data partition size configurable per test

This commit is contained in:
Frantisek Sumsal 2023-06-05 09:39:51 +02:00
parent 70bdf6e661
commit 0334afe4d0
2 changed files with 6 additions and 2 deletions

View file

@ -4,6 +4,7 @@ set -e
TEST_DESCRIPTION="test systemd-repart"
IMAGE_NAME="repart"
IMAGE_ADDITIONAL_ROOT_SIZE=1000
TEST_FORCE_NEWIMAGE=1
# shellcheck source=test/test-functions

View file

@ -1442,8 +1442,11 @@ create_empty_image() {
fi
fi
if [ "$IMAGE_NAME" = "repart" ]; then
root_size=$((root_size+=1000))
if [[ "${IMAGE_ADDITIONAL_ROOT_SIZE:-0}" -gt 0 ]]; then
root_size=$((root_size + IMAGE_ADDITIONAL_ROOT_SIZE))
fi
if [[ "${IMAGE_ADDITIONAL_DATA_SIZE:-0}" -gt 0 ]]; then
data_size=$((data_size + IMAGE_ADDITIONAL_DATA_SIZE))
fi
echo "Setting up ${IMAGE_PUBLIC:?} (${root_size} MB)"