summaryrefslogtreecommitdiffstats
path: root/git-interface/test/t0002-serve.sh
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-08-06 01:45:15 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-08-06 01:50:17 +0200
commit83df9808b4d533473da51c819c88214a406c5cb9 (patch)
treee43b392c9030b2dddb25a94471e8b7eb161fdf41 /git-interface/test/t0002-serve.sh
parentdd9c6f3ddca37479ce14425c0a82a4b46d7a727a (diff)
downloadaurweb-83df9808b4d533473da51c819c88214a406c5cb9.tar.xz
Add tests for the restore command
Test the restore mode of git-serve and git-update. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface/test/t0002-serve.sh')
-rwxr-xr-xgit-interface/test/t0002-serve.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/git-interface/test/t0002-serve.sh b/git-interface/test/t0002-serve.sh
index f36f1d8..52fdcd1 100755
--- a/git-interface/test/t0002-serve.sh
+++ b/git-interface/test/t0002-serve.sh
@@ -85,4 +85,21 @@ test_expect_success "Try to push to someone else's repository as Trusted User."
test_cmp expected actual
'
+test_expect_success "Test restore." '
+ echo "DELETE FROM PackageBases WHERE Name = \"foobar\";" | \
+ sqlite3 aur.db &&
+ cat >expected <<-EOF &&
+ user
+ foobar
+ EOF
+ SSH_ORIGINAL_COMMAND="restore foobar" AUR_USER=user AUR_PRIVILEGED=0 \
+ "$GIT_SERVE" 2>&1 >actual
+ test_cmp expected actual
+'
+
+test_expect_success "Try to restore an existing package base." '
+ SSH_ORIGINAL_COMMAND="restore foobar2" AUR_USER=user AUR_PRIVILEGED=0 \
+ test_must_fail "$GIT_SERVE" 2>&1
+'
+
test_done