Spdk/test/sma/common.sh
Konrad Sztyber 3c60910eb8 test/sma: add discovery test
The test checks that it's possible to attach remote volumes through
discovery service.  The tests starts up three SPDK instances: one is being
managed by SMA, while the other two are acting as remote storage nodes.
The test verifies that volumes can be successfully discvered and
attached to a device and that the connections to the discovery
subsystems are refcounted correctly.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I3488b822880b99ef9cfd70e03de3ed9054c13901
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12414
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-20 09:16:54 +00:00

20 lines
334 B
Bash

function sma_waitforlisten() {
local sma_addr=${1:-127.0.0.1}
local sma_port=${2:-8080}
for ((i = 0; i < 5; i++)); do
if nc -z $sma_addr $sma_port; then
return 0
fi
sleep 1s
done
return 1
}
function uuid2base64() {
python <<- EOF
import base64, uuid
print(base64.b64encode(uuid.UUID("$1").bytes).decode())
EOF
}