~ubuntu-branches/debian/sid/openchange/sid

« back to all changes in this revision

Viewing changes to pyopenchange/tests/mapistore_sogo.py

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2012-04-12 20:07:57 UTC
  • mfrom: (11 sid)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20120412200757-k933d9trljmxj1l4
Tags: 1:1.0-4
* openchangeserver: Add dependency on openchangeproxy.
* Rebuild against newer version of Samba 4.
* Use dpkg-buildflags.
* Migrate to Git, update Vcs-Git header.
* Switch to debhelper 9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
# NOTE:
 
4
#
 
5
# For this test, we are running the whole environment on a different
 
6
# server: imap, ldap, postgresql, postfix, openchange, samba and sogo.
 
7
# We have configured SOGo backend locally and adjusted defaults to
 
8
# connect to this remote server.
 
9
#
 
10
# Finally we are accessing the openchange.ldb file through sshfs and
 
11
# map it at the top of the checkout within private folder:
 
12
# sshfs openchange@ip_addr:/usr/local/samba/private private
 
13
# We have also adjusted the permissions to allow openchange user to
 
14
# read/write openchange.ldb file remotely.
 
15
#
 
16
# Do not forget to run memcached with the user account running the
 
17
# script.
 
18
#
 
19
 
 
20
import os
 
21
import sys
 
22
import time
 
23
 
 
24
sys.path.append("python")
 
25
 
 
26
import openchange.mapistore as mapistore
 
27
 
 
28
dirname = "/usr/local/samba/private/mapistore"
 
29
if not os.path.exists(dirname):
 
30
    os.mkdir("/usr/local/samba/private/mapistore")
 
31
 
 
32
mapistore.set_mapping_path(dirname)
 
33
MAPIStore = mapistore.mapistore(syspath="/usr/local/samba/private")
 
34
MAPICtx = MAPIStore.add_context("sogo://Administrator:Administrator@inbox/", "Administrator")
 
35
Inbox = MAPICtx.open()
 
36
identifier = MAPICtx.add_subscription("sogo://Administrator:Administrator@inbox/", False, 0x2)
 
37
while 1:
 
38
    time.sleep(1)
 
39
    MAPICtx.get_notifications()
 
40
    
 
41
time.sleep(15)
 
42
MAPICtx.delete_subscription("sogo://Administrator:Administrator@inbox/", False, 0x2, identifier)
 
43
 
 
44
#Calendar = MAPIStore.add_context("sogo://Administator:Administrator@inbox/", "Administrator").open()
 
45
#time.sleep(5)
 
46
#print Calendar.folder_count
 
47
#time.sleep(5)
 
48
#MAPICtx = MAPIStore.add_context("sogo://Administrator:Administrator@inbox/", "GoodAdmin")
 
49
Inbox.create_folder(name="Test")
 
50
time.sleep(15)
 
51
NewCalender = MAPICtx.open()
 
52
 
 
53
print "[I] We have %d sub folders, %d messages and %d fai messages  within %s" % (Inbox.folder_count, 
 
54
                                                                                  Inbox.message_count, 
 
55
                                                                                  Inbox.fai_message_count,
 
56
                                                                                  hex(Inbox.fid))
 
57
MAPIStore.delete_context(MAPICtx)
 
58