From ed48590821722d21b5fd890b06885ed6c41a5146 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Thu, 5 May 2022 23:20:30 +0900 Subject: [PATCH] Test update. --- script/test/trial.sh | 11 ++++++++++ script/test/{testutil.sh => util_cleanup.sh} | 22 +++++-------------- script/test/util_deactivate_and_close.sh | 23 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 16 deletions(-) create mode 100755 script/test/trial.sh rename script/test/{testutil.sh => util_cleanup.sh} (65%) mode change 100644 => 100755 create mode 100755 script/test/util_deactivate_and_close.sh diff --git a/script/test/trial.sh b/script/test/trial.sh new file mode 100755 index 0000000..5106da8 --- /dev/null +++ b/script/test/trial.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +DISK=/dev/sdb + +DISKSIZE=$(blockdev --report ${DISK} | awk /${DISK}/'{print $6}') +VOLSIZE=$(lvdisplay --units B /dev/vg_test/anko | awk '/Size/{print $3}') + +echo $DISKSIZE +echo $VOLSIZE + +echo "scale=3; $VOLSIZE/$DISKSIZE" | bc \ No newline at end of file diff --git a/script/test/testutil.sh b/script/test/util_cleanup.sh old mode 100644 new mode 100755 similarity index 65% rename from script/test/testutil.sh rename to script/test/util_cleanup.sh index a4889d2..0701bb9 --- a/script/test/testutil.sh +++ b/script/test/util_cleanup.sh @@ -1,20 +1,8 @@ +#!/bin/bash -u - -# ******************************************************************************* -# 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 - -} + # shellcheck disable=SC1091 + # Load configuration parameter + source ./config01.sh # ******************************************************************************* # Delete the nwe volume if overwrite install, and close all @@ -36,3 +24,5 @@ function util_cleanup(){ fi } + +util_cleanup diff --git a/script/test/util_deactivate_and_close.sh b/script/test/util_deactivate_and_close.sh new file mode 100755 index 0000000..2da7bb4 --- /dev/null +++ b/script/test/util_deactivate_and_close.sh @@ -0,0 +1,23 @@ +#!/bin/bash -u + + # shellcheck disable=SC1091 + # Load configuration parameter + source ./config01.sh + +# ******************************************************************************* +# 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 + +} + +util_deactivate_and_close