mirror of
https://github.com/systemd/systemd.git
synced 2025-01-21 22:04:01 +03:00
ci: add small test case for /dev/urandom as source for CopyBlocks=
This commit is contained in:
parent
add090ea82
commit
9a9cc27761
@ -1287,6 +1287,26 @@ testcase_dropped_partitions() {
|
||||
[[ "$(sfdisk -q -l "$image" | grep -c "$image")" -eq 2 ]]
|
||||
}
|
||||
|
||||
testcase_urandom() {
|
||||
local workdir image defs
|
||||
|
||||
workdir="$(mktemp --directory "/tmp/test-repart.urandom.XXXXXXXXXX")"
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -rf '${workdir:?}'" RETURN
|
||||
|
||||
image="$workdir/image.img"
|
||||
truncate -s 32M "$image"
|
||||
|
||||
defs="$workdir/defs"
|
||||
mkdir "$defs"
|
||||
echo -ne "[Partition]\nType=swap\nCopyBlocks=/dev/urandom\n" >"$defs/10-urandom.conf"
|
||||
|
||||
systemd-repart --empty=force --pretty=yes --dry-run=no --definitions="$defs" "$image"
|
||||
|
||||
sfdisk -q -l "$image"
|
||||
[[ "$(sfdisk -q -l "$image" | grep -c "$image")" -eq 1 ]]
|
||||
}
|
||||
|
||||
OFFLINE="yes"
|
||||
run_testcases
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user