mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-interface: Add test suite and basic tests
Add basic tests for the Git interface. The test suite is based on sharness. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
5014b74868
commit
6e38309c19
6 changed files with 1048 additions and 0 deletions
26
git-interface/test/t0002-serve.sh
Executable file
26
git-interface/test/t0002-serve.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='git-serve tests'
|
||||
|
||||
. ./setup.sh
|
||||
|
||||
test_expect_success 'Test interactive shell.' '
|
||||
"$GIT_SERVE" 2>&1 | grep -q "Interactive shell is disabled."
|
||||
'
|
||||
|
||||
test_expect_success 'Test help.' '
|
||||
SSH_ORIGINAL_COMMAND=help "$GIT_SERVE" 2>&1 | grep -q "^Commands:$"
|
||||
'
|
||||
|
||||
test_expect_success 'Test setup-repo and list-repos.' '
|
||||
SSH_ORIGINAL_COMMAND="setup-repo foobar" AUR_USER=user \
|
||||
"$GIT_SERVE" 2>&1 &&
|
||||
cat >expected <<-EOF &&
|
||||
*foobar
|
||||
EOF
|
||||
SSH_ORIGINAL_COMMAND="list-repos" AUR_USER=user \
|
||||
"$GIT_SERVE" 2>&1 >actual &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_done
|
Loading…
Add table
Add a link
Reference in a new issue