test/sma: move crypto helper function to common.sh
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Change-Id: I55d58a5959d5b67d99c2e2dfd9ea787a1e31b023 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13996 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
aa55c23dbc
commit
a70732c9f1
@ -17,3 +17,21 @@ function uuid2base64() {
|
|||||||
print(base64.b64encode(uuid.UUID("$1").bytes).decode())
|
print(base64.b64encode(uuid.UUID("$1").bytes).decode())
|
||||||
EOF
|
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//-/}
|
||||||
|
}
|
||||||
|
@ -20,24 +20,6 @@ cleanup() {
|
|||||||
killprocess $tgtpid
|
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() {
|
gen_volume_params() {
|
||||||
local volume_id=$1 cipher=$2 key=$3 key2=$4 config
|
local volume_id=$1 cipher=$2 key=$3 key2=$4 config
|
||||||
local -a params crypto
|
local -a params crypto
|
||||||
|
Loading…
Reference in New Issue
Block a user