3 test_description
='git p4 errors'
7 test_expect_success
'start p4d' '
11 test_expect_success
'add p4 files' '
20 # after this test, the default user requires a password
21 test_expect_success
'error handling' '
22 git p4 clone --dest="$git" //depot@all &&
25 P4PORT=: test_must_fail git p4 submit 2>errmsg
27 p4 passwd -P newpassword &&
29 P4PASSWD=badpassword test_must_fail git p4 clone //depot/foo 2>errmsg &&
30 grep -q "failure accessing depot.*P4PASSWD" errmsg
34 test_expect_success
'ticket logged out' '
35 P4TICKETS="$cli/tickets" &&
36 echo "newpassword" | p4 login &&
39 test_commit "ticket-auth-check" &&
41 test_must_fail git p4 submit 2>errmsg &&
42 grep -q "failure accessing depot" errmsg
46 test_expect_success
'create group with short ticket expiry' '
47 P4TICKETS="$cli/tickets" &&
48 echo "newpassword" | p4 login &&
49 p4_add_user short_expiry_user &&
50 p4 -u short_expiry_user passwd -P password &&
54 Users: short_expiry_user
57 p4 users | grep short_expiry_user
60 test_expect_success
'git operation with expired ticket' '
61 P4TICKETS="$cli/tickets" &&
62 P4USER=short_expiry_user &&
63 echo "password" | p4 login &&
68 test_must_fail git p4 sync 2>errmsg &&
69 grep "failure accessing depot" errmsg
73 test_expect_success
'kill p4d' '