diff --git a/p_findutils/0-install_findutils b/p_findutils/0-install_findutils deleted file mode 100755 index 01c525c..0000000 --- a/p_findutils/0-install_findutils +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Author: Iain Douglas - -t_Log "$0 - installing findutils" -t_InstallPackage findutils diff --git a/p_findutils/10-find_tests b/p_findutils/10-find_tests deleted file mode 100755 index e42b58a..0000000 --- a/p_findutils/10-find_tests +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Author: Iain Douglas -# - -echo "Running $0" -TMPDIR=/var/tmp/find - -[[ -e "$TMPDIR" ]] && rm -rf "$TMPDIR" - -mkdir -p "$TMPDIR" || { t_Log "FAIL: Can't create working area $TMPDIR" ; exit $FAIL; } -touch "$TMPDIR"/file1 -touch "$TMPDIR"/"file space" -# Basic find tests -echo "Basic find tests" - -find "$TMPDIR" &>/dev/null -t_CheckExitStatus $? - -# Check find fails for non existent directory -echo "Check find fails for non existent directory" -find "$TMPDIR"/1 &>/dev/null && { t_Log "FAIL: find incorrectly exited with 0 status"; exit $FAIL ; } -t_Log "PASS" - -# Check print0 works so we can use it for an xargs test -echo "Test -print0" -checksum=$( find "$TMPDIR" -print0 | md5sum - | awk '{print $1}') -if (( $centos_ver == 6 )) -then - [[ "$checksum" == "6105e5998b2d6feea56c80cf279bc24b" ]] - t_CheckExitStatus $? -else - [[ "$checksum" == "789e232a7e4f19cee9be7d6e3ebbef3b" ]] -fi - - - diff --git a/p_findutils/20-xargs_tests b/p_findutils/20-xargs_tests deleted file mode 100755 index 8f57aee..0000000 --- a/p_findutils/20-xargs_tests +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -echo "Running $0" -TMPDIR=/var/tmp/find -# Basic xargs tests - -echo "Basic xargs tests" -find "$TMPDIR" -type f -print0 | xargs -0 ls &>/dev/null -#ls -l >/dev/null -t_CheckExitStatus $? - -echo "Check xargs fails when filenames with spaces are passed in" -find "$TMPDIR" -type f | xargs ls &>/dev/null && { t_Log "FAIL: This test returned 0 status incorrectly"; exit $FAIL; } -t_Log "PASS" - - -# Cleanup -[[ -d "$TMPDIR" ]] && rm -rf "$TMPDIR" diff --git a/tests/p_findutils/10-find_tests b/tests/p_findutils/10-find_tests index 211661f..279e2f7 100755 --- a/tests/p_findutils/10-find_tests +++ b/tests/p_findutils/10-find_tests @@ -23,14 +23,10 @@ t_Log "PASS" # Check print0 works so we can use it for an xargs test echo "Test -print0" -checksum=$( find "$TMPDIR" -print0 | md5sum - | awk '{print $1}') -#if (( $centos_ver == 6 )) -#then -# [[ "$checksum" == "6105e5998b2d6feea56c80cf279bc24b" ]] -#else - [[ "$checksum" == "789e232a7e4f19cee9be7d6e3ebbef3b" ]] - t_CheckExitStatus $? -#fi - - +lines_count=$( find "$TMPDIR" -print0 | wc -l ) +if [ $lines_count -eq 0 ] ; then + t_CheckExitStatus 0 +else + t_CheckExitStatus 1 +fi