-
Notifications
You must be signed in to change notification settings - Fork 93
How to set up development environment for zm mailbox repository
Greg Solovyev edited this page Aug 3, 2017
·
8 revisions
- Install latest version of ZCS - at the moment this would be 8.8.1 release
- Create
/home/zimbra
and makezimbra
user the owner - Install
git
,ant
,ant-contrib
- Edit
/opt/zimbra/.bash_profile
- comment out
export LANG=C
andexport LC_ALL=C
- add
export LANG=en_US.UTF-8
- add
export ANT_OPTS="-Ddev.home=/home/zimbra -Dzimbra.buildinfo.version=8.7.6_GA"
- load environment changes
source /opt/zimbra/.bash_profile
- comment out
- Change permissions on files and folders that you will be updating. E.g. as root:
chmod -R o+w /opt/zimbra/lib/ /opt/zimbra/jetty/
(Note: if you runzmfixperms
, these permission changes will get overwritten) - Create folders for dependencies
mkdir /home/zimbra/.zcs-deps/ mkdir -p /home/zimbra/.ivy2/cache
- Clone zm-mailbox repository:
mkdir /home/zimbra/git cd /home/zimbra/git git clone https://github.com/Zimbra/zimbra-package-stub.git
- Build and run unit tests (this may take 3-5 minutes):
cd zm-mailbox ant test-all
- Build without running unit tests (this will just create jar files for zm-common, zm-store, zm-native, zm-soap and zm-client libraries):
ant all
- Build and publish jar files to local Ivy repository (this will build jar files and make changes in zm-common, zm-store, zm-native, zm-soap and zm-client libraries visible to other repositories):
ant publish-local-all
- Deploy changes in zm-common, zm-store, zm-native, zm-soap and zm-client libraries:
ant -f store/build.xml deploy-foss
-
You can also deploy changes in just one of the libraries by running
deploy
ANT target from the library's build.xml. E.g. to deploy only zm-common:ant -f common/build.xml deploy
Note:deploy
anddeploy-all
targets restart mailboxd
If you are using a local VM such as VMWare Fusion or VirtualBox, you may need to make some additional configuration changes to get MTA to work on your network.
- set up a DNS server on your host machine or another VM and configure zimbraDNSMasterIP to point to it. To do so, run
zmprov ms
command as zimbra user. E.g.:
zmprov ms ubuntu2.local zimbraDNSMasterIP 172.16.150.1
- If you do not have a DNS server set up on your network, you need to disable Zimbra DNS lookups
zmprov mcf zimbraMtaSmtpDnsSupportLevel disabled
- If you see this error "No SMTP hosts available for domain" when trying to send an email, you need to manually configure zimbraSmtpHostname for your domain(s). To do so, run
zmprov md
command as zimbra user. E.g.:
zmprov md ubuntu2.local zimbraSmtpHostname ubuntu2.local
- If you see errors like this in /var/log/zimbra.log
postfix/lmtp ... deferred ... connection refused
This is nearly always caused by a host that is configured on private IP Space (or using NAT) and that does not have an interface for the public IP address the server resides on. This can be easily fixed by simply using native IP address lookups for lmtp rather than DNS.zmprov mcf zimbraMtaLmtpHostLookup native zmmtactl restart
SOAP tests are not unit tests. These tests interact with Zimbra services such as LDAP, mailboxd, zmproxy, IMAPd, MariaDB, etc. These tests create and delete domains, accounts, inject data, send messages, update configuration, etc. Some tests require that email delivery works on your server. See previous section on how to get email delivery to work in a development environment. Note: Do not run SOAP tests on a production server :)
-
First, you need to copy
JUnit jar
to/opt/zimbra/jetty/webapps/service/WEB-INF/lib
and restart the mailbox:cp /home/zimbra/.ivy2/cache/junit/junit/jars/junit-4.8.2.jar /opt/zimbra/jetty/webapps/service/WEB-INF/lib/ zmmailboxdctl restart
- To run a single test suite (TestZClient in this example):
zmsoap -z RunUnitTestsRequest test=TestZClient
-
To run a single test from a test suite (TestZClient::testFeatures in this example):
zmsoap -z RunUnitTestsRequest test=TestZClient#testFeatures
-
To run all tests under com.zimbra.qa.unittest (Note: this may take a while):
zmsoap -z RunUnitTestsRequest