Bug 38727 - Dovecot quota support tests
Dovecot quota support tests
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: Mail
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-18 16:23 CEST by Daniel Tröder
Modified: 2023-03-25 06:43 CET (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2015-06-18 16:23:02 CEST
Test features introduced with #38474 and #38553:

* user quota (LDAP univentionMailUserQuota in MB):
  a) quota set with UDM should be reflected by IMAP4.getquota()
  b) quota set with IMAP4.setquota() should be reflected by UDM
  c) going over mail/dovecot/quota/warning/text/PERCENT=TEXT percent of quota should trigger a warning message TEXT with subject mail/dovecot/quota/warning/subject
  d) user over quota should not be able to IMAP4.append()

* quota-service for Postfix: new mails should be rejected during SMTP dialogue if user is over quota (until 110% is allowed)
  a) user under quota should receive email
  b) for a user over quota, Postfix should reject the mail (not bounce)
Comment 1 Daniel Tröder univentionstaff 2015-06-22 11:48:09 CEST
In commit 61392 two tests were added:
40_mail/40_dovecot_quota
40_mail/41_dovecot_quota-status

"user quota -> b) quota set with IMAP4.setquota() should be reflected by UDM" cannot be implemented with the Dovecot configuration used in UCS. IMAP4.setquota() needs a admin-user, but that only works with a dict-quota backend, which does not support a LDAP userdb.
Comment 2 Stefan Gohmann univentionstaff 2015-08-08 19:23:20 CEST
The test case failed:
http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-3/job/Autotest%20MultiEnv/SambaVersion=s3,Systemrolle=slave/3/

*** BEGIN *** ['/usr/bin/python', '41_dovecot_quota-status'] ***
*** 40_mail/41_dovecot_quota-status *** Test Dovecots quota-status service for Postfix ***
*** START TIME: 2015-08-08 08:39:07 ***
41_dovecot_quota-status:70: SyntaxWarning: name 'timeout' is assigned to before global declaration
  global timeout
Creating users/user object with {'username': 'hn1vsuic4x', 'set': {'mailHomeServer': 'slave094.autotest094.local', 'UniventionDovecotUserQuota': '2', 'mailPrimaryAddress': 'hn1vsuic4x@autotest094.local'}, 'firstname': 'uzhtid63rn', 'lastname': 'bs72y8ffzh', 'position': 'cn=users,dc=autotest094,dc=local', 'password': 'univention'}
Waiting for replication:
CRITICAL: no change of listener transaction id for last 0 checks (nid=4454 lid=4445)
CRITICAL: no change of listener transaction id for last 0 checks (nid=4454 lid=4451)
OK: replication complete (nid=4454 lid=4454)
Done: replication complete.
*** Sending mail: recipients=['hn1vsuic4x@autotest094.local'] sender='tarpit@example.com' subject='41_dovecot_quota-status 1' idstring='no id string' gtube=False server='slave094' port=25 tls=False username=None password=None HELO/EHLO='ucstest.5512.example.com'
*** Sending mail: recipients=['hn1vsuic4x@autotest094.local'] sender='tarpit@example.com' subject='41_dovecot_quota-status 2' idstring='no id string' gtube=False server='slave094' port=25 tls=False username=None password=None HELO/EHLO='ucstest.5512.example.com'
Cleanup after exception: <type 'exceptions.IOError'> [Errno 2] No such file or directory: '/var/spool/dovecot/private/autotest094.local/hn1vsuic4x/Maildir/tmp/1439037575.M4097P5574.slave094'
Performing UCSTestUDM cleanup...
Traceback (most recent call last):
  File "41_dovecot_quota-status", line 72, in <module>
    main()
  File "41_dovecot_quota-status", line 65, in main
    if not rejected or mail_delivered("Subject: 41_dovecot_quota-status 2", mail_address=mail):
  File "/usr/lib/pymodules/python2.7/univention/testing/decorators.py", line 13, in __call__
UCSTestUDM cleanup done
    result = self.func(*args, **kwargs)
  File "/usr/share/ucs-test/40_mail/essential/mail.py", line 377, in mail_delivered
    with open(_file) as fi:
IOError: [Errno 2] No such file or directory: '/var/spool/dovecot/private/autotest094.local/hn1vsuic4x/Maildir/tmp/1439037575.M4097P5574.slave094'
*** END TIME: 2015-08-08 08:39:35 ***
*** TEST DURATION (H:MM:SS.ms): 0:00:28.223253 ***
*** END *** 1 ***


Am 08.08.2015 um 15:57 schrieb Sönke Schwardt-Krummrich:
> looks like a timing issue. IIRC the mail is created in  ... /tmp/... and then moved to target dir (usually ... /new/...). 
> We should change the ucs-test lib to ignore the tmp dir while looking for the delivered mail.
Comment 3 Stefan Gohmann univentionstaff 2015-08-08 19:26:16 CEST
I've disabled the test case: r62829 + r62830 + r62831
Comment 4 Daniel Tröder univentionstaff 2015-08-10 17:51:35 CEST
Commits 62875 & 62876 exclude the 'tmp' directory from searches in dovecots spool directory.
Comment 5 Stefan Gohmann univentionstaff 2016-10-12 07:48:24 CEST
For this bug is no separate QA needed.