1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/tests.sh

867 lines
16 KiB
Bash
Raw Normal View History

2011-03-12 03:39:59 +01:00
#!/bin/sh
2011-03-12 03:44:30 +01:00
# $Id: tests.sh,v 1.57 2006/12/10 02:48:14 gilles Exp gilles $
2011-03-12 03:39:59 +01:00
#### Shell pragmas
2011-03-12 03:43:43 +01:00
exec 3>&2 #
#set -x # debug mode. See what is running
set -e # exit on first failure
2011-03-12 03:39:59 +01:00
#### functions definitions
echo3() {
#echo '#####################################################' >&3
echo "$*" >&3
}
run_test() {
echo3 "#### $test_count $1"
$1
if test x"$?" = x"0"; then
echo "$1 passed"
else
echo "$1 failed" >&2
fi
}
run_tests() {
for t in $*; do
test_count=`expr 1 + $test_count`
run_test $t
sleep 1
done
}
#### Variable definitions
test_count=0
##### The tests functions
perl_syntax() {
2011-03-12 03:43:46 +01:00
perl -c ./imapsync
2011-03-12 03:39:59 +01:00
}
no_args() {
2011-03-12 03:43:46 +01:00
./imapsync
2011-03-12 03:39:59 +01:00
}
2011-03-12 03:44:29 +01:00
# list of accounts on plume :
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:29 +01:00
# toto@est.belle # used on first_sync()
# bad_login()
# bad_host()
# titi@est.belle # used on first_sync()
# bad_host()
# locallocal()
# tata@est.belle # used on locallocal()
2011-03-12 03:44:30 +01:00
# tata titi on most ll_*() tests
2011-03-12 03:44:29 +01:00
# tutu@est.belle # not used
# tete@est.belle # used on big size tests
# big_transfert()
# big_transfert_sizes_only()
# dprof()
2011-03-12 03:39:59 +01:00
2011-03-12 03:43:48 +01:00
sendtestmessage() {
rand=`pwgen 16 1`
mess='test:'$rand
2011-03-12 03:44:29 +01:00
cmd="echo $mess""| mail -s ""$mess"" tata@est.belle"
2011-03-12 03:43:48 +01:00
echo $cmd
2011-03-12 03:44:29 +01:00
eval "$cmd"
2011-03-12 03:43:48 +01:00
}
2011-03-12 03:44:29 +01:00
first_sync() {
./imapsync \
--host1 localhost --user1 toto@est.belle \
--passfile1 /var/tmp/secret1 \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--noauthmd5
2011-03-12 03:39:59 +01:00
}
2011-03-12 03:44:29 +01:00
locallocal() {
2011-03-12 03:44:12 +01:00
if test X`hostname` = X"plume"; then
echo3 Here is plume
sendtestmessage
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:44:12 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:12 +01:00
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_folder() {
2011-03-12 03:39:59 +01:00
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:46 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.yop --folder INBOX.Trash
2011-03-12 03:39:59 +01:00
else
:
fi
}
2011-03-12 03:44:30 +01:00
ll_folderrec() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folderrec INBOX.yop
else
:
fi
}
2011-03-12 03:43:43 +01:00
2011-03-12 03:44:29 +01:00
ll_buffersize() {
2011-03-12 03:44:15 +01:00
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:44:15 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:15 +01:00
--buffersize 8
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_justfolders() {
2011-03-12 03:44:08 +01:00
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:44:08 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:23 +01:00
--justfolders
2011-03-12 03:44:08 +01:00
else
:
fi
}
2011-03-12 03:43:48 +01:00
2011-03-12 03:44:29 +01:00
ll_prefix12() {
2011-03-12 03:43:47 +01:00
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:48 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:47 +01:00
--folder INBOX.qqq \
2011-03-12 03:44:19 +01:00
--prefix1 INBOX.\
2011-03-12 03:44:29 +01:00
--prefix2 INBOX.
2011-03-12 03:44:19 +01:00
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_internaldate() {
2011-03-12 03:43:48 +01:00
if test X`hostname` = X"plume"; then
echo3 Here is plume
sendtestmessage
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:48 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX \
2011-03-12 03:43:48 +01:00
--syncinternaldates
else
:
fi
}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:29 +01:00
ll_folder_rev() {
2011-03-12 03:43:43 +01:00
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 titi@est.belle \
--passfile1 /var/tmp/secret.titi \
--host2 localhost --user2 tata@est.belle \
--passfile2 /var/tmp/secret.tata \
--folder INBOX.yop
2011-03-12 03:43:43 +01:00
else
:
fi
}
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:29 +01:00
ll_subscribed()
2011-03-12 03:43:48 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:48 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:48 +01:00
--subscribed
else
:
fi
2011-03-12 03:43:49 +01:00
}
2011-03-12 03:43:48 +01:00
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:29 +01:00
ll_subscribe()
2011-03-12 03:43:49 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:49 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:49 +01:00
--subscribed --subscribe
else
:
fi
2011-03-12 03:43:48 +01:00
}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:29 +01:00
ll_justconnect()
2011-03-12 03:44:20 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host2 localhost \
--host1 localhost \
2011-03-12 03:44:20 +01:00
--justconnect
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_justfoldersizes()
2011-03-12 03:43:50 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:50 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:20 +01:00
--justfoldersizes
2011-03-12 03:43:50 +01:00
else
:
fi
}
2011-03-12 03:44:20 +01:00
2011-03-12 03:44:29 +01:00
ll_authmd5()
2011-03-12 03:43:50 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:50 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes --authmd5
2011-03-12 03:43:50 +01:00
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_noauthmd5()
2011-03-12 03:43:53 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:53 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:23 +01:00
--justfoldersizes --noauthmd5
2011-03-12 03:43:53 +01:00
else
:
fi
}
2011-03-12 03:43:50 +01:00
2011-03-12 03:44:29 +01:00
ll_maxage()
2011-03-12 03:43:50 +01:00
{
sendtestmessage
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:50 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:50 +01:00
--maxage 1
else
:
fi
}
2011-03-12 03:43:54 +01:00
2011-03-12 03:44:29 +01:00
ll_maxsize()
2011-03-12 03:43:50 +01:00
{
sendtestmessage
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:50 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:50 +01:00
--maxsize 10
else
:
fi
}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:29 +01:00
ll_skipsize()
2011-03-12 03:43:54 +01:00
{
sendtestmessage
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:54 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:54 +01:00
--skipsize --folder INBOX.yop.yap
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_skipheader()
2011-03-12 03:43:54 +01:00
{
sendtestmessage
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:54 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:54 +01:00
--skipheader 'X-.*' --folder INBOX.yop.yap
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_include()
2011-03-12 03:43:51 +01:00
{
sendtestmessage
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:51 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:21 +01:00
--include '^INBOX.yop'
2011-03-12 03:43:51 +01:00
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_regextrans2()
2011-03-12 03:43:55 +01:00
{
sendtestmessage
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:55 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:43:55 +01:00
--regextrans2 's/yop/yopX/' --dry
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_sep2()
2011-03-12 03:44:06 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:44:06 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:06 +01:00
--folder INBOX.yop.yap \
--sep2 '\\' --dry
else
:
fi
}
2011-03-12 03:44:29 +01:00
ll_bad_login()
2011-03-12 03:43:53 +01:00
{
! ./imapsync \
--host1 localhost --user1 toto@est.belle \
--passfile1 /var/tmp/secret1 \
--host2 localhost --user2 notiti@est.belle \
--passfile2 /var/tmp/secret2
}
2011-03-12 03:44:29 +01:00
ll_bad_host()
2011-03-12 03:43:53 +01:00
{
! ./imapsync \
2011-03-12 03:44:23 +01:00
--host1 badhost --user1 toto@est.belle \
2011-03-12 03:43:53 +01:00
--passfile1 /var/tmp/secret1 \
--host2 badhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret2
}
2011-03-12 03:43:56 +01:00
2011-03-12 03:44:29 +01:00
ll_justfoldersizes()
2011-03-12 03:43:56 +01:00
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
2011-03-12 03:44:29 +01:00
--host1 localhost --user1 tata@est.belle \
2011-03-12 03:43:56 +01:00
--passfile1 /var/tmp/secret.tata \
2011-03-12 03:44:29 +01:00
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
2011-03-12 03:44:23 +01:00
--justfoldersizes
2011-03-12 03:43:56 +01:00
else
:
fi
2011-03-12 03:44:29 +01:00
}
2011-03-12 03:43:56 +01:00
2011-03-12 03:44:29 +01:00
ll_useheader()
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.yop.yap \
--useheader 'Message-ID' \
--dry --debug
echo 'rm /home/vmail/tata/.yop.yap/cur/*'
else
:
fi
2011-03-12 03:43:56 +01:00
}
2011-03-12 03:44:29 +01:00
ll_regexmess()
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.yop.yap \
--regexmess 's/\157/O/g' \
--regexmess 's/p/Z/g' \
--dry --debug
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
else
:
fi
}
ll_flags()
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.yop.yap \
--dry --debug
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
else
:
fi
}
ll_regex_flag()
{
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.yop.yap \
--dry --debug --regexflag 's/\\Answered/\\AnXweXed/g'
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
else
:
fi
}
ll_ssl() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--ssl1 --ssl2
else
:
fi
}
ll_authmech_PLAIN() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes --nofoldersizes \
--authmech1 PLAIN --authmech2 PLAIN
else
:
fi
}
ll_authuser() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes --nofoldersizes \
--authuser2 titi@est.belle
else
:
fi
}
ll_authmech_LOGIN() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes --nofoldersizes \
--authmech1 LOGIN --authmech2 LOGIN
else
:
fi
}
ll_authmech_CRAMMD5() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--justfoldersizes --nofoldersizes \
--authmech1 CRAM-MD5 --authmech2 CRAM-MD5
else
:
fi
}
ll_delete2() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX \
--delete2 --expunge2
else
:
fi
}
2011-03-12 03:44:30 +01:00
ll_bigmail() {
if test X`hostname` = X"plume"; then
echo3 Here is plume
./imapsync \
--host1 localhost --user1 tata@est.belle \
--passfile1 /var/tmp/secret.tata \
--host2 localhost --user2 titi@est.belle \
--passfile2 /var/tmp/secret.titi \
--folder INBOX.bigmail
else
:
fi
}
2011-03-12 03:44:29 +01:00
##########################
# specific tests
##########################
2011-03-12 03:43:55 +01:00
big_transfert()
{
date1=`date`
{ ./imapsync \
--host1 louloutte --user1 gilles \
--passfile1 /var/tmp/secret \
--host2 plume --user2 tete@est.belle \
--passfile2 /var/tmp/secret.tete \
2011-03-12 03:44:11 +01:00
--subscribed --foldersizes --noauthmd5 \
2011-03-12 03:44:15 +01:00
--fast --folder INBOX.Backup \
--useheader Message-ID --useheader Received || \
2011-03-12 03:44:01 +01:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
}
big_transfert_sizes_only()
{
date1=`date`
{ ./imapsync \
--host1 louloutte --user1 gilles \
--passfile1 /var/tmp/secret \
--host2 plume --user2 tete@est.belle \
--passfile2 /var/tmp/secret.tete \
2011-03-12 03:44:23 +01:00
--subscribed --noauthmd5 \
--justfoldersizes || \
2011-03-12 03:43:55 +01:00
true
}
date2=`date`
2011-03-12 03:44:01 +01:00
echo3 "[$date1] [$date2]"
2011-03-12 03:43:55 +01:00
}
2011-03-12 03:43:51 +01:00
2011-03-12 03:44:01 +01:00
2011-03-12 03:44:06 +01:00
dprof()
2011-03-12 03:44:01 +01:00
{
date1=`date`
{ perl -d:DProf ./imapsync \
--host1 louloutte --user1 gilles \
--passfile1 /var/tmp/secret \
--host2 plume --user2 tete@est.belle \
--passfile2 /var/tmp/secret.tete \
--subscribed --foldersizes --noauthmd5 \
2011-03-12 03:44:06 +01:00
--folder INBOX.Trash || \
2011-03-12 03:44:01 +01:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
dprofpp tmon.out
}
2011-03-12 03:44:06 +01:00
essnet_justconnect()
{
./imapsync \
--host1 mail2.softwareuno.com \
--user1 gilles@mail2.softwareuno.com \
--passfile1 /var/tmp/secret.prw \
--host2 mail.softwareuno.com \
--user2 gilles@softwareuno.com \
--passfile2 /var/tmp/secret.prw \
--dry --noauthmd5 --sep1 / --foldersizes --justconnect
}
essnet_mail2_mail()
{
./imapsync \
--host1 mail2.softwareuno.com \
--user1 gilles@mail2.softwareuno.com \
--passfile1 /var/tmp/secret.prw \
--host2 mail.softwareuno.com \
--user2 gilles@softwareuno.com \
--passfile2 /var/tmp/secret.prw \
--noauthmd5 --sep1 / --foldersizes \
2011-03-12 03:44:11 +01:00
--prefix2 "INBOX/" --regextrans2 's<>INBOX/INBOX<4F>INBOX<4F>'
2011-03-12 03:44:06 +01:00
}
essnet_mail2_mail_t123()
{
for user1 in test1 test2 test3; do
./imapsync \
--host1 mail2.softwareuno.com \
--user1 ${user1}@mail2.softwareuno.com \
--passfile1 /var/tmp/secret.prw \
--host2 mail.softwareuno.com \
--user2 gilles@softwareuno.com \
--passfile2 /var/tmp/secret.prw \
--noauthmd5 --sep1 / --foldersizes \
2011-03-12 03:44:11 +01:00
--prefix2 "INBOX/" --regextrans2 's<>INBOX/INBOX<4F>INBOX<4F>' \
2011-03-12 03:44:23 +01:00
--debug \
2011-03-12 03:44:06 +01:00
|| true
done
}
essnet_plume2()
{
./imapsync \
--host1 mail2.softwareuno.com \
--user1 gilles@mail2.softwareuno.com \
--passfile1 /var/tmp/secret.prw \
--host2 plume --user2 tata@est.belle \
--passfile2 /var/tmp/secret.tata \
2011-03-12 03:44:11 +01:00
--noauthmd5 --sep1 / --foldersizes \
2011-03-12 03:44:14 +01:00
--prefix2 INBOX. --regextrans2 's<>INBOX.INBOX<4F>INBOX<4F>'
2011-03-12 03:44:06 +01:00
}
2011-03-12 03:44:17 +01:00
dynamicquest_1()
{
perl -I bugs/lib ./imapsync \
--host1 69.38.48.81 \
--user1 testuser1@dq.com \
--passfile1 /var/tmp/secret.dynamicquest \
--host2 69.38.48.81 \
--user2 testuser2@dq.com \
--passfile2 /var/tmp/secret.dynamicquest \
--noauthmd5 --sep1 "/" --sep2 "/" \
--justconnect --dry
}
dynamicquest_2()
{
perl -I bugs/lib ./imapsync \
--host1 mail.dynamicquest.com \
--user1 gomez \
--passfile1 /var/tmp/secret.dynamicquestgomez \
--host2 69.38.48.81 \
--user2 testuser2@dq.com \
--passfile2 /var/tmp/secret.dynamicquest \
--noauthmd5 \
--justconnect --dry
}
dynamicquest_3()
{
perl -I bugs/lib ./imapsync \
--host1 loul \
--user1 tata \
--passfile1 /var/tmp/secret.tata \
--host2 69.38.48.81 \
--user2 testuser2@dq.com \
--passfile2 /var/tmp/secret.dynamicquest \
--noauthmd5 --sep2 "/" --debug --debugimap
}
2011-03-12 03:44:29 +01:00
##########################
##########################
2011-03-12 03:44:17 +01:00
2011-03-12 03:44:23 +01:00
2011-03-12 03:39:59 +01:00
# mandatory tests
run_tests perl_syntax
# All tests
2011-03-12 03:43:56 +01:00
# lp : louloutte -> plume
# pl : plume -> louloutte
2011-03-12 03:39:59 +01:00
test $# -eq 0 && run_tests \
no_args \
first_sync \
2011-03-12 03:44:29 +01:00
locallocal \
ll_folder \
ll_buffersize \
ll_justfolders \
ll_prefix12 \
ll_internaldate \
ll_folder_rev \
ll_subscribed \
ll_subscribe \
ll_justconnect \
ll_justfoldersizes \
ll_authmd5 \
ll_noauthmd5 \
ll_maxage \
ll_maxsize \
ll_skipsize \
ll_skipheader \
ll_include \
ll_regextrans2 \
ll_sep2 \
ll_bad_login \
ll_bad_host \
ll_justfoldersizes \
ll_useheader \
ll_regexmess \
ll_flags \
ll_regex_flag \
ll_ssl \
ll_authmech_PLAIN \
ll_authmech_LOGIN \
ll_authmech_CRAMMD5 \
ll_authuser \
2011-03-12 03:44:30 +01:00
ll_delete2 \
ll_folderrec
2011-03-12 03:44:15 +01:00
2011-03-12 03:44:11 +01:00
2011-03-12 03:39:59 +01:00
# selective tests
test $# -gt 0 && run_tests $*
# If there, all is good
echo3 ALL $test_count TESTS SUCCESSFUL