File: developer-testing.html

package info (click to toggle)
cyrus-imapd 3.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 60,760 kB
  • sloc: ansic: 280,403; perl: 146,834; javascript: 9,624; sh: 5,730; yacc: 2,660; cpp: 2,263; makefile: 2,103; lex: 675; xml: 621; awk: 303; python: 273; asm: 262
file content (354 lines) | stat: -rw-r--r-- 25,890 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Developer Test Environment &mdash; Cyrus IMAP 3.12.1 documentation</title>
      <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
      <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
      <link rel="stylesheet" href="../../_static/cyrus.css" type="text/css" />
  
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    <script src="../../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Test Coverage" href="coverage.html" />
    <link rel="prev" title="GitHub guide" href="github-guide.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../../index.html" class="icon icon-home">
            Cyrus IMAP
          </a>
              <div class="version">
                3.12.1
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Cyrus IMAP</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../download.html">Download</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../quickstart.html">Quickstart Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../setup.html">Setup</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../operations.html">Operations</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../developers.html">Developers</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../contribute.html">We need your help</a></li>
<li class="toctree-l2"><a class="reference internal" href="documentation.html">Contribute docs</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../developer.html">Contribute code and tests</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../developer.html#getting-started">Getting Started</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="process.html">Development Process</a></li>
<li class="toctree-l4"><a class="reference internal" href="overview.html">Overview of Cyrus development environment</a></li>
<li class="toctree-l4"><a class="reference internal" href="github-guide.html">GitHub guide</a></li>
<li class="toctree-l4"><a class="reference internal" href="compiling.html">Compiling</a></li>
<li class="toctree-l4"><a class="reference internal" href="../installing.html">Installing Cyrus</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">Developer Test Environment</a></li>
<li class="toctree-l4"><a class="reference internal" href="coverage.html">Test Coverage</a></li>
<li class="toctree-l4"><a class="reference internal" href="jmap.html">JMAP support</a></li>
<li class="toctree-l4"><a class="reference internal" href="install-xapian.html">Xapian for searching</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../developer.html#system-files-and-databases">System files and Databases</a></li>
<li class="toctree-l3"><a class="reference internal" href="../developer.html#resources">Resources</a></li>
<li class="toctree-l3"><a class="reference internal" href="../developer.html#releasing">Releasing</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="cyrusworks.html">Cyrus.Works</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../developers.html#cyrus-internals">Cyrus Internals</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../developers.html#unit-tests">Unit Tests</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../support.html">Support/Community</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Cyrus SASL</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="http://www.cyrusimap.org/sasl">Cyrus SASL</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">Cyrus IMAP</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../developers.html">Developers</a></li>
          <li class="breadcrumb-item"><a href="../developer.html">IMAP Developer Guide</a></li>
      <li class="breadcrumb-item active">Developer Test Environment</li>
      <li class="wy-breadcrumbs-aside">
              <a href="https://github.com/cyrusimap/cyrus-imapd/blob/master/docsrc/imap/developer/developer-testing.rst" class="fa fa-github"> Edit on GitHub</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="developer-test-environment">
