From 1a6dbe7ff4ac5b5cc855f03eb8d01a2b5c559b46 Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Jul 22 2012 14:49:19 +0000 Subject: move the git tests into place --- diff --git a/tests/p_0-git/0-install_git.sh b/tests/p_0-git/0-install_git.sh deleted file mode 100755 index 872e5e3..0000000 --- a/tests/p_0-git/0-install_git.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/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 deleted file mode 100755 index ba249f6..0000000 --- a/tests/p_0-git/10-test_git.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 deleted file mode 100755 index f7118dd..0000000 --- a/tests/p_0-git/11-test_git_clone.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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 deleted file mode 100755 index 89d0ba8..0000000 --- a/tests/p_0-git/12-test_git_log.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/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 $? diff --git a/tests/p_git/0-install_git.sh b/tests/p_git/0-install_git.sh new file mode 100755 index 0000000..872e5e3 --- /dev/null +++ b/tests/p_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_git/10-test_git.sh b/tests/p_git/10-test_git.sh new file mode 100755 index 0000000..ba249f6 --- /dev/null +++ b/tests/p_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_git/11-test_git_clone.sh b/tests/p_git/11-test_git_clone.sh new file mode 100755 index 0000000..f7118dd --- /dev/null +++ b/tests/p_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_git/12-test_git_log.sh b/tests/p_git/12-test_git_log.sh new file mode 100755 index 0000000..89d0ba8 --- /dev/null +++ b/tests/p_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 $?