Skip to content

Commit 9856d4d

Browse files
jberezanskidscho
authored andcommitted
t0302: check helper can handle empty credentials
Make sure the helper does not crash when blank username and password is provided. If the helper can save such credentials, it should be able to read them back. Signed-off-by: Jakub Bereżański <[email protected]>
1 parent 5adb572 commit 9856d4d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

t/lib-credential.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ helper_test_clean() {
4444
reject $1 https example.com user2
4545
reject $1 http path.tld user
4646
reject $1 https timeout.tld user
47+
reject $1 https sso.tld
4748
}
4849

4950
reject() {
@@ -250,6 +251,24 @@ helper_test() {
250251
password=pass2
251252
EOF
252253
'
254+
255+
test_expect_success "helper ($HELPER) can store empty username" '
256+
check approve $HELPER <<-\EOF &&
257+
protocol=https
258+
host=sso.tld
259+
username=
260+
password=
261+
EOF
262+
check fill $HELPER <<-\EOF
263+
protocol=https
264+
host=sso.tld
265+
--
266+
protocol=https
267+
host=sso.tld
268+
username=
269+
password=
270+
EOF
271+
'
253272
}
254273

255274
helper_test_timeout() {

0 commit comments

Comments
 (0)