From 5d5fd998d1bb4c8f1b20d7da1d47844700c824f0 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Sun, 26 Jan 2014 20:27:53 -0400 Subject: Allow passing user and mbox as parameters Increase default testing duration to 200 secs. --- mail/src/leap/mail/imap/tests/leap_tests_imap.zsh | 26 +++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'mail') diff --git a/mail/src/leap/mail/imap/tests/leap_tests_imap.zsh b/mail/src/leap/mail/imap/tests/leap_tests_imap.zsh index 7ba408c..676d1a8 100755 --- a/mail/src/leap/mail/imap/tests/leap_tests_imap.zsh +++ b/mail/src/leap/mail/imap/tests/leap_tests_imap.zsh @@ -41,8 +41,10 @@ # Please provide also details about your system, and # the type of hard disk setup you are running against. # -# -# Edit these variables -------------------------- + +# ------------------------------------------------ +# Edit these variables if you are too lazy to pass +# the user and mbox as parameters. Like me. USER="test_f14@dev.bitmask.net" MBOX="~/leap/imaptest/data/dovecot-crlf" @@ -50,15 +52,16 @@ MBOX="~/leap/imaptest/data/dovecot-crlf" HOST="localhost" PORT="1984" -IMAPTEST="imaptest" +# in case you have it aliased GREP="/bin/grep" +IMAPTEST="imaptest" # ----------------------------------------------- # # These should be kept constant across benchmarking # runs across different machines, for comparability. -DURATION=100 +DURATION=200 NUM_MSG=200 @@ -153,6 +156,21 @@ print "TOT samples", NR; } +{ test $1 = "--help" } && { + echo "Usage: $0 [user@provider] [/path/to/sample.mbox]" + exit 0 +} + +# If the first parameter is passed, take it as the user +{ test $1 } && { + USER=$1 +} + +# If the second parameter is passed, take it as the mbox +{ test $2 } && { + MBOX=$2 +} + echo "[+] LEAP IMAP TESTS" echo "[+] Running imaptest for $DURATION seconds with $NUM_MSG messages" wait_and_kill & -- cgit v1.2.3