<span id="developer-testing"></span><h1>Developer Test Environment<a class="headerlink" href="#developer-test-environment" title="Permalink to this heading"></a></h1>
<p>This assumes you have your <a class="reference internal" href="../installing.html#installing"><span class="std std-ref">basic server running</span></a> and you've made some changes and you want to test them to work out what's going right... or wrong.</p>
<section id="installing-cassandane">
<span id="install-cassandane"></span><h2>Installing Cassandane<a class="headerlink" href="#installing-cassandane" title="Permalink to this heading"></a></h2>
<p>Cassandane is a Perl-based integration test suite for Cyrus.
<a class="reference external" href="https://github.com/cyrusimap/cyrus-imapd/tree/master/cassandane/doc">Cassandane documentation</a>
includes information on setting up tests and writing new tests.</p>
<p>Why &quot;Cassandane&quot;? Wikipedia indicates that <a class="reference external" href="https://en.wikipedia.org/wiki/Cassandane">Cassandane</a> was the name of
the consort of King Cyrus the Great of Persia, founder of the Achaemenid
Persian Empire.  So that's kinda cool.</p>
<section id="install-and-configure-cassandane">
<h3>Install and configure Cassandane<a class="headerlink" href="#install-and-configure-cassandane" title="Permalink to this heading"></a></h3>
<ol class="arabic">
<li><p>You already have it -- it's in the &quot;cassandane&quot; subdirectory of the cyrus-imapd
sources.</p></li>
<li><p>Install dependencies</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>libanyevent-perl<span class="w"> </span>libtest-unit-perl<span class="w"> </span>libconfig-inifiles-perl<span class="w"> </span><span class="se">\</span>
<span class="w">    </span>libdatetime-perl<span class="w"> </span>libbsd-resource-perl<span class="w"> </span>libxml-generator-perl<span class="w"> </span><span class="se">\</span>
<span class="w">    </span>libencode-imaputf7-perl<span class="w"> </span>libio-stringy-perl<span class="w"> </span>libnews-nntpclient-perl<span class="w"> </span><span class="se">\</span>
<span class="w">    </span>libfile-chdir-perl<span class="w"> </span>libfile-libmagic-perl<span class="w"> </span>libnet-server-perl<span class="w"> </span>libunix-syslog-perl<span class="w"> </span><span class="se">\</span>
<span class="w">    </span>libdata-uuid-perl<span class="w"> </span>libjson-xs-perl<span class="w"> </span>libdata-ical-perl<span class="w"> </span>libjson-perl<span class="w"> </span><span class="se">\</span>
<span class="w">    </span>libdatetime-format-ical-perl<span class="w"> </span>libtext-levenshteinxs-perl<span class="w"> </span><span class="se">\</span>
<span class="w">    </span>libmime-types-perl<span class="w"> </span>libdatetime-format-iso8601-perl<span class="w"> </span>libcal-dav-perl<span class="w"> </span><span class="se">\</span>
<span class="w">    </span>libclone-perl<span class="w"> </span>libstring-crc32-perl<span class="w"> </span>libnet-ldap-server-perl
</pre></div>
</div>
<p>The quickest option for the rest is installing via CPAN, but you could build
packages using dh-make-perl if that is preferred.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>AnyEvent<span class="w"> </span>Config::IniFiles<span class="w"> </span>Data::GUID<span class="w"> </span>Digest::CRC<span class="w"> </span>File::Slurp<span class="w"> </span>IO::File::fcntl<span class="w"> </span>IO::Socket::INET6<span class="w"> </span>Net::Server::PreForkSimple<span class="w"> </span>News::NNTPClient<span class="w"> </span>Plack::Loader<span class="w"> </span>Types::Standard<span class="w"> </span>Unix::Syslog<span class="w"> </span>XML::Generator<span class="w"> </span>XML::Simple
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Tie::DataUUID
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>XML::Spice
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>XML::Fast
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Data::ICal::TimeZone
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Text::VCardFast
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Mail::IMAPTalk
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>List::Pairwise
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Convert::Base64
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Net::DAVTalk
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Net::CardDAVTalk
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Net::CalDAVTalk
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Mail::JMAPTalk
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Math::Int64
sudo<span class="w"> </span>cpan<span class="w"> </span>-i<span class="w"> </span>Test::Unit
</pre></div>
</div>
</li>
<li><p>Build Cassandane's binary components</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>/path/to/cyrus-imapd/cassandane
make
</pre></div>
</div>
</li>
<li><p>Copy <code class="docutils literal notranslate"><span class="pre">cassandane.ini.example</span></code> to <code class="docutils literal notranslate"><span class="pre">cassandane.ini</span></code> in your home directory</p></li>
<li><p>Edit <code class="docutils literal notranslate"><span class="pre">cassandane.ini</span></code> to set up your cassandane environment.</p>
<blockquote>
<div><ul>
<li><p>Assuming you configure cyrus with <code class="docutils literal notranslate"><span class="pre">--prefix=/usr/cyrus</span></code> (as above), then the defaults are mostly fine</p></li>
<li><p>Set <code class="docutils literal notranslate"><span class="pre">destdir</span></code> to <code class="docutils literal notranslate"><span class="pre">/var/tmp/cyrus</span></code></p></li>
<li><p>Add <code class="docutils literal notranslate"><span class="pre">[valgrind]</span></code> if you're using it.</p></li>
<li><p>Add an <code class="docutils literal notranslate"><span class="pre">[imaptest]</span></code> section.  For the moment, it may be necessary to
suppress the binary tests as they are buggy upstream still.</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[imaptest]</span>
<span class="na">basedir</span><span class="o">=</span><span class="s">/path/to/imaptest/imaptest</span>
<span class="na">suppress</span><span class="o">=</span><span class="s">append-binary urlauth-binary fetch-binary-mime fetch-binary-mime-qp</span>
</pre></div>
</div>
</li>
</ul>
</div></blockquote>
</li>
<li><p>Create a <code class="docutils literal notranslate"><span class="pre">cyrus</span></code> user and matching group and also add <code class="docutils literal notranslate"><span class="pre">cyrus</span></code> to group <code class="docutils literal notranslate"><span class="pre">mail</span></code></p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>adduser<span class="w"> </span>--system<span class="w"> </span>--group<span class="w"> </span>cyrus
sudo<span class="w"> </span>adduser<span class="w"> </span>cyrus<span class="w"> </span>mail
</pre></div>
</div>
</li>
<li><p>Give your user account access to sudo as <code class="docutils literal notranslate"><span class="pre">cyrus</span></code></p>
<blockquote>
<div><ul>
<li><p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">visudo</span></code></p></li>
<li><p>add lines like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Defaults</span><span class="p">:</span><span class="n">username</span> <span class="n">rlimit_core</span><span class="o">=</span><span class="n">default</span>
<span class="n">username</span> <span class="n">ALL</span> <span class="o">=</span> <span class="p">(</span><span class="n">cyrus</span><span class="p">)</span> <span class="n">NOPASSWD</span><span class="p">:</span> <span class="n">ALL</span>
</pre></div>
</div>
<p>where &quot;username&quot; is your own username</p>
</li>
</ul>
</div></blockquote>
</li>
<li><p>Make the <code class="docutils literal notranslate"><span class="pre">destdir</span></code> directory, as the <code class="docutils literal notranslate"><span class="pre">cyrus</span></code> user</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">-u</span> <span class="pre">cyrus</span> <span class="pre">mkdir</span> <span class="pre">/var/tmp/cass</span></code></p></li>
</ul>
</div></blockquote>
</li>
</ol>
</section>
<section id="install-imaptest">
<h3>Install IMAPTest<a class="headerlink" href="#install-imaptest" title="Permalink to this heading"></a></h3>
<p><a class="reference external" href="http://www.imapwiki.org/ImapTest">IMAPTest</a> is a testing suite which uses libraries from the Dovecot installation.</p>
<ol class="arabic">
<li><p>Fetch and compile Dovecot.</p>
<blockquote>
<div><ul class="simple">
<li><p>Get the latest nightly snapshot from <a class="reference external" href="http://dovecot.org/nightly/dovecot-latest.tar.gz">http://dovecot.org/nightly/dovecot-latest.tar.gz</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">./configure</span> <span class="pre">&amp;&amp;</span> <span class="pre">make</span></code> (No need for make install)</p></li>
</ul>
</div></blockquote>
</li>
<li><p>Fetch and compile IMAPTest</p>
<blockquote>
<div><ul class="simple">
<li><p>Download <a class="reference external" href="http://dovecot.org/nightly/imaptest/imaptest-latest.tar.gz">http://dovecot.org/nightly/imaptest/imaptest-latest.tar.gz</a></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">./configure</span> <span class="pre">--with-dovecot=../dovecot-2.2</span> <span class="pre">&amp;&amp;</span> <span class="pre">make</span></code> (No need for make install)</p></li>
<li><p>The <code class="docutils literal notranslate"><span class="pre">--with-dovecot=&lt;path&gt;</span></code> parameter is used to specify path to Dovecot v2.2 sources' root directory.</p></li>
</ul>
</div></blockquote>
</li>
</ol>
<p>This is not quite the same IMAPTest that CI uses.  The CI system uses
a docker image, which among other things has Dovecot and IMAPTest already
built in so that they don't need to be rebuilt every time CI runs.</p>
<p>The docker image is built from <a class="reference external" href="https://github.com/cyrusimap/cyrus-docker/blob/master/Debian/Dockerfile">Dockerfile</a> in the cyrus-docker repo.  If you
want to locally reproduce the same testing that CI runs, you can search it
for &quot;dovecot.git&quot; and &quot;imaptest.git&quot; to see how these two components
are fetched and built, and do the same yourself.  Briefly, Dovecot is built
from a known commit id on the upstream repository, whereas IMAPTest is built
from the &quot;cyrus&quot; branch of our own fork.</p>
</section>
</section>
<section id="rebuild-cyrus-for-testing">
<h2>Rebuild Cyrus for Testing<a class="headerlink" href="#rebuild-cyrus-for-testing" title="Permalink to this heading"></a></h2>
<p>Prepare to rebuild by making the source tree shiny and clean as if you've done a brand new checkout. Leave no old artifacts lying around!</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>/path/to/cyrus-imapd
make<span class="w"> </span>clean
git<span class="w"> </span>clean<span class="w"> </span>-f<span class="w"> </span>-x<span class="w"> </span>-d
autoreconf<span class="w"> </span>-v<span class="w"> </span>-i
</pre></div>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Apply caution! The <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">clean</span></code> removes anything that's a build product, but also anything it doesn't know about: which may include your new source files you haven't added yet.</p>
</div>
<p>Set the compile flags for testing and debugging. It may be of use to also add <code class="docutils literal notranslate"><span class="pre">--std=gnu99</span></code> here.  That does TONS of warnings, and <code class="docutils literal notranslate"><span class="pre">-g</span></code> enables debug mode.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">CFLAGS</span><span class="o">=</span><span class="s2">&quot;-g -fPIC -W -Wall -Wextra -Werror&quot;</span>
</pre></div>
</div>
<p>Configure the environment.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>./configure<span class="w"> </span>--prefix<span class="o">=</span>/usr/cyrus<span class="w"> </span>--with-cyrus-prefix<span class="o">=</span>/usr/cyrus<span class="w"> </span><span class="se">\</span>
--enable-autocreate<span class="w"> </span>--enable-http<span class="w"> </span>--enable-unit-tests<span class="w"> </span><span class="se">\</span>
--enable-replication<span class="w"> </span>--enable-nntp<span class="w"> </span>--enable-murder<span class="w"> </span><span class="se">\</span>
--enable-idled<span class="w"> </span>--enable-xapian<span class="w"> </span>--enable-calalarmd<span class="w"> </span><span class="se">\</span>
--enable-backup

