mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-09 12:22:40 +01:00
improve robustness of sys tests
This commit is contained in:
parent
641aa8d669
commit
52e4a2e304
@ -25,6 +25,8 @@ EOF
|
||||
# Setup LUKS
|
||||
parted -s /dev/sdd mklabel msdos mkpart p 1MiB 50% mkpart p 50% 100%
|
||||
partprobe
|
||||
test -b /dev/sdd1
|
||||
test -b /dev/sdd2
|
||||
cryptsetup -q --type luks1 luksFormat /dev/sdd1 <<< 123test
|
||||
cryptsetup -q --type luks2 luksFormat /dev/sdd2 <<< 123test
|
||||
cryptsetup -q --type luks2 luksFormat /dev/sde <<< 123test
|
||||
@ -37,12 +39,11 @@ finish_sys() {
|
||||
lvremove -f vgtest/lvtest
|
||||
vgremove vgtest
|
||||
pvremove /dev/sdc
|
||||
# cleanup luks data and partition tables
|
||||
dd if=/dev/zero of=/dev/sdc bs=512 count=1 conv=notrunc
|
||||
dd if=/dev/zero of=/dev/sdd1 bs=512 count=2048 conv=notrunc
|
||||
dd if=/dev/zero of=/dev/sdd2 bs=512 count=2048 conv=notrunc
|
||||
dd if=/dev/zero of=/dev/sdd bs=512 count=1 conv=notrunc
|
||||
dd if=/dev/zero of=/dev/sde bs=512 count=2048 conv=notrunc
|
||||
# cleanup luks headers and partition tables
|
||||
for d in /dev/sdc /dev/sdd1 /dev/sdd2 /dev/sdd /dev/sde; do
|
||||
cryptsetup isLuks $dev && cryptsetup luksErase $dev <<< YES
|
||||
test -b $dev && dd if=/dev/zero of=$dev bs=512 count=2048 conv=notrunc
|
||||
done
|
||||
partprobe
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user