From: Miek Gieben Date: Wed, 22 Mar 2006 16:31:55 +0000 (+0000) Subject: test for drill -f /urandom. Nice fuzzy test X-Git-Tag: release-1.1.0~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebde08a4a011bf7947eeab96625395cd89aa1ef7;p=thirdparty%2Fldns.git test for drill -f /urandom. Nice fuzzy test --- diff --git a/test/14-drill-random.tpkg b/test/14-drill-random.tpkg new file mode 100644 index 00000000..53f8ba5b --- /dev/null +++ b/test/14-drill-random.tpkg @@ -0,0 +1,167 @@ +#!/bin/sh +# This is a shell archive (produced by GNU sharutils 4.2.1). +# To extract the files from this archive, save it to some FILE, remove +# everything before the `!/bin/sh' line above, then type `sh FILE'. +# +# Made on 2006-03-22 17:31 CET by . +# Source directory was `/home/miekg/svn/ldns/trunk/test/14-drill-random.dir'. +# +# Existing files will *not* be overwritten unless `-c' is specified. +# +# This shar contains: +# length mode name +# ------ ---------- ------------------------------------------ +# 273 -rw------- 14-drill-random.dsc +# 23 -rw------- 14-drill-random.help +# 252 -rw------- 14-drill-random.test +# +save_IFS="${IFS}" +IFS="${IFS}:" +gettext_dir=FAILED +locale_dir=FAILED +first_param="$1" +for dir in $PATH +do + if test "$gettext_dir" = FAILED && test -f $dir/gettext \ + && ($dir/gettext --version >/dev/null 2>&1) + then + set `$dir/gettext --version 2>&1` + if test "$3" = GNU + then + gettext_dir=$dir + fi + fi + if test "$locale_dir" = FAILED && test -f $dir/shar \ + && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) + then + locale_dir=`$dir/shar --print-text-domain-dir` + fi +done +IFS="$save_IFS" +if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED +then + echo=echo +else + TEXTDOMAINDIR=$locale_dir + export TEXTDOMAINDIR + TEXTDOMAIN=sharutils + export TEXTDOMAIN + echo="$gettext_dir/gettext -s" +fi +if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then + shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' +elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' +elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$2 "$8"' +else + shar_touch=: + echo + $echo 'WARNING: not restoring timestamps. Consider getting and' + $echo "installing GNU \`touch', distributed in GNU File Utilities..." + echo +fi +rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch +# +if mkdir _sh20974; then + $echo 'x -' 'creating lock directory' +else + $echo 'failed to create lock directory' + exit 1 +fi +# ============= 14-drill-random.dsc ============== +if test -f '14-drill-random.dsc' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '14-drill-random.dsc' '(file already exists)' +else + $echo 'x -' extracting '14-drill-random.dsc' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '14-drill-random.dsc' && +BaseName: 14-drill-random +Version: 1.0 +Description: drill -f /dev/urandom test +CreationDate: Wed Mar 22 17:28:14 CET 2006 +Maintainer: Miek Gieben +Category: +Component: +Depends: +Help: 14-drill-random.help +Pre: +Post: +Test: 14-drill-random.test +AuxFiles: +Passed: +Failure: +SHAR_EOF + (set 20 06 03 22 17 28 39 '14-drill-random.dsc'; eval "$shar_touch") && + chmod 0600 '14-drill-random.dsc' || + $echo 'restore of' '14-drill-random.dsc' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '14-drill-random.dsc:' 'MD5 check failed' +6e3f5a96c01f1b08e879078169067741 14-drill-random.dsc +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '14-drill-random.dsc'`" + test 273 -eq "$shar_count" || + $echo '14-drill-random.dsc:' 'original size' '273,' 'current size' "$shar_count!" + fi +fi +# ============= 14-drill-random.help ============== +if test -f '14-drill-random.help' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '14-drill-random.help' '(file already exists)' +else + $echo 'x -' extracting '14-drill-random.help' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '14-drill-random.help' && +No argument are needed +SHAR_EOF + (set 20 06 03 22 17 28 52 '14-drill-random.help'; eval "$shar_touch") && + chmod 0600 '14-drill-random.help' || + $echo 'restore of' '14-drill-random.help' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '14-drill-random.help:' 'MD5 check failed' +51a269204de52a84c0d24c774b445f1b 14-drill-random.help +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '14-drill-random.help'`" + test 23 -eq "$shar_count" || + $echo '14-drill-random.help:' 'original size' '23,' 'current size' "$shar_count!" + fi +fi +# ============= 14-drill-random.test ============== +if test -f '14-drill-random.test' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '14-drill-random.test' '(file already exists)' +else + $echo 'x -' extracting '14-drill-random.test' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '14-drill-random.test' && +[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master +X +export PATH=$PATH:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:. +X +LD_LIBRARY_PATH=../../lib \ +X../../drill/drill -f /dev/urandom +X +if [[ $? -eq 1 ]]; then +X exit 0 +else +X exit 1 +fi +SHAR_EOF + (set 20 06 03 22 17 31 23 '14-drill-random.test'; eval "$shar_touch") && + chmod 0600 '14-drill-random.test' || + $echo 'restore of' '14-drill-random.test' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '14-drill-random.test:' 'MD5 check failed' +16812cc9399375256f4da68fbc3232ac 14-drill-random.test +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '14-drill-random.test'`" + test 252 -eq "$shar_count" || + $echo '14-drill-random.test:' 'original size' '252,' 'current size' "$shar_count!" + fi +fi +rm -fr _sh20974 +exit 0