From 58b5e4c897f6861fa2ce13373037c6100db0a7cd Mon Sep 17 00:00:00 2001 From: sabbirirfan Date: Fri, 14 Jun 2024 15:01:37 +0600 Subject: [PATCH] test added for renaming alias --- scripts/demo/basic/rename-alias.sh | 26 ++++++++++++++++++++++++++ scripts/demo/test_scripts.sh | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 scripts/demo/basic/rename-alias.sh diff --git a/scripts/demo/basic/rename-alias.sh b/scripts/demo/basic/rename-alias.sh new file mode 100644 index 000000000..719b5eddf --- /dev/null +++ b/scripts/demo/basic/rename-alias.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# CREATE DATABASE AND KEYSTORE +kli init --name rename-test --base "${KERI_TEMP_DIR}" --nopasscode + +echo ${KERI_DEMO_SCRIPT_DIR} +# Incept with the initial alias "sabbir" +kli incept --name rename-test --base "${KERI_TEMP_DIR}" --alias sabbir --file ${KERI_DEMO_SCRIPT_DIR}/data/transferable-sample.json + +# Rename the alias from "sabbir" to "irfan" +kli rename --name rename-test --base "${KERI_TEMP_DIR}" --alias sabbir irfan + +# Extract aliases from status +irfan_alias=$(kli status --name rename-test --base "${KERI_TEMP_DIR}" --alias irfan | grep -Eo 'Alias:\s+(.+)' | awk '{print $2}') + + + +# Check if the extracted alias is "irfan" +if [ "$irfan_alias" = "irfan" ]; then + echo "Alias successfully changed to 'irfan'." +else + echo "Alias did not change !" + +fi + +echo 'Test Complete' \ No newline at end of file diff --git a/scripts/demo/test_scripts.sh b/scripts/demo/test_scripts.sh index dd2c3cc88..6cce74d38 100755 --- a/scripts/demo/test_scripts.sh +++ b/scripts/demo/test_scripts.sh @@ -76,3 +76,9 @@ printf "Running multisig-join.sh" printf "\n************************************\n" "${script_dir}/basic/multisig-join.sh" isSuccess + +printf "\n************************************\n" +printf "Running rename.sh" +printf "\n************************************\n" +"${script_dir}/basic/rename-alias.sh" +isSuccess \ No newline at end of file