summaryrefslogtreecommitdiff
path: root/tests/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/setup.sh')
-rwxr-xr-xtests/setup.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/setup.sh b/tests/setup.sh
index b5729e4..15c0d28 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -2,7 +2,7 @@
#
# This scripts sets the following:
# ${GNUPGHOME} Full path to test GPG directory
-# ${PASS} Full path to password-store script to test
+# $PASS Full path to password-store script to test
# ${PASSWORD_STORE_KEY} GPG key id of testing key
# ${PASSWORD_STORE_TEST_HOME} This folder
@@ -16,7 +16,7 @@ PASSWORD_STORE_TEST_HOME="$(cd "$(dirname "$BASH_SOURCE")"; pwd)"
PASS="${PASSWORD_STORE_TEST_HOME}/../src/password-store.sh"
-if ! test -e ${PASS} ; then
+if [[ ! -e $PASS ]]; then
echo "Could not find password-store.sh"
exit 1
fi
@@ -26,7 +26,7 @@ fi
# Where the test keyring and test key id
# Note: the assumption is the test key is unencrypted.
-export GNUPGHOME=$(pwd)"/gnupg/"
+export GNUPGHOME="${PASSWORD_STORE_TEST_HOME}/gnupg/"
chmod 700 "$GNUPGHOME"
export PASSWORD_STORE_KEY="3DEEA12D" # "Password-store Test Key"
GPG="gpg"
@@ -56,7 +56,7 @@ pass_init() {
fi
fi
- ${PASS} init ${PASSWORD_STORE_KEY} || return 1
+ $PASS init ${PASSWORD_STORE_KEY} || return 1
echo "Initialization of ${PASSWORD_STORE_DIR} complete."
}
@@ -76,11 +76,11 @@ check_cred() {
local cred="$1"
shift
echo "Checking credential ${cred}"
- if ! ${PASS} show "$cred"; then
+ if ! $PASS show "$cred"; then
echo "Credential ${cred} does not exist"
return 1
fi
- if [[ -z "$(${PASS} show "$cred")" ]]; then
+ if [[ -z "$($PASS show "$cred")" ]]; then
echo "Credential ${cred} empty"
return 1
fi
@@ -101,7 +101,7 @@ check_no_cred() {
local cred="$1"
shift
echo "Checking for lack of credential ${cred}"
- ${PASS} show "$cred" || return 0
+ $PASS show "$cred" || return 0
echo "Credential ${cred} exists."
return 1
}
@@ -131,10 +131,10 @@ create_cred() {
echo "Using password \"$password\" for $cred"
# TODO: Working around bug with 'pass insert' returning non-zero.
# Fix this code to exit on error when that is fixed.
- ${PASS} insert -e "$cred" <<<"$password" || true
+ $PASS insert -e "$cred" <<<"$password" || true
else
echo "Generating random password for $cred"
- if ! ${PASS} generate "${cred}" 24 > /dev/null; then
+ if ! $PASS generate "${cred}" 24 > /dev/null; then
echo "Failed to create credential ${cred}"
return 1
fi
@@ -161,7 +161,7 @@ verify_password() {
check_cred "$cred" || return 1
local actualfile="${SHARNESS_TRASH_DIRECTORY}/verify-password-actual.$RANDOM.$RANDOM.$RANDOM.$RANDOM"
local expectedfile="${SHARNESS_TRASH_DIRECTORY}/verify-password-expected.$RANDOM.$RANDOM.$RANDOM.$RANDOM"
- ${PASS} show "$TEST_CRED" | sed -n 1p > "$actualfile" &&
+ $PASS show "$TEST_CRED" | sed -n 1p > "$actualfile" &&
echo "$expected" > "$expectedfile" &&
test_cmp "$expectedfile" "$actualfile"
}
ass='insertions'>+21 2021-02-21Clarify codeRené 'Necoro' Neumann1-5/+5 2021-02-21Update changelogRené 'Necoro' Neumann1-0/+2 2021-02-21#39 Ignore mails marked as deleted when looking for existing mails, as to ↵René 'Necoro' Neumann1-0/+1 not undelete them by accident. 2021-02-21go mod tidyRené 'Necoro' Neumann1-8/+0 2021-02-18Import 'embed' packageRené 'Necoro' Neumann1-0/+1 2021-02-16Fix goreleaser setup regarding dockerRené 'Necoro' Neumann1-3/+1 2021-02-16Prepare v0.6.0v0.6.0René 'Necoro' Neumann3-3/+8 2021-02-16Fix CRLF endingRené 'Necoro' Neumann1-57/+57 2021-02-16Increment go-version to 1.16René 'Necoro' Neumann3-5/+5 2021-02-16Use go-embed for templates instead of inline strings.René 'Necoro' Neumann6-74/+79 They should also use CRLF (cf issue #46). 2021-02-16Issue #46: Fix semantics of `n` resultRené 'Necoro' Neumann2-9/+15 Per contract, the returned number of bytes written should be the number of bytes _from the input_. Therefore, the added bytes (`\r` or `\n`) shall not count into that number. 2021-02-16Issue #46: Move and rename writer; add commentsRené 'Necoro' Neumann3-12/+21 2021-02-15Issue #46: Improvements; add testsRené 'Necoro' Neumann2-1/+48 2021-02-15Bump github.com/google/uuid from 1.1.4 to 1.2.0dependabot[bot]2-3/+3 Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.1.4 to 1.2.0. - [Release notes](https://github.com/google/uuid/releases) - [Commits](https://github.com/google/uuid/compare/v1.1.4...v1.2.0) Signed-off-by: dependabot[bot] <support@github.com> 2021-02-15Issue #46: Make the resulting email body not to include single \r or \n. ↵René 'Necoro' Neumann2-2/+66 This now pleases Cyrus IMAP. 2021-01-20Bump github.com/PuerkitoBio/goquery from 1.6.0 to 1.6.1dependabot[bot]2-3/+3 Bumps [github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery) from 1.6.0 to 1.6.1. - [Release notes](https://github.com/PuerkitoBio/goquery/releases) - [Commits](https://github.com/PuerkitoBio/goquery/compare/v1.6.0...v1.6.1) Signed-off-by: dependabot[bot] <support@github.com> 2021-01-09Bump github.com/google/uuid from 1.1.2 to 1.1.4dependabot[bot]2-3/+3 Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.1.2 to 1.1.4. - [Release notes](https://github.com/google/uuid/releases) - [Commits](https://github.com/google/uuid/compare/v1.1.2...v1.1.4) Signed-off-by: dependabot[bot] <support@github.com> 2021-01-09Bump github.com/emersion/go-message from 0.14.0 to 0.14.1 (#42)dependabot[bot]2-3/+3 Bumps [github.com/emersion/go-message](https://github.com/emersion/go-message) from 0.14.0 to 0.14.1. - [Release notes](https://github.com/emersion/go-message/releases) - [Commits](https://github.com/emersion/go-message/compare/v0.14.0...v0.14.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2020-11-28Bump github.com/emersion/go-message from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 Bumps [github.com/emersion/go-message](https://github.com/emersion/go-message) from 0.13.0 to 0.14.0. - [Release notes](https://github.com/emersion/go-message/releases) - [Commits](https://github.com/emersion/go-message/compare/v0.13.0...v0.14.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.2 to 0.5.4. - [Release notes](https://github.com/google/go-cmp/releases) - [Commits](https://github.com/google/go-cmp/compare/v0.5.2...v0.5.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 Bumps [github.com/gabriel-vasile/mimetype](https://github.com/gabriel-vasile/mimetype) from 1.1.1 to 1.1.2. - [Release notes](https://github.com/gabriel-vasile/mimetype/releases) - [Changelog](https://github.com/gabriel-vasile/mimetype/blob/master/CHANGELOG.md) - [Commits](https://github.com/gabriel-vasile/mimetype/compare/v1.1.1...v1.1.2) Signed-off-by: dependabot[bot] <support@github.com> 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0