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

1327 lines
35 KiB
Bash
Raw Normal View History

2011-03-12 03:39:59 +01:00
#!/bin/sh
2011-03-12 03:45:02 +01:00
# $Id: tests.sh,v 1.127 2010/10/25 17:59:09 gilles Exp gilles $
2011-03-12 03:44:47 +01:00
2011-03-12 03:45:01 +01:00
# Example 1:
2011-03-12 03:44:57 +01:00
# CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' sh -x tests.sh
2011-03-12 03:44:47 +01:00
2011-03-12 03:45:01 +01:00
# Example 2:
# To select which Mail-IMAPClient within arguments:
# sh -x tests.sh 2 locallocal 3 locallocal
2011-03-12 03:45:02 +01:00
# This runs locallocal() with Mail-IMAPClient-2.2.9 then
2011-03-12 03:45:01 +01:00
# again with Mail-IMAPClient-3.xx
2011-03-12 03:45:02 +01:00
# 2 means "use Mail-IMAPClient-2.2.9"
# 3 means "use Mail-IMAPClient-3.xx"
2011-03-12 03:44:47 +01:00
HOST1=${HOST1:-'localhost'}
echo HOST1=$HOST1
HOST2=${HOST2:-'localhost'}
echo HOST2=$HOST2
2011-03-12 03:44:57 +01:00
# most tests use:
2011-03-12 03:44:47 +01:00
CMD_PERL=${CMD_PERL:-'perl -I./Mail-IMAPClient-2.2.9'}
2011-03-12 03:39:59 +01:00
2011-03-12 03:44:57 +01:00
# few debugging tests use:
CMD_PERL_2xx='perl -I./Mail-IMAPClient-2.2.9'
CMD_PERL_3xx='perl -I./Mail-IMAPClient-3.25/lib'
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() {
2011-03-12 03:44:36 +01:00
#echo '#####################################################' >&3
2011-03-12 03:44:47 +01:00
echo "$@" >&3
2011-03-12 03:39:59 +01:00
}
run_test() {
2011-03-12 03:44:36 +01:00
echo3 "#### $test_count $1"
$1
if test x"$?" = x"0"; then
echo "$1 passed"
else
echo "$1 failed" >&2
fi
2011-03-12 03:39:59 +01:00
}
run_tests() {
2011-03-12 03:44:36 +01:00
for t in "$@"; do
2011-03-12 03:45:01 +01:00
test X"$t" = X2 && CMD_PERL=$CMD_PERL_2xx && continue
test X"$t" = X3 && CMD_PERL=$CMD_PERL_3xx && continue
2011-03-12 03:44:36 +01:00
test_count=`expr 1 + $test_count`
run_test "$t"
2011-03-12 03:44:56 +01:00
#sleep 1
2011-03-12 03:44:36 +01:00
done
2011-03-12 03:39:59 +01:00
}
#### Variable definitions
test_count=0
##### The tests functions
perl_syntax() {
2011-03-12 03:44:47 +01:00
$CMD_PERL -c ./imapsync
2011-03-12 03:39:59 +01:00
}
no_args() {
2011-03-12 03:44:47 +01:00
$CMD_PERL ./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:47 +01:00
# mailbox toto used on first_sync()
# bad_login()
# bad_host()
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:47 +01:00
# mailbox titi used on first_sync()
# bad_host()
# locallocal()
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:47 +01:00
# mailbox tata used on locallocal()
2011-03-12 03:44:29 +01:00
2011-03-12 03:44:47 +01:00
# mailbox tata titi on most ll_*() tests
2011-03-12 03:44:30 +01:00
2011-03-12 03:45:02 +01:00
# mailbox tete@est.belle used on big size tests:
# big_transfert()
# big_transfert_sizes_only()
# dprof()
# mailbox big1 big2 used on bigmail tests
# ll_bigmail()
# ll_memory_consumption
2011-03-12 03:39:59 +01:00
2011-03-12 03:43:48 +01:00
sendtestmessage() {
2011-03-12 03:44:47 +01:00
email=${1:-"tata"}
2011-03-12 03:43:48 +01:00
rand=`pwgen 16 1`
mess='test:'$rand
2011-03-12 03:44:35 +01:00
cmd="echo $mess""| mail -s ""$mess"" $email"
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
2011-03-12 03:44:48 +01:00
can_send() {
test X`hostname` = X"plume" && return 0;
test X`hostname` = X"vadrouille" && return 0;
2011-03-12 03:45:01 +01:00
test X`hostname` = X"petite" && return 0;
2011-03-12 03:44:48 +01:00
return 1
}
2011-03-12 03:44:35 +01:00
zzzz() {
2011-03-12 03:44:36 +01:00
$CMD_PERL -V
2011-03-12 03:44:35 +01:00
}
option_version() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync --version
2011-03-12 03:44:35 +01:00
}
option_tests() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync --tests
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:45:02 +01:00
option_tests_debug() {
$CMD_PERL ./imapsync --tests_debug
}
2011-03-12 03:44:47 +01:00
option_bad_delete2() {
! $CMD_PERL ./imapsync --delete 2 --blabla
}
passwords_masked() {
$CMD_PERL ./imapsync --host1 boumboum --password1 secret --justbanner | grep MASKED
}
2011-03-12 03:44:35 +01:00
first_sync_dry() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--noauthmd5 --dry
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:44:29 +01:00
first_sync() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--noauthmd5
2011-03-12 03:39:59 +01:00
}
2011-03-12 03:44:29 +01:00
locallocal() {
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
2011-03-12 03:44:36 +01:00
sendtestmessage
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
2011-03-12 03:45:02 +01:00
--passfile2 ../../var/pass/secret.titi
2011-03-12 03:44:12 +01:00
}
2011-03-12 03:45:02 +01:00
pidfile() {
2011-03-12 03:44:54 +01:00
$CMD_PERL ./imapsync \
--justbanner \
--pidfile /var/tmp/imapsync.pid
! test -f /var/tmp/imapsync.pid
}
2011-03-12 03:45:02 +01:00
justbanner() {
$CMD_PERL ./imapsync \
--justbanner
}
nomodules_version() {
$CMD_PERL ./imapsync \
--justbanner \
--nomodules_version
}
2011-03-12 03:44:54 +01:00
2011-03-12 03:44:49 +01:00
ll_ask_password() {
{ sleep 2; cat ../../var/pass/secret.tata; } | \
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justlogin
}
2011-03-12 03:44:54 +01:00
2011-03-12 03:44:40 +01:00
ll_timeout() {
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:54 +01:00
--folder INBOX --timeout 1
2011-03-12 03:44:40 +01:00
}
2011-03-12 03:44:54 +01:00
2011-03-12 03:44:40 +01:00
ll_timeout_ssl() {
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--folder INBOX --timeout 5 --ssl1 --ssl2
2011-03-12 03:44:40 +01:00
}
2011-03-12 03:44:12 +01:00
2011-03-12 03:44:29 +01:00
ll_folder() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--folder INBOX.yop --folder INBOX.Trash
2011-03-12 03:39:59 +01:00
}
2011-03-12 03:44:37 +01:00
ll_oneemail() {
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:01 +01:00
--folder INBOX.oneemail
2011-03-12 03:44:37 +01:00
}
2011-03-12 03:45:01 +01:00
ll_few_emails() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.few_emails
}
2011-03-12 03:44:37 +01:00
2011-03-12 03:44:30 +01:00
ll_folderrec() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--folderrec INBOX.yop
2011-03-12 03:44:30 +01:00
}
2011-03-12 03:43:43 +01:00
2011-03-12 03:44:29 +01:00
ll_buffersize() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--buffersize 8
2011-03-12 03:44:15 +01:00
}
2011-03-12 03:44:29 +01:00
ll_justfolders() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justfolders --nofoldersizes
2011-03-12 03:44:43 +01:00
echo "rm -rf /home/vmail/titi/.new_folder/"
2011-03-12 03:44:08 +01:00
}
2011-03-12 03:45:02 +01:00
ll_delete2folders() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders --nofoldersizes \
--delete2folders
}
2011-03-12 03:44:49 +01:00
ll_bug_folder_name_with_blank() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justfolders
2011-03-12 03:44:49 +01:00
echo "rm -rf /home/vmail/titi/.bugs/"
}
2011-03-12 03:43:48 +01:00
2011-03-12 03:44:29 +01:00
ll_prefix12() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.qqq \
--prefix1 INBOX.\
2011-03-12 03:45:02 +01:00
--prefix2 INBOX.
2011-03-12 03:44:19 +01:00
}
2011-03-12 03:44:57 +01:00
ll_nosyncinternaldates() {
can_send && sendtestmessage toto
$CMD_PERL_2xx ./imapsync \
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
2011-03-12 03:44:47 +01:00
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:57 +01:00
--folder INBOX --noauthmd5 \
--nosyncinternaldates --delete2 --expunge2
#--debugimap2
can_send && sendtestmessage toto
$CMD_PERL_3xx ./imapsync \
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX --noauthmd5 \
--nosyncinternaldates --delete2 --expunge2
#--debugimap2
}
# bug:
# $d=""; # no bug with $d=undef
# $imap2->append_string($h2_fold,$string, $h1_flags, $d);
# 3.25 idate : Sending: 16 APPEND INBOX () "16-Jul-2010 22:09:42 +0200" {428}
# 2.xx idate : Sending: 62 APPEND INBOX "16-Jul-2010 22:14:00 +0200" {428}
# 3.25 noidate: Sending: 16 APPEND INBOX () "" {428} # Fails: NO IMAP!
# 2.xx noidate: Sending: 62 APPEND INBOX {428}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:39 +01:00
ll_idatefromheader() {
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
2011-03-12 03:44:39 +01:00
sendtestmessage
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.oneemail \
2011-03-12 03:45:02 +01:00
--idatefromheader --debug --dry
2011-03-12 03:44:39 +01:00
}
2011-03-12 03:43:47 +01:00
2011-03-12 03:44:29 +01:00
ll_folder_rev() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
2011-03-12 03:45:02 +01:00
--folder INBOX.yop
2011-03-12 03:43:43 +01:00
}
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
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--subscribed
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
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--subscribed --subscribe
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
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host2 $HOST2 \
--host1 $HOST1 \
2011-03-12 03:45:02 +01:00
--justconnect
2011-03-12 03:44:20 +01:00
}
2011-03-12 03:44:29 +01:00
ll_justfoldersizes()
2011-03-12 03:43:50 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:54 +01:00
--justfoldersizes
}
ll_dev_reconnect()
{
# in another terminal:
#
2011-03-12 03:44:54 +01:00
: <<'EOF'
while :; do
killall -u vmail imapd;
RAND_WAIT=`numrandom .1..5i.1`
echo sleeping $RAND_WAIT
sleepenh $RAND_WAIT
done
EOF
2011-03-12 03:44:54 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi
#--folder INBOX
#--debug --debugimap
2011-03-12 03:43:50 +01:00
}
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
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justlogin --authmd5
2011-03-12 03:43:50 +01:00
}
2011-03-12 03:44:29 +01:00
ll_noauthmd5()
2011-03-12 03:43:53 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justlogin --noauthmd5
2011-03-12 03:43:53 +01:00
}
2011-03-12 03:43:50 +01:00
2011-03-12 03:45:02 +01:00
2011-03-12 03:44:29 +01:00
ll_maxage()
2011-03-12 03:43:50 +01:00
{
2011-03-12 03:45:01 +01:00
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 1
}
2011-03-12 03:45:02 +01:00
ll_newmessage()
{
can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--maxage 1 --folder INBOX --nofoldersizes
}
2011-03-12 03:45:01 +01:00
ll_maxage_9999()
{
# can_send && sendtestmessage
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfoldersizes --folder INBOX \
--maxage 9999
2011-03-12 03:43:50 +01:00
}
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
{
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--maxsize 10
2011-03-12 03:43:50 +01:00
}
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
{
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--skipsize --folder INBOX.yop.yap
2011-03-12 03:43:54 +01:00
}
2011-03-12 03:44:29 +01:00
ll_skipheader()
2011-03-12 03:43:54 +01:00
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:50 +01:00
--skipheader '^X-.*|^Date' --folder INBOX.yop.yap \
2011-03-12 03:45:02 +01:00
--debug
2011-03-12 03:43:54 +01:00
}
2011-03-12 03:44:29 +01:00
ll_include()
2011-03-12 03:43:51 +01:00
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--include '^INBOX.yop'
2011-03-12 03:43:51 +01:00
}
2011-03-12 03:44:36 +01:00
ll_exclude()
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--exclude '^INBOX.yop'
2011-03-12 03:44:36 +01:00
}
2011-03-12 03:44:29 +01:00
ll_regextrans2()
2011-03-12 03:43:55 +01:00
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:51 +01:00
--justfolders \
--nofoldersize \
--regextrans2 's/yop/yoX/' \
--folder 'INBOX.yop.yap'
}
ll_regextrans2_slash()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
--nofoldersize \
--folder 'INBOX.yop.yap' \
--sep1 '/' \
--regextrans2 's,/,_,'
}
ll_regextrans2_remove_space()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--justfolders \
--nofoldersize \
--folder 'INBOX.yop.y p' \
--regextrans2 's, ,,' \
--dry
2011-03-12 03:43:55 +01:00
}
2011-03-12 03:44:51 +01:00
2011-03-12 03:44:29 +01:00
ll_sep2()
2011-03-12 03:44:06 +01:00
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
2011-03-12 03:45:02 +01:00
--sep2 '\\' --dry
2011-03-12 03:44:06 +01:00
}
2011-03-12 03:44:29 +01:00
ll_bad_login()
2011-03-12 03:43:53 +01:00
{
2011-03-12 03:44:36 +01:00
! $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 $HOST2 --user2 notiti \
2011-03-12 03:45:02 +01:00
--passfile2 ../../var/pass/secret.titi
2011-03-12 03:43:53 +01:00
}
2011-03-12 03:44:29 +01:00
ll_bad_host()
2011-03-12 03:43:53 +01:00
{
2011-03-12 03:44:36 +01:00
! $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 badhost --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 badhost --user2 titi \
2011-03-12 03:45:02 +01:00
--passfile2 ../../var/pass/secret.titi
2011-03-12 03:43:53 +01:00
}
2011-03-12 03:44:35 +01:00
ll_bad_host_ssl()
{
2011-03-12 03:44:36 +01:00
! $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 badhost --user1 toto \
--passfile1 ../../var/pass/secret.toto \
--host2 badhost --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--ssl1 --ssl2
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:43:56 +01:00
2011-03-12 03:44:29 +01:00
ll_useheader()
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
--useheader 'Message-ID' \
2011-03-12 03:45:02 +01:00
--dry --debug
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:43:56 +01:00
}
2011-03-12 03:44:29 +01:00
ll_regexmess()
{
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:39 +01:00
rm -f /home/vmail/titi/.yop.yap/cur/*
2011-03-12 03:44:47 +01:00
fi
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
--regexmess 's/\157/O/g' \
--regexmess 's/p/Z/g' \
2011-03-12 03:45:02 +01:00
--debug
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
file=`ls -t /home/vmail/titi/.yop.yap/cur/* | tail -1`
diff ../../var/imapsync/tests/ll_regexmess/dest_01 $file
2011-03-12 03:44:39 +01:00
#echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:44:47 +01:00
fi
2011-03-12 03:44:36 +01:00
}
ll_regexmess_scwchu()
{
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.scwchu \
--regexmess 's{\A(.*?(?! ^$))^Date:(.*?)$}{$1Date:$2\nReceived: From; $2}gxms' \
--skipsize --skipheader 'Received: From;' \
2011-03-12 03:45:02 +01:00
--debug
2011-03-12 03:44:36 +01:00
echo 'rm /home/vmail/titi/.scwchu/cur/*'
2011-03-12 03:44:29 +01:00
}
ll_flags()
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
2011-03-12 03:44:51 +01:00
--debug
2011-03-12 03:44:36 +01:00
echo 'rm /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:44:29 +01:00
}
ll_regex_flag()
{
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--folder INBOX.yop.yap \
2011-03-12 03:44:51 +01:00
--debug --regexflag 's/\\Answered/\\Seen/g'
2011-03-12 03:44:36 +01:00
2011-03-12 03:44:49 +01:00
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
ll_regex_flag2()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debug --regexflag s/\\\\Answered/\\\\Flagged/g
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
2011-03-12 03:44:29 +01:00
}
2011-03-12 03:44:49 +01:00
ll_regex_flag3()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debug --regexflag s/\\\\Answered//g
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:44:51 +01:00
ll_regex_flag_keep_only()
{
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.yop.yap \
--debug \
--regexflag 's/(.*)/$1 jrdH8u/' \
--regexflag 's/.*?(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)/$1 /g' \
--regexflag 's/(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u) (?!(\\Seen|\\Answered|\\Flagged|\\Deleted|\\Draft|jrdH8u)).*/$1 /g' \
--regexflag 's/jrdH8u *//'
echo 'rm -f /home/vmail/titi/.yop.yap/cur/*'
}
2011-03-12 03:44:49 +01:00
2011-03-12 03:44:51 +01:00
ll_tls_justconnect() {
$CMD_PERL ./imapsync \
2011-03-12 03:45:02 +01:00
--host1 $HOST1 \
--host2 $HOST2 \
2011-03-12 03:44:51 +01:00
--tls1 --tls2 \
--justconnect --debug
}
ll_tls_justlogin() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--tls1 --tls2 \
--justlogin --debug
}
ll_tls_devel() {
CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' ll_justlogin ll_ssl_justlogin \
2011-03-12 03:44:53 +01:00
&& CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' ll_justlogin ll_ssl_justlogin \
2011-03-12 03:44:51 +01:00
&& CMD_PERL='perl -I./Mail-IMAPClient-2.2.9' ll_tls_justconnect ll_tls_justlogin \
2011-03-12 03:44:53 +01:00
&& CMD_PERL='perl -I./Mail-IMAPClient-3.25/lib' ll_tls_justconnect ll_tls_justlogin
2011-03-12 03:44:51 +01:00
}
ll_tls() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--tls1 --tls2
}
2011-03-12 03:44:49 +01:00
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:51 +01:00
ll_ssl_justconnect() {
2011-03-12 03:44:40 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 \
--host2 $HOST2 \
2011-03-12 03:44:40 +01:00
--ssl1 --ssl2 \
2011-03-12 03:44:51 +01:00
--justconnect
}
ll_ssl_justlogin() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--ssl1 --ssl2 \
--justlogin
2011-03-12 03:44:40 +01:00
}
2011-03-12 03:44:51 +01:00
2011-03-12 03:44:29 +01:00
ll_ssl() {
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage
2011-03-12 03:44:36 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--ssl1 --ssl2
2011-03-12 03:44:29 +01:00
}
ll_authmech_PLAIN() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authmech1 PLAIN --authmech2 PLAIN
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:29 +01:00
}
ll_authuser() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authuser2 titi
2011-03-12 03:44:29 +01:00
}
ll_authmech_LOGIN() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authmech1 LOGIN --authmech2 LOGIN
2011-03-12 03:44:29 +01:00
}
ll_authmech_CRAMMD5() {
2011-03-12 03:44:36 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:36 +01:00
--justfoldersizes --nofoldersizes \
2011-03-12 03:45:02 +01:00
--authmech1 CRAM-MD5 --authmech2 CRAM-MD5
2011-03-12 03:44:29 +01:00
}
ll_delete2() {
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
sendtestmessage titi
fi
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX \
2011-03-12 03:45:02 +01:00
--delete2 --expunge2
2011-03-12 03:44:29 +01:00
}
2011-03-12 03:44:51 +01:00
ll_delete() {
if can_send; then
sendtestmessage titi
fi
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 titi \
--passfile1 ../../var/pass/secret.titi \
--host2 $HOST2 --user2 tata \
--passfile2 ../../var/pass/secret.tata \
--folder INBOX \
--delete --expunge
2011-03-12 03:44:51 +01:00
}
2011-03-12 03:44:30 +01:00
ll_bigmail() {
2011-03-12 03:45:02 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:45:02 +01:00
--host1 $HOST1 --user1 big1 \
--passfile1 ../../var/pass/secret.big1 \
--host2 $HOST2 --user2 big2 \
--passfile2 ../../var/pass/secret.big2 \
2011-03-12 03:45:02 +01:00
--folder INBOX.bigmail
2011-03-12 03:45:02 +01:00
echo 'sudo rm -v /home/vmail/big2/.bigmail/cur/*'
}
ll_memory_consumption() {
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 big1 \
--passfile1 ../../var/pass/secret.big1 \
--host2 $HOST2 --user2 big2 \
--passfile2 ../../var/pass/secret.big2 \
--folder INBOX.bigmail2 \
--nofoldersizes
echo 'sudo rm -v /home/vmail/big2/.bigmail2/cur/*'
2011-03-12 03:44:30 +01:00
}
2011-03-12 03:44:35 +01:00
msw() {
2011-03-12 03:44:57 +01:00
if can_send; then
sendtestmessage toto
fi
2011-03-12 03:45:00 +01:00
scp imapsync test.bat test_exe.bat\
2011-03-12 03:44:57 +01:00
../../var/pass/secret.toto \
../../var/pass/secret.titi \
../../var/pass/secret.tata \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test.bat'
scp Admin@c:'C:/msys/1.0/home/Admin/imapsync/imapsync.exe' .
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:44:59 +01:00
msw2() {
if can_send; then
sendtestmessage toto
fi
2011-03-12 03:45:00 +01:00
scp imapsync test_exe.bat\
2011-03-12 03:44:59 +01:00
../../var/pass/secret.toto \
../../var/pass/secret.titi \
../../var/pass/secret.tata \
Admin@c:'C:/msys/1.0/home/Admin/imapsync/'
2011-03-12 03:45:00 +01:00
ssh Admin@c 'C:/msys/1.0/home/Admin/imapsync/test_exe.bat'
2011-03-12 03:44:59 +01:00
}
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:39 +01:00
2011-03-12 03:44:40 +01:00
gmail() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:40 +01:00
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
2011-03-12 03:45:02 +01:00
--authmech1 LOGIN \
2011-03-12 03:44:40 +01:00
--user1 gilles.lamiral@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile1 ../../var/pass/secret.gilles_gmail \
--host2 $HOST2 \
--user2 tata \
--passfile2 ../../var/pass/secret.tata \
2011-03-12 03:45:02 +01:00
--useheader 'Message-Id' \
--useheader="X-Gmail-Received" \
--regextrans2 's/\[Gmail\]/Gmail/'
2011-03-12 03:44:43 +01:00
}
2011-03-12 03:44:40 +01:00
2011-03-12 03:44:43 +01:00
gmail_gmail() {
2011-03-12 03:44:47 +01:00
2011-03-12 03:44:43 +01:00
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile1 ../../var/pass/secret.gilles_gmail \
2011-03-12 03:44:43 +01:00
--host2 imap.gmail.com \
--ssl2 \
--user2 gilles.lamiral@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile2 ../../var/pass/secret.gilles_gmail \
2011-03-12 03:45:01 +01:00
--useheader 'Message-Id' --useheader="X-Gmail-Received" \
2011-03-12 03:44:43 +01:00
--regextrans2 's<>INBOX<4F>inbox_copy<70>' \
--folder INBOX \
2011-03-12 03:44:49 +01:00
--authmech1 LOGIN --authmech2 LOGIN \
--allowsizemismatch
2011-03-12 03:44:43 +01:00
}
gmail_gmail2() {
$CMD_PERL ./imapsync \
--host1 imap.gmail.com \
--ssl1 \
--user1 gilles.lamiral@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile1 ../../var/pass/secret.gilles_gmail \
2011-03-12 03:44:43 +01:00
--host2 imap.gmail.com \
--ssl2 \
--user2 imapsync.gl@gmail.com \
2011-03-12 03:44:47 +01:00
--passfile2 ../../var/pass/secret.imapsync.gl_gmail \
2011-03-12 03:44:43 +01:00
--useheader 'Message-Id' --skipsize \
--folder INBOX \
2011-03-12 03:44:49 +01:00
--authmech1 LOGIN --authmech2 LOGIN \
--allowsizemismatch
2011-03-12 03:44:43 +01:00
#--dry # --debug --debugimap # --authmech1 LOGIN
}
allow3xx() {
2011-03-12 03:44:51 +01:00
$CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:51 +01:00
--allow3xx --justlogin
2011-03-12 03:44:47 +01:00
}
2011-03-12 03:44:48 +01:00
noallow3xx() {
2011-03-12 03:44:53 +01:00
! perl -I./Mail-IMAPClient-3.25/lib ./imapsync \
2011-03-12 03:44:48 +01:00
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:44:51 +01:00
--noallow3xx --justlogin
2011-03-12 03:44:48 +01:00
}
2011-03-12 03:44:47 +01:00
archiveopteryx_1() {
2011-03-12 03:44:48 +01:00
if can_send; then
2011-03-12 03:44:47 +01:00
#echo3 Here is plume
sendtestmessage je@lupus.aox.org
2011-03-12 03:44:43 +01:00
else
:
fi
2011-03-12 03:44:47 +01:00
$CMD_PERL ./imapsync \
--host1 lupus.aox.org --user1 je \
--passfile1 ../../var/pass/secret.aox_je \
--host2 lupus.aox.org --user2 je \
--passfile2 ../../var/pass/secret.aox_je \
2011-03-12 03:45:02 +01:00
--folder INBOX --regextrans2 's/INBOX/copy/'
2011-03-12 03:44:47 +01:00
}
2011-03-12 03:44:51 +01:00
ll_justlogin() {
2011-03-12 03:44:47 +01:00
# Look in the file ../../var/pass/secret.tptp to see
# strange \ character behavior
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
2011-03-12 03:45:02 +01:00
--justlogin --noauthmd5
2011-03-12 03:44:47 +01:00
}
2011-03-12 03:44:51 +01:00
ll_justlogin_backslash_char() {
2011-03-12 03:44:47 +01:00
# Look in the file ../../var/pass/secret.tptp to see
# strange \ character behavior
$CMD_PERL ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 tptp@est.belle \
--passfile2 ../../var/pass/secret.tptp \
2011-03-12 03:45:02 +01:00
--justlogin --noauthmd5
2011-03-12 03:44:40 +01:00
}
2011-03-12 03:44:29 +01:00
##########################
# specific tests
##########################
2011-03-12 03:43:55 +01:00
big_transfert()
{
date1=`date`
2011-03-12 03:44:36 +01:00
{ $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--noauthmd5 \
2011-03-12 03:44:57 +01:00
--fast --folder INBOX.Junk \
2011-03-12 03:44:36 +01:00
--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`
2011-03-12 03:44:36 +01:00
{ $CMD_PERL ./imapsync \
2011-03-12 03:44:47 +01:00
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--noauthmd5 \
2011-03-12 03:44:57 +01:00
--justfoldersizes --folder INBOX.Junk || \
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:57 +01:00
dprof_justfoldersizes()
2011-03-12 03:44:01 +01:00
{
date1=`date`
2011-03-12 03:44:57 +01:00
{ $CMD_PERL -d:DProf ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
2011-03-12 03:44:47 +01:00
--passfile2 ../../var/pass/secret.tete \
2011-03-12 03:44:57 +01:00
--noauthmd5 \
--justfoldersizes --folder INBOX.Junk || \
2011-03-12 03:44:01 +01:00
true
}
date2=`date`
echo3 "[$date1] [$date2]"
2011-03-12 03:44:57 +01:00
mv tmon.out dprof_justfoldersizes_tmon.out
dprofpp -O 30 dprof_justfoldersizes_tmon.out
dprofpp -O 30 -I dprof_justfoldersizes_tmon.out
2011-03-12 03:44:01 +01:00
}
2011-03-12 03:44:57 +01:00
dprof_bigfolder()
{
date1=`date`
{ $CMD_PERL -d:DProf ./imapsync \
--host1 $HOST1 --user1 gilles@est.belle \
--passfile1 ../../var/pass/secret.gilles_mbox \
--host2 $HOST2 --user2 tete@est.belle \
--passfile2 ../../var/pass/secret.tete \
--noauthmd5 \
--nofoldersizes --folder INBOX.15_imapsync.imapsync-list || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
2011-03-12 03:45:02 +01:00
mv tmon.out dprof_bigfolder_tmon.out
2011-03-12 03:44:57 +01:00
dprofpp -O 30 dprof_bigfolder_tmon.out
dprofpp -O 30 -I dprof_bigfolder_tmon.out
}
2011-03-12 03:45:02 +01:00
dprof_bigmail()
{
date1=`date`
{ $CMD_PERL -d:DProf ./imapsync \
--host1 $HOST1 --user1 tata \
--passfile1 ../../var/pass/secret.tata \
--host2 $HOST2 --user2 titi \
--passfile2 ../../var/pass/secret.titi \
--folder INBOX.bigmail
echo 'sudo rm -v /home/vmail/titi/.bigmail/cur/*' || \
true
}
date2=`date`
echo3 "[$date1] [$date2]"
mv tmon.out dprof_bigmail_tmon.out
dprofpp -O 30 dprof_bigmail_tmon.out
dprofpp -O 30 -I dprof_bigmail_tmon.out
}
2011-03-12 03:44:57 +01:00
2011-03-12 03:44:29 +01:00
##########################
##########################
2011-03-12 03:44:17 +01:00
2011-03-12 03:44:56 +01:00
# Tests list
mandatory_tests='
no_args
option_version
option_tests
2011-03-12 03:45:02 +01:00
option_tests_debug
2011-03-12 03:44:56 +01:00
option_bad_delete2
2011-03-12 03:44:57 +01:00
passwords_masked
2011-03-12 03:44:56 +01:00
first_sync_dry
first_sync
locallocal
2011-03-12 03:45:02 +01:00
pidfile
justbanner
nomodules_version
gmail
gmail_gmail
gmail_gmail2
2011-03-12 03:44:56 +01:00
ll_ask_password
ll_bug_folder_name_with_blank
ll_timeout
ll_folder
2011-03-12 03:45:01 +01:00
ll_oneemail
2011-03-12 03:44:56 +01:00
ll_buffersize
ll_justfolders
ll_prefix12
2011-03-12 03:44:57 +01:00
ll_nosyncinternaldates
2011-03-12 03:44:56 +01:00
ll_idatefromheader
ll_folder_rev
ll_subscribed
ll_subscribe
ll_justfoldersizes
ll_authmd5
ll_noauthmd5
ll_maxage
ll_maxsize
ll_skipsize
ll_skipheader
ll_include
ll_exclude
ll_regextrans2
ll_sep2
ll_bad_login
ll_bad_host
ll_bad_host_ssl
ll_useheader
ll_regexmess
ll_regexmess_scwchu
ll_flags
ll_regex_flag
ll_regex_flag_keep_only
ll_justconnect
ll_justlogin
ll_ssl
ll_ssl_justconnect
ll_ssl_justlogin
ll_tls_justconnect
ll_tls_justlogin
ll_tls
ll_authmech_PLAIN
ll_authmech_LOGIN
ll_authmech_CRAMMD5
ll_authuser
ll_delete2
ll_delete
ll_folderrec
allow3xx
2011-03-12 03:45:02 +01:00
noallow3xx
2011-03-12 03:45:02 +01:00
ll_memory_consumption
ll_newmessage
ll_delete2folders
'
2011-03-12 03:44:56 +01:00
other_tests='
2011-03-12 03:45:02 +01:00
archiveopteryx_1
2011-03-12 03:44:56 +01:00
msw
2011-03-12 03:45:02 +01:00
msw2
ll_bigmail
ll_justlogin_backslash_char
option_tests_debug
'
2011-03-12 03:44:56 +01:00
l() {
echo "$mandatory_tests" "$other_tests"
}
2011-03-12 03:44:23 +01:00
2011-03-12 03:39:59 +01:00
# mandatory tests
2011-03-12 03:44:47 +01:00
run_tests perl_syntax
2011-03-12 03:39:59 +01:00
2011-03-12 03:45:01 +01:00
2011-03-12 03:39:59 +01:00
# All tests
2011-03-12 03:44:56 +01:00
test $# -eq 0 && run_tests $mandatory_tests
2011-03-12 03:44:11 +01:00
2011-03-12 03:39:59 +01:00
# selective tests
2011-03-12 03:44:35 +01:00
test $# -gt 0 && run_tests "$@"
2011-03-12 03:39:59 +01:00
# If there, all is good
echo3 ALL $test_count TESTS SUCCESSFUL