File: 17-check-trans-fail

package info (click to toggle)
syncmaildir 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,104 kB
  • sloc: ansic: 6,643; sh: 1,780; makefile: 247
file content (38 lines) | stat: -rw-r--r-- 843 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

mpull -t
assert $? 0 "failed mpull -t"

sed -i 's/MAILBOX=.*//' target/.smd/config.default
echo MAILBOX_LOCAL=Mail >> target/.smd/config.default
echo MAILBOX_REMOTE=Mail >> target/.smd/config.default
echo 'TRANSLATOR_RL="../mytr1"'>> target/.smd/config.default
echo 'TRANSLATOR_LR="../mytr2"' >> target/.smd/config.default

mkdir -p Mail/.foo.bar
cp -r Mail/cur Mail/.foo.bar/

cat > mytr1 <<EOT
#!/bin/sh
cat
EOT
cat > mytr2 <<EOT
#!/bin/sh
echo ERROR
echo "I'm designed to fail"
exit 1
EOT
chmod a+x mytr1 mytr2

mcheck
W=`grep 'Error while listing the content of Mail' log.check | wc -l`
assert $W 1 "listing the content of a non existing dir"
W=`grep 'ERROR' log.check | wc -l`
assert $W 3 "Not translating 1"

mpull
assert $? 0 "mpull failed"

mcheck
W=`grep 'ERROR -> ERROR' log.check | wc -l`
assert $W 1 "Not translating 2"