mirror of
https://github.com/suikan4github/kaiten-yaki.git
synced 2025-12-20 18:41:17 -03:00
Add test script for development
This commit is contained in:
parent
fdfd8953d5
commit
4699f87cc7
5 changed files with 346 additions and 2 deletions
38
script/test/testutil.sh
Normal file
38
script/test/testutil.sh
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
|
||||
# *******************************************************************************
|
||||
# Deactivate all LV in the VG and close LUKS volume
|
||||
# *******************************************************************************
|
||||
|
||||
function util_deactivate_and_close(){
|
||||
echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"."
|
||||
vgchange -a n "${VGNAME}"
|
||||
echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"."
|
||||
cryptsetup close "${CRYPTPARTNAME}"
|
||||
cat <<- HEREDOC
|
||||
|
||||
...Installation process terminated..
|
||||
HEREDOC
|
||||
|
||||
}
|
||||
|
||||
# *******************************************************************************
|
||||
# Delete the nwe volume if overwrite install, and close all
|
||||
# *******************************************************************************
|
||||
function util_cleanup(){
|
||||
echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}\"."
|
||||
lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}"
|
||||
|
||||
if [ "${USELVEXT1}" -ne 0 ] ; then # if using extra volume 1
|
||||
# Remove newly created extra volume 1
|
||||
echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\"."
|
||||
lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT1SUFFIX}"
|
||||
fi
|
||||
|
||||
if [ "${USELVEXT2}" -ne 0 ] ; then # if using extra volume 2
|
||||
# Remove newly created extra volume 2
|
||||
echo "...Deleting the new logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\"."
|
||||
lvremove -f /dev/mapper/"${VGNAME}"-"${LVROOTNAME}${LVEXT2SUFFIX}"
|
||||
fi
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue