summaryrefslogtreecommitdiffstats
path: root/git-interface/test/t0001-auth.sh
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-08-04 20:36:31 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-08-05 12:12:09 +0200
commit6e38309c194d860cccd26f901ee5687502331779 (patch)
tree53b70a6444cbe07e60466b7cd4783a7879b8653a /git-interface/test/t0001-auth.sh
parent5014b74868138172090e7528f1b069642e15f295 (diff)
downloadaurweb-6e38309c194d860cccd26f901ee5687502331779.tar.xz
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>
Diffstat (limited to 'git-interface/test/t0001-auth.sh')
-rwxr-xr-xgit-interface/test/t0001-auth.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/git-interface/test/t0001-auth.sh b/git-interface/test/t0001-auth.sh
new file mode 100755
index 0000000..50ef510
--- /dev/null
+++ b/git-interface/test/t0001-auth.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+test_description='git-auth tests'
+
+. ./setup.sh
+
+test_expect_success 'Test basic authentication.' '
+ "$GIT_AUTH" "$AUTH_KEYTYPE_USER" "$AUTH_KEYTEXT_USER" >out &&
+ grep -q AUR_USER=user out &&
+ grep -q AUR_PRIVILEGED=0 out
+'
+
+test_expect_success 'Test Trusted User authentication.' '
+ "$GIT_AUTH" "$AUTH_KEYTYPE_TU" "$AUTH_KEYTEXT_TU" >out &&
+ grep -q AUR_USER=tu out &&
+ grep -q AUR_PRIVILEGED=1 out
+'
+
+test_done