Virtual machines with IMAP server software, for testing
About
Some plans are being made to make different virtual machine images available to launch the Tinymail unit testing suite on. Each such image will contain a specific IMAP server, and can be run with different network simulations. A first such virtual machine image has been prepared with Cyrus 2.3.8 running in it. Although the virtual machine image is not ready for what is planned, it's already available for testing and download.
The virtual machines's virtual network devices can and will be set to have different network characteristics. One example is adding random latency and slowing it down to simulate a GPRS network using NETEM. When using QEmu you can use NETEM on the tap0 network device to achieve this.
Availability
You can download the virtual machines here: http://tinymail.org/files/vms
QEmu
Although I prefer VMWare for development related tasks myself I decided to use QEmu. The reason for that is because QEmu is more 'available' (licensing, multiple architectures, etc). This means that you need to have QEmu installed.
# apt-get install qemu
If you want some extra performance, you can also install kqemu. Search on Google how to install kqemu on your distribution with your kernel.
The first VM: tnytest-vm-cyrus-0.0.1
About
This VM is the first in a series of Virtual Machines that will be prepared. It contains a Cyrus 2.3.8 IMAP server that has the STARTTLS, CONDSTORE and IDLE capabilities.
$ telnet 10.84.78.89 143 Trying 10.84.78.89... Connected to 10.84.78.89. Escape character is '^]'. * OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS AUTH=GSSAPI AUTH=DIGEST-MD5 AUTH=CRAM-MD5 AUTH=NTLM SASL-IR] cyrus Cyrus IMAP4 v2.3.8 server ready . LOGIN tnytest tnytest . OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH] User logged in . CAPABILITY * CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID LOGINDISABLED ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY SORT SORT=MODSEQ THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE CATENATE CONDSTORE IDLE URLAUTH . OK Completed ^] telnet> quit Connection closed. $
Availability
http://tinymail.org/files/vms/tnytest-vm-cyrus-0.0.1.tar.bz2
Setup
$ tar jxvf tnytest-vm-cyrus-0.0.1.tar.gz $ cd tnytest-vm-cyrus-0.0.1 $ su # vi setup.sh # ./setup.sh
The different network types
Read the scripts in the "scripts" directory. There's a up-gprs.sh and up-fullspeed.sh script. You'll notice that you need NETEM for the GPRS one.
$ cat scripts/up-gprs.sh #!/bin/sh sudo /sbin/ifconfig $1 10.84.78.1 # ### GPRS Simulation # sudo tc qdisc del dev $1 root sudo tc qdisc add dev $1 root handle 1: netem delay 1000ms sudo tc qdisc add dev $1 parent 1: handle 10: htb default 1 sudo tc class add dev $1 parent 10: classid 10:1 htb rate 10kbit ceil 35kbit $
Usage
Using the VM with a full speed network
When using the VM with full speed, you are simulating a very unlikely perfect network between the client and the IMAP server.
$ ./tnytest.sh fullspeed
Using the VM with a simulated GPRS network
When using the VM with GPRS speed, you are simulating a very likely network between the client and the IMAP server: a GPRS network.
$ ./tnytest.sh gprs
Once started up, you can use the IMAP server at 10.84.78.89 on port 143. It has a user called "tnytest" with password "tnytest". Once started you can also switch the speed by using the scripts in scripts/:
$ cd scripts/ .. scripts $ ./up-fullspeed tap0
Shutting down
The root password of the virtual machine is "tnytest", so once QEmu has booted the guest operating system, you can use ALT+F2 to activate a login screen and you can login using root and tnytest, and end the testing session with a normal "shutdown -h now" command.
Login: root Password: tnytest # shutdown -h now
