Skip to content

Commit

Permalink
test added for renaming alias
Browse files Browse the repository at this point in the history
  • Loading branch information
SabbirIrfan committed Jun 14, 2024
1 parent d16a389 commit 58b5e4c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/demo/basic/rename-alias.sh
Original file line number Diff line number Diff line change
@@ -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'
6 changes: 6 additions & 0 deletions scripts/demo/test_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 58b5e4c

Please sign in to comment.