aboutsummaryrefslogtreecommitdiffstats
path: root/testing/go-passbolt-cli/passbolt-cli-helper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testing/go-passbolt-cli/passbolt-cli-helper.sh')
-rwxr-xr-xtesting/go-passbolt-cli/passbolt-cli-helper.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/go-passbolt-cli/passbolt-cli-helper.sh b/testing/go-passbolt-cli/passbolt-cli-helper.sh
new file mode 100755
index 00000000000..d47b954f92a
--- /dev/null
+++ b/testing/go-passbolt-cli/passbolt-cli-helper.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -eu
+
+requested_name=$1
+id=$2
+
+# OPTIMIZE: Only call api once
+name=$(go-passbolt-cli get resource --id $id | awk '/^Name:/ { print $2 }')
+if [ "$name" != "$requested_name" ]; then
+ echo "Name does not match (expected: $requested_name, returned: $name)" >&2
+ exit 1
+fi
+
+pass=$(go-passbolt-cli get resource --id $id | awk '/^Password:/ { print $2 }')
+
+echo "$pass"