From d0b9415d58b3472137e04efda41d85fcd6d4aee0 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Jul 25 2013 11:35:31 +0000 Subject: fixed 10-findutils - the checksum is the same on C5 and C6 --- diff --git a/tests/p_findutils/0-install_findutils b/tests/p_findutils/0-install_findutils new file mode 100755 index 0000000..01c525c --- /dev/null +++ b/tests/p_findutils/0-install_findutils @@ -0,0 +1,5 @@ +#!/bin/bash +# Author: Iain Douglas + +t_Log "$0 - installing findutils" +t_InstallPackage findutils diff --git a/tests/p_findutils/10-find_tests b/tests/p_findutils/10-find_tests new file mode 100755 index 0000000..211661f --- /dev/null +++ b/tests/p_findutils/10-find_tests @@ -0,0 +1,36 @@ +#!/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" ]] +#else + [[ "$checksum" == "789e232a7e4f19cee9be7d6e3ebbef3b" ]] + t_CheckExitStatus $? +#fi + + + diff --git a/tests/p_findutils/20-xargs_tests b/tests/p_findutils/20-xargs_tests new file mode 100755 index 0000000..8f57aee --- /dev/null +++ b/tests/p_findutils/20-xargs_tests @@ -0,0 +1,17 @@ +#!/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"