blob: 089ad3bd39063caae8fb040cad490d35a3420731 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/env bash
export test_description='Tests pass otp URI parsing'
. ./setup.sh
test_expect_success 'Shows key URI in single-line passfile' '
uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example"
test_pass_init &&
"$PASS" otp insert passfile <<< "$uri" &&
[[ $("$PASS" otp uri passfile) == "$uri" ]]
'
test_expect_success 'Shows key URI in multi-line passfile' '
uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example"
test_pass_init &&
"$PASS" insert -m passfile < <(echo -e "password\nfoo\n$uri\nbar") &&
[[ $("$PASS" otp uri passfile) == "$uri" ]]
'
test_done
|