make<span class="w"> </span>lex-fix<span class="w">   </span><span class="c1"># you need this if compile fails with errors from sieve/sieve.c</span>
</pre></div>
</div>
<p>And finally, make it.</p>
<p>If you're testing across versions, the binsymlinks is necessary as older Cyrus doesn't have the binaries in the new locations. This uses the default install path of <code class="docutils literal notranslate"><span class="pre">/usr/cyrus/</span></code>. It can be useful to also have <code class="docutils literal notranslate"><span class="pre">/usr/cyrus25</span></code>, <code class="docutils literal notranslate"><span class="pre">/usr/cyrus24</span></code>, etc, if you're testing with older versions as well.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>make<span class="w"> </span>-j16<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span>make<span class="w"> </span>-j16<span class="w"> </span>check
sudo<span class="w"> </span>make<span class="w"> </span>install
sudo<span class="w"> </span>make<span class="w"> </span>install-binsymlinks
sudo<span class="w"> </span>cp<span class="w"> </span>tools/mkimap<span class="w"> </span>/usr/cyrus/bin/mkimap
</pre></div>
</div>
</section>
<section id="running-the-tests">
<h2>Running the tests<a class="headerlink" href="#running-the-tests" title="Permalink to this heading"></a></h2>
<p>Cassandane internals need to run as the <code class="docutils literal notranslate"><span class="pre">cyrus</span></code> user, but if you gave
yourself passwordless sudo access as instructed above, then Cassandane will
take care of switching to the <code class="docutils literal notranslate"><span class="pre">cyrus</span></code> user for you.  In which case, just run
it as yourself.</p>
<p>If you didn't give yourself this access, you will first need to become the
<code class="docutils literal notranslate"><span class="pre">cyrus</span></code> user by some other means, and then run it from there.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>/path/to/cyrus-imapd/cassandane
./testrunner.pl
</pre></div>
</div>
<p>Do not run it as root.</p>
</section>
<section id="debugging-and-stacktraces">
<h2>Debugging and stacktraces<a class="headerlink" href="#debugging-and-stacktraces" title="Permalink to this heading"></a></h2>
<p>Check out the guide to <a class="reference internal" href="../reference/faqs/o-gdb.html#faqs-o-gdb"><span class="std std-ref">running Cyrus components under gdb</span></a>.</p>
<p>In the event of a crash, here's how to <a class="reference internal" href="../reference/faqs/o-coredump.html#faqs-o-coredump"><span class="std std-ref">generate a stacktrace</span></a>.</p>
<p>Core dumps will be owned by the <code class="docutils literal notranslate"><span class="pre">cyrus</span></code> user, but your source tree will
probably be owned by yourself.  Copy the core dump somewhere convenient,
change the ownership to yourself, and then you can open the core file in
gdb for examination.</p>
</section>
<section id="tips-and-tricks">
<h2>Tips and Tricks<a class="headerlink" href="#tips-and-tricks" title="Permalink to this heading"></a></h2>
<p>Read the script to see other options. If you're having problems, add more
<code class="docutils literal notranslate"><span class="pre">-v</span></code> options to the testrunner to get more info out.</p>
<p><strong>Looking for memory leaks?</strong> Run with --valgrind to use valgrind (if it's
installed). It is slower, which is why it doesn't need to be always used.</p>
<p>Running with -v -v is very noisy, but gives a lot more data.  For example: all
IMAP telemetry.</p>
<p>Also helpful to run <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">tail</span> <span class="pre">-f</span> <span class="pre">/var/log/syslog</span></code>, and examine
/var/tmp/cass as <code class="docutils literal notranslate"><span class="pre">cyrus</span></code> to examine log files and disk structures for
failed tests.</p>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="github-guide.html" class="btn btn-neutral float-left" title="GitHub guide" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="coverage.html" class="btn btn-neutral float-right" title="Test Coverage" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 1993–2025, The Cyrus Team.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>
 



</body>
</html>