Skip to content

Commit

Permalink
systemtests: adapt checkpoint-tests to 1M blocks
Browse files Browse the repository at this point in the history
The checkpoint test was relying on smaller blocksizes, so it had to be
adapted to the new 1M blocksize.
We now also create special testdata for that with the new gentestdata
tool and use that for the tests.
  • Loading branch information
arogge committed Jun 7, 2023
1 parent 80e673f commit efbc151
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
Expand Up @@ -14,6 +14,6 @@ FileSet {
fstype = zfs
fstype = btrfs
}
File = "@PROJECT_SOURCE_DIR@/tests/"
File=<@tmpdir@/bigdata-list
}
}
Expand Up @@ -8,5 +8,5 @@ Job {
Messages = Standard
Pool = SmallFull
Full Backup Pool = SmallFull
Maximum Bandwidth = 30K
Maximum Bandwidth = 300K
}
Expand Up @@ -4,7 +4,7 @@ Pool {
Recycle = yes
AutoPrune = yes
Volume Retention = 365 days
Maximum Volume Bytes = 150k
Maximum Volume Bytes = 3M
Maximum Volumes = 100
Label Format = "SmallFull-"
}
9 changes: 8 additions & 1 deletion systemtests/tests/checkpoints/test-setup
Expand Up @@ -2,7 +2,7 @@

# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2022-2022 Bareos GmbH & Co. KG
# Copyright (C) 2022-2023 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -34,6 +34,13 @@ set -u
# Fill ${BackupDirectory} with data.
setup_data

gentestdata="${CMAKE_BINARY_DIR}/core/src/tools/gentestdata"
mkdir -p "$tmp/bigdata"
echo "$tmp/bigdata" >"$tmp/bigdata-list"
for i in 1 2 3 4 5 6 7 8 9 10; do
"$gentestdata" --size=1048576 >"$tmp/bigdata/testfile$i.bin"
done

bin/bareos start
bin/bareos status

Expand Down
Expand Up @@ -99,9 +99,9 @@ expect_grep "Files Restored: ${NumberOfBackedUpFiles}" \
"Restore of canceled job did not go well!"

# Certain systems do not support multiple types for find (-type f,l)
NumberOfFilesRestored=$(find "$restore_directory"/"$PROJECT_SOURCE_DIR"/tests -type f | wc -l)
NumberOfLinksRestored=$(find "$restore_directory"/"$PROJECT_SOURCE_DIR"/tests -type l | wc -l)
NumberOfDirectoriesRestored=$(find "$restore_directory"/"$PROJECT_SOURCE_DIR"/tests -type d | wc -l)
NumberOfFilesRestored=$(find "$restore_directory/$tmp/bigdata" -type f | wc -l)
NumberOfLinksRestored=$(find "$restore_directory/$tmp/bigdata" -type l | wc -l)
NumberOfDirectoriesRestored=$(find "$restore_directory/$tmp/bigdata" -type d | wc -l)
RestoredItems=$((NumberOfFilesRestored + NumberOfLinksRestored + NumberOfDirectoriesRestored))

# Check that the restored files are actually there
Expand Down
6 changes: 3 additions & 3 deletions systemtests/tests/checkpoints/testrunner-checkpoints-on-stop
Expand Up @@ -99,9 +99,9 @@ expect_grep "Termination: Restore OK" \
"Restore job did not go well!"

# Certain systems do not support multiple types for find (-type f,l)
NumberOfFilesRestored=$(find "$restore_directory"/"$PROJECT_SOURCE_DIR"/tests -type f | wc -l)
NumberOfLinksRestored=$(find "$restore_directory"/"$PROJECT_SOURCE_DIR"/tests -type l | wc -l)
NumberOfDirectoriesRestored=$(find "$restore_directory"/"$PROJECT_SOURCE_DIR"/tests -type d | wc -l)
NumberOfFilesRestored=$(find "$restore_directory/$tmp/bigdata" -type f | wc -l)
NumberOfLinksRestored=$(find "$restore_directory/$tmp/bigdata" -type l | wc -l)
NumberOfDirectoriesRestored=$(find "$restore_directory/$tmp/bigdata" -type d | wc -l)
RestoredItems=$((NumberOfFilesRestored + NumberOfLinksRestored + NumberOfDirectoriesRestored))

# Check that the restored files are actually there
Expand Down

0 comments on commit efbc151

Please sign in to comment.