From f982a578c8c5543740ff5a6db91eccf2c6d23e72 Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sun, 4 Feb 2024 14:34:38 +0000 Subject: Add simple test scripts to test git server --- misc/tests/git-server-git-protocol.sh | 18 ++++++++++++++++++ misc/tests/git-server-http-protocol.sh | 28 ++++++++++++++++++++++++++++ misc/tests/git-server-ssh-protocol.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100755 misc/tests/git-server-git-protocol.sh create mode 100755 misc/tests/git-server-http-protocol.sh create mode 100755 misc/tests/git-server-ssh-protocol.sh (limited to 'misc') diff --git a/misc/tests/git-server-git-protocol.sh b/misc/tests/git-server-git-protocol.sh new file mode 100755 index 0000000..a3eccf4 --- /dev/null +++ b/misc/tests/git-server-git-protocol.sh @@ -0,0 +1,18 @@ +#! /usr/bin/env bash + +tmp=`mktemp -d` + +cd $tmp + +# Git protocol +git clone git://git.ilvokhin.com/infra.git > /dev/null 2>&1 + +if [ $? -eq 0 ]; then + echo "git: OK" + rm -rf infra +else + echo "git: FAIL" +fi + +cd - > /dev/null +rm -rf $tmp diff --git a/misc/tests/git-server-http-protocol.sh b/misc/tests/git-server-http-protocol.sh new file mode 100755 index 0000000..818412d --- /dev/null +++ b/misc/tests/git-server-http-protocol.sh @@ -0,0 +1,28 @@ +#! /usr/bin/env bash + +tmp=`mktemp -d` + +cd $tmp + +# HTTP protocol +git clone http://git.ilvokhin.com/infra.git > /dev/null 2>&1 + +if [ $? -eq 0 ]; then + echo "http: OK" + rm -rf infra +else + echo "http: FAIL" +fi + +# HTTPS protocol +git clone https://git.ilvokhin.com/infra.git > /dev/null 2>&1 + +if [ $? -eq 0 ]; then + echo "https: OK" + rm -rf infra +else + echo "https: FAIL" +fi + +cd - > /dev/null +rm -rf $tmp diff --git a/misc/tests/git-server-ssh-protocol.sh b/misc/tests/git-server-ssh-protocol.sh new file mode 100755 index 0000000..b1a063f --- /dev/null +++ b/misc/tests/git-server-ssh-protocol.sh @@ -0,0 +1,28 @@ +#! /usr/bin/env bash + +tmp=`mktemp -d` + +cd $tmp + +# SSH protocol +git clone git@git.ilvokhin.com:infra.git > /dev/null 2>&1 + +if [ $? -eq 0 ]; then + echo "ssh: OK" + rm -rf infra +else + echo "ssh: FAIL" +fi + +# SSH protocol absolute path +git clone ssh://git@git.ilvokhin.com:/srv/git/infra.git > /dev/null 2>&1 + +if [ $? -eq 0 ]; then + echo "ssh absolute: OK" + rm -rf infra +else + echo "ssh absolute: FAIL" +fi + +cd - > /dev/null +rm -rf $tmp -- cgit v1.2.3-70-g09d2