git/t/t9833-errors.sh
Luke Diamand 3f360ded54 git-p4: remove ticket expiry test
The git-p4 login ticket expiry test causes unreliable test
runs. Since the handling of ticket expiry in git-p4 is far
from polished anyway, let's remove it for now.

A better way to actually run the test is to create a python
"fake" version of "p4" which returns whatever expiry results
the test requires.

Ideally git-p4 would look at the expiry time before starting
any long operations, and cleanup gracefully if there is not
enough time left. But that's quite hard to do.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-02-06 12:58:57 -08:00

54 lines
964 B
Bash
Executable file

#!/bin/sh
test_description='git p4 errors'
. ./lib-git-p4.sh
test_expect_success 'start p4d' '
start_p4d
'
test_expect_success 'add p4 files' '
(
cd "$cli" &&
echo file1 >file1 &&
p4 add file1 &&
p4 submit -d "file1"
)
'
# after this test, the default user requires a password
test_expect_success 'error handling' '
git p4 clone --dest="$git" //depot@all &&
(
cd "$git" &&
P4PORT=: test_must_fail git p4 submit 2>errmsg
) &&
p4 passwd -P newpassword &&
(
P4PASSWD=badpassword &&
export P4PASSWD &&
test_must_fail git p4 clone //depot/foo 2>errmsg &&
grep -q "failure accessing depot.*P4PASSWD" errmsg
)
'
test_expect_success 'ticket logged out' '
P4TICKETS="$cli/tickets" &&
echo "newpassword" | p4 login &&
(
cd "$git" &&
test_commit "ticket-auth-check" &&
p4 logout &&
test_must_fail git p4 submit 2>errmsg &&
grep -q "failure accessing depot" errmsg
)
'
test_expect_success 'kill p4d' '
kill_p4d
'
test_done