From 9e9968aa292ff0d9e53f3ece7d63710402ab977a Mon Sep 17 00:00:00 2001 From: root Date: Jul 22 2012 12:21:11 +0000 Subject: Merge branch 'master' of https://nazar.karan.org/git/deopsdaysindia --- diff --git a/AUTHORS b/AUTHORS index be5451e..6f5b94a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -7,3 +7,7 @@ Steve Barnes Johnny Hughes Christoph Galuschka Dan Trainor +Nikhil Lanjewar +Sahil Muthoo +Sahil Aggarwal +Saager Mhatre diff --git a/tests/p_0-git/0-install_git.sh b/tests/p_0-git/0-install_git.sh new file mode 100755 index 0000000..872e5e3 --- /dev/null +++ b/tests/p_0-git/0-install_git.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Author: Pratima Singh , Nilesh Bairagi , Madhurranjan Mohaan + +# Install git +t_Log "Running $0 - installing git" + +t_InstallPackage git diff --git a/tests/p_0-git/10-test_git.sh b/tests/p_0-git/10-test_git.sh new file mode 100755 index 0000000..ba249f6 --- /dev/null +++ b/tests/p_0-git/10-test_git.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Author: Pratima Singh , Nilesh Bairagi , Madhurranjan Mohaan + +# Check git installation +git --version +t_CheckExitStatus $? diff --git a/tests/p_0-git/11-test_git_clone.sh b/tests/p_0-git/11-test_git_clone.sh new file mode 100755 index 0000000..f7118dd --- /dev/null +++ b/tests/p_0-git/11-test_git_clone.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Author: Pratima Singh , Nilesh Bairagi , Madhurranjan Mohaan + +# Testing Git clone by comparing SHAs +rm -rf /tmp/temprepo/ /tmp/cloned_repo/ /tmp/testing_clone_repo +temp_repo="/tmp/temprepo" +SHA1=`echo "hello world" | git hash-object --stdin` +mkdir -p $temp_repo +cd $temp_repo +git init . --bare +cd /tmp +git clone $temp_repo cloned_repo +cd cloned_repo +echo "hello world" > hello +git add hello +git commit -m "Temp commit" +git push origin master + +git clone $temp_repo /tmp/testing_clone_repo +cd /tmp/testing_clone_repo +SHA2=`cat hello | git hash-object --stdin` +expr $SHA1 == $SHA2 2>&1 +t_CheckExitStatus $? diff --git a/tests/p_0-git/12-test_git_log.sh b/tests/p_0-git/12-test_git_log.sh new file mode 100755 index 0000000..89d0ba8 --- /dev/null +++ b/tests/p_0-git/12-test_git_log.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Author: Pratima Singh , Nilesh Bairagi , Madhurranjan Mohaan + +# Tsting git log and git commit msgs +rm -rf /tmp/temprepo/ /tmp/cloned_repo/ +temp_repo="/tmp/temprepo" +mkdir -p $temp_repo +cd $temp_repo +git init . --bare +cd /tmp +git clone $temp_repo cloned_repo +cd cloned_repo +echo "hello world" > hello +git add hello +git commit -m "Temp commit" 2>&1 +git log --grep="Temp commit" 2>&1 +t_CheckExitStatus $?