~ubuntu-branches/ubuntu/precise/dbacl/precise

« back to all changes in this revision

Viewing changes to src/tests/dbacl-o.shin

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2005-05-07 12:59:53 UTC
  • Revision ID: james.westby@ubuntu.com-20050507125953-xzy2bwkb2qamglwm
Tags: upstream-1.9
ImportĀ upstreamĀ versionĀ 1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# test basic dbacl -a switch
 
3
PATH=/bin:/usr/bin
 
4
DBACL=$TESTBIN/dbacl
 
5
 
 
6
prerequisite_command() {
 
7
    type $2 2>&1 > /dev/null
 
8
    if [ 0 -ne $? ]; then
 
9
        echo "$1: $2 not found, test will be skipped"
 
10
        exit 77
 
11
    fi
 
12
}
 
13
 
 
14
prerequisite_command $0 grep
 
15
 
 
16
DBACL_PATH="`pwd`/`basename $0 .sh`_`date +"%Y%m%dT%H%M%S"`"
 
17
export DBACL_PATH
 
18
 
 
19
mkdir "$DBACL_PATH"
 
20
 
 
21
(echo "From -" ; cat sample.spam-1 ; echo ; echo "From -" ; cat sample.spam-2) \
 
22
    | $DBACL -0 -l dummy -T email
 
23
head -3 $DBACL_PATH/dummy \
 
24
    | grep '^# hash' \
 
25
    > $DBACL_PATH/out1
 
26
 
 
27
(echo "From -" ; cat sample.spam-1) \
 
28
    | $DBACL -0 -l dummy -T email -o dummy.onl
 
29
(echo "From -" ; cat sample.spam-2) \
 
30
    | $DBACL -0 -l dummy -T email -o dummy.onl
 
31
head -3 $DBACL_PATH/dummy \
 
32
    | grep '^# hash' \
 
33
    > $DBACL_PATH/out2
 
34
 
 
35
test x"`cat $DBACL_PATH/out1`" = x"`cat $DBACL_PATH/out2`"
 
36
 
 
37
RESULT=$?
 
38
rm -rf "$DBACL_PATH"
 
39
 
 
40
exit $RESULT
 
 
b'\\ No newline at end of file'