t1100-git-auth.t 755 Bytes
Newer Older
1
2
3
4
#!/bin/sh

test_description='git-auth tests'

5
. "$(dirname "$0")/setup.sh"
6

Kevin Morris's avatar
Kevin Morris committed
7

8
test_expect_success 'Test basic authentication.' '
Kevin Morris's avatar
Kevin Morris committed
9
	cover "$GIT_AUTH" "$AUTH_KEYTYPE_USER" "$AUTH_KEYTEXT_USER" >out &&
10
11
12
13
14
	grep -q AUR_USER=user out &&
	grep -q AUR_PRIVILEGED=0 out
'

test_expect_success 'Test Trusted User authentication.' '
Kevin Morris's avatar
Kevin Morris committed
15
	cover "$GIT_AUTH" "$AUTH_KEYTYPE_TU" "$AUTH_KEYTEXT_TU" >out &&
16
17
18
19
	grep -q AUR_USER=tu out &&
	grep -q AUR_PRIVILEGED=1 out
'

20
test_expect_success 'Test authentication with an unsupported key type.' '
Kevin Morris's avatar
Kevin Morris committed
21
	test_must_fail cover "$GIT_AUTH" ssh-xxx "$AUTH_KEYTEXT_USER"
22
23
24
'

test_expect_success 'Test authentication with a wrong key.' '
Kevin Morris's avatar
Kevin Morris committed
25
	cover "$GIT_AUTH" "$AUTH_KEYTYPE_MISSING" "$AUTH_KEYTEXT_MISSING" >out
26
27
28
	test_must_be_empty out
'

29
test_done