2 # Copyright (C) 2011 Kirill Smelkov <kirr@navytux.spb.ru>
4 test_description
='Test filesystem interface'
8 D
="$TEST_DIRECTORY/t0001"
10 # XXX partially dup from t0001-importexport.sh
11 test_expect_success
'import test mail' '
12 navymail import sup-talk $D/sup-talk.mbox,1-2 &&
13 navymail import sup-talk $D/sup-talk.mbox,3-4 &&
14 navymail import sup-talk $D/sup-talk.mbox,5-17 &&
15 navymail import sup-talk2 $D/sup-talk.mbox,1-17 &&
16 navymail import x/zzz $D/sup-talk.mbox,1-2 &&
17 navymail import x/yyy $D/sup-talk.mbox,3-4 &&
18 navymail import x/y/qqq $D/sup-talk.mbox,5-17 &&
19 navymail import x/y/ddd $D/sup-talk.mbox,17-1
24 trap 'code=$?; navymail_umount; (exit $code); die' EXIT
25 navymail_mountpath
="$(pwd)/$1"
26 navymail mount
"$navymail_mountpath"
30 test -n "$navymail_mountpath" ||
return
32 fusermount
-u "$navymail_mountpath"
37 test_expect_success
'mount it' '
41 test_cmp expect actual &&
45 test_expect_success
'basic filesystem layout' '
46 echo "mail/" >expect &&
48 test_cmp expect actual &&
54 ls -F fs/mail >actual &&
55 test_cmp expect actual &&
61 ls -F fs/mail/x >actual &&
62 test_cmp expect actual &&
67 ls -F fs/mail/x/y >actual &&
68 test_cmp expect actual
71 test_expect_success
'read file content' '
72 cat fs/mail/sup-talk >read1 &&
73 cat fs/mail/sup-talk >read2 &&
74 cat fs/mail/sup-talk >read3 &&
75 test_cmp read1 read2 &&
76 test_cmp read2 read3 &&
77 navymail export --original-order sup-talk >sup-talk.mbox &&
78 cat fs/mail/sup-talk >sup-talk.read &&
79 test_cmp sup-talk.mbox sup-talk.read &&
80 test_cmp sup-talk.read read1 &&
81 test_cmp fs/mail/sup-talk2 $D/sup-talk.mbox,1-17 &&
82 test_cmp fs/mail/x/zzz $D/sup-talk.mbox,1-2 &&
83 test_cmp fs/mail/x/yyy $D/sup-talk.mbox,3-4 &&
84 test_cmp fs/mail/x/y/qqq $D/sup-talk.mbox,5-17 &&
85 test_cmp fs/mail/x/y/ddd $D/sup-talk.mbox,17-1
89 Date: Wed, 31 Oct 2007 09:42:58 +0100
90 Date: Mon, 29 Oct 2007 16:40:37 -0500
91 Date: Mon, 29 Oct 2007 14:43:07 -0700
92 Message-ID: <1193694144-sup-4506@south>
93 Subject: [ANN] Sup 0.2 released
94 Received: from localhost.localdomain
95 Sender: sup-talk-bounces@rubyforge.org
96 - Add custom code to handle certain types of messages or to handle
97 Date: Mon, 29 Oct 2007 18:55:59 -0700
98 Date: Tue, 30 Oct 2007 15:55:18 +0000
100 Date: Tue, 30 Oct 2007 15:55:18 +0000
101 from /Users/brendano/sw/sup/lib/sup/index.rb:323:in \`load_entry_for_id'
104 # tests already-seen msg lookup in navymailfs_read
105 test_expect_success
'read file content seeky' '
106 $TEST_DIRECTORY/xdd \
124 <fs/mail/sup-talk >actual &&
125 test_cmp expect actual