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

« back to all changes in this revision

Viewing changes to pyopenchange/tests/mapistore_mgmt.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 to expected /usr/local/samba/private folder.
 
12
# sshfs openchange@ip_addr:/usr/local/samba/private /usr/local/samba/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
mgmt = MAPIStore.management()
 
35
#while 1:
 
36
#    time.sleep(5)
 
37
#    d = mgmt.registered_users("SOGo", "Administrator")
 
38
#    print d
 
39
print "Is SOGo backend registered: %s" % mgmt.registered_backend("SOGo")
 
40
print "Is NonExistent backend registered: %s" % mgmt.registered_backend("NonExistent")
 
41
print "Registered message: %s" % mgmt.registered_message("SOGo", "Administrator", "Administrator", "inbox", "61")
 
42
print "Registered message: %s" % mgmt.registered_message("SOGo", "Administrator", "Administrator", "inbox", "74")
 
43
 
 
44
mgmt.existing_users("SOGo", "Administrator", "inbox")