~ubuntu-branches/ubuntu/dapper/dbacl/dapper

« back to all changes in this revision

Viewing changes to src/tests/email-mbox.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 mbox parsing
 
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 head
 
15
prerequisite_command $0 grep
 
16
prerequisite_command $0 cut
 
17
 
 
18
DBACL_PATH="`pwd`/`basename $0 .sh`_`date +"%Y%m%dT%H%M%S"`"
 
19
export DBACL_PATH
 
20
 
 
21
mkdir "$DBACL_PATH"
 
22
 
 
23
(echo "From -" ; cat sample.spam-1 ; echo ; echo "From -" ; cat sample.spam-2) \
 
24
    | $DBACL -l dummy -T email \
 
25
    > "$DBACL_PATH/out"
 
26
NUM=`head -3 "$DBACL_PATH/dummy" | grep '# hash_size' | cut -d ' ' -f 9`
 
27
 
 
28
rm -rf "$DBACL_PATH"
 
29
 
 
30
test x$NUM = x"2"
 
 
b'\\ No newline at end of file'