Bug 36207 - Test case 50_umc-service-quotas-management fails in UCS 4.0
Test case 50_umc-service-quotas-management fails in UCS 4.0
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Quota
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0
Assigned To: Arvid Requate
Drees Dormann
: interim-3
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-16 07:06 CEST by Stefan Gohmann
Modified: 2014-11-26 06:54 CET (History)
0 users

See Also:
What kind of report is it?: ---
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 Stefan Gohmann univentionstaff 2014-10-16 07:06:04 CEST
The test case 50_umc-service-quotas-management fails in UCS 4.0:

-------------------------------------------------------------------------------
Creating a test user for testing user-specific quotas setup through UMC
Creating users/user object with {'username': 'umc_test_user_yveesn', 'position': 'cn=users,dc=autotest095,dc=local', 'password': 'univention', 'firstname': 'uafcxhh7hs', 'lastname': 'd61swnpbnp'}
Waiting for replication:
OK: replication complete (nid=7165 lid=7165)
Done: replication complete.
Making 'quota/partitions' query request and checking response structure
Choosing partition device for the test (with '/' mount point)
Deactivating quotas for partition device '/dev/xvda1'
Activating quotas for '/dev/xvda1' partition device
Setting 'umc_test_user_yveesn' user quota for '/dev/xvda1' partition
Removing 'umc_test_user_yveesn' user quota for '/dev/xvda1' partition
Deactivating quotas for '/dev/xvda1' partition device
### FAIL ###
The quota on a device '/dev/xvda1' was reported as 'inUse' after being deactivated
###      ###
Cleaning up created quotas and the test user (if any), restoring initial partition quota setting to 'inUse=False'
Cleanup after exception: <type 'exceptions.SystemExit'> 1
Performing UCSTestUDM cleanup...
UCSTestUDM cleanup done
-------------------------------------------------------------------------------

http://jenkins.knut.univention.de:8080/job/UCS-4.0/job/UCS-4.0-0/job/Autotest%20MultiEnv/SambaVersion=s4,Systemrolle=slave/32/testReport/junit/60_umc-system/50_umc-service-quotas-management/test/

It could be a problem in the test case or in the quota implementation.
Comment 1 Arvid Requate univentionstaff 2014-10-30 14:17:44 CET
Actually the problem was in the UMC quota module, it

1. detected quota activation state via "usrquota" option presence in /etc/mtab
2. failed to disable the "usrquota" option in /etc/mtab during deactivation.

There were more issues. I adjusted the activation/deactivation and detection:

* Detect quota activation via "quotaon" instead of "usrquota"
* When turning quota off skip remount, just leave usrquota fs option on
* Avoid turning quota on/off for all, only do it for the target partition
* Run checkquota only before activation (i.e. with quota off)
* Only run slow checkquota if the aquota.user file doesn't exist yet


The handling of the four layers: fstab, mtab, aquota.user and quotaon/off
should now be clearer, more robust and have less side effects.
Comment 2 Arvid Requate univentionstaff 2014-10-30 15:01:10 CET
For manual testing these commands might be useful:

umc-command quota/partitions/activate \
  -o partitionDevice=/dev/mapper/vg_ucs-root \
  -U Administrator -P univention

umc-command quota/partitions/query \
  -U Administrator -P univention

umc-command quota/partitions/deactivate \
  -o partitionDevice=/dev/mapper/vg_ucs-root \
  -U Administrator -P univention
Comment 3 Drees Dormann univentionstaff 2014-10-31 13:41:03 CET
test case runs without error
quota is activated and deactivated correctly and also 
detected

changelog ok
Comment 4 Stefan Gohmann univentionstaff 2014-11-26 06:54:03 CET
UCS 4.0-0 has been released:
 http://docs.univention.de/release-notes-4.0-0-en.html
 http://docs.univention.de/release-notes-4.0-0-de.html

If this error occurs again, please use "Clone This Bug".