diff --git a/test/sma/common.sh b/test/sma/common.sh index dd34ee8e8..afa2ecbe8 100644 --- a/test/sma/common.sh +++ b/test/sma/common.sh @@ -17,3 +17,21 @@ function uuid2base64() { print(base64.b64encode(uuid.UUID("$1").bytes).decode()) EOF } + +get_cipher() { + case "$1" in + AES_CBC) echo 0 ;; + AES_XTS) echo 1 ;; + *) echo "$1" ;; + esac +} + +format_key() { + base64 <(echo -n "$1") +} + +uuid2nguid() { + # The NGUID returned by the RPC is UPPERCASE + local uuid=${1^^} + echo ${uuid//-/} +} diff --git a/test/sma/crypto.sh b/test/sma/crypto.sh index eadee774e..b0d8ffc3b 100755 --- a/test/sma/crypto.sh +++ b/test/sma/crypto.sh @@ -20,24 +20,6 @@ cleanup() { killprocess $tgtpid } -get_cipher() { - case "$1" in - AES_CBC) echo 0 ;; - AES_XTS) echo 1 ;; - *) echo "$1" ;; - esac -} - -format_key() { - base64 <(echo -n "$1") -} - -uuid2nguid() { - # The NGUID returned by the RPC is UPPERCASE - local uuid=${1^^} - echo ${uuid//-/} -} - gen_volume_params() { local volume_id=$1 cipher=$2 key=$3 key2=$4 config local -a params crypto