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
|
# Setup LUKS
|
||||||
parted -s /dev/sdd mklabel msdos mkpart p 1MiB 50% mkpart p 50% 100%
|
parted -s /dev/sdd mklabel msdos mkpart p 1MiB 50% mkpart p 50% 100%
|
||||||
partprobe
|
partprobe
|
||||||
|
test -b /dev/sdd1
|
||||||
|
test -b /dev/sdd2
|
||||||
cryptsetup -q --type luks1 luksFormat /dev/sdd1 <<< 123test
|
cryptsetup -q --type luks1 luksFormat /dev/sdd1 <<< 123test
|
||||||
cryptsetup -q --type luks2 luksFormat /dev/sdd2 <<< 123test
|
cryptsetup -q --type luks2 luksFormat /dev/sdd2 <<< 123test
|
||||||
cryptsetup -q --type luks2 luksFormat /dev/sde <<< 123test
|
cryptsetup -q --type luks2 luksFormat /dev/sde <<< 123test
|
||||||
@ -37,12 +39,11 @@ finish_sys() {
|
|||||||
lvremove -f vgtest/lvtest
|
lvremove -f vgtest/lvtest
|
||||||
vgremove vgtest
|
vgremove vgtest
|
||||||
pvremove /dev/sdc
|
pvremove /dev/sdc
|
||||||
# cleanup luks data and partition tables
|
# cleanup luks headers and partition tables
|
||||||
dd if=/dev/zero of=/dev/sdc bs=512 count=1 conv=notrunc
|
for d in /dev/sdc /dev/sdd1 /dev/sdd2 /dev/sdd /dev/sde; do
|
||||||
dd if=/dev/zero of=/dev/sdd1 bs=512 count=2048 conv=notrunc
|
cryptsetup isLuks $dev && cryptsetup luksErase $dev <<< YES
|
||||||
dd if=/dev/zero of=/dev/sdd2 bs=512 count=2048 conv=notrunc
|
test -b $dev && dd if=/dev/zero of=$dev bs=512 count=2048 conv=notrunc
|
||||||
dd if=/dev/zero of=/dev/sdd bs=512 count=1 conv=notrunc
|
done
|
||||||
dd if=/dev/zero of=/dev/sde bs=512 count=2048 conv=notrunc
|
|
||||||
partprobe
|
partprobe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user