From 6e38309c194d860cccd26f901ee5687502331779 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 4 Aug 2016 20:36:31 +0200 Subject: 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 --- git-interface/test/t0002-serve.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 git-interface/test/t0002-serve.sh (limited to 'git-interface/test/t0002-serve.sh') diff --git a/git-interface/test/t0002-serve.sh b/git-interface/test/t0002-serve.sh new file mode 100755 index 0000000..7e17bcb --- /dev/null +++ b/git-interface/test/t0002-serve.sh @@ -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 -- cgit v1.2.3-70-g09d2