Bug 34625 - Check file quota module
Check file quota module
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: UMC
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Dmitry Galkin
Philipp Hahn
:
Depends on: 31277 35633
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-23 17:58 CEST by Philipp Hahn
Modified: 2023-03-25 06:44 CET (History)
2 users (show)

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 Philipp Hahn univentionstaff 2014-04-23 17:58:26 CEST
<https://hutten.knut.univention.de/mediawiki/index.php/Produkttests_UCS_3.2_UMC#Quota-Modul>
1. Check query command.
2. Try to setup a quota on one mount point (may require setting up some test partition using the look-back-device?).
Comment 1 Stefan Gohmann univentionstaff 2014-04-23 19:45:24 CEST
(In reply to Philipp Hahn from comment #0)
> 2. Try to setup a quota on one mount point (may require setting up some test
> partition using the look-back-device?).

Have a look at:
 ucs-test/tests/53_samba-common/50quota

http://forge.univention.org/websvn/filedetails.php?repname=dev&path=%2Fbranches%2Fucs-3.2%2Fucs-3.2-1%2Ftest%2Fucs-test%2Ftests%2F53_samba-common%2F50quota
Comment 2 Dmitry Galkin univentionstaff 2014-05-20 17:01:51 CEST
r50463:

  * /60_umc-system/50_umc-service-quotas-management:
    test quota management via UMC (Bug #34625) 
  * /60_umc-system/TestUMCSystemModule.py:
    refactored query request methods
Comment 3 Dmitry Galkin univentionstaff 2014-05-27 11:23:15 CEST
The test in the AWS envs is skipped because the partitioning is different from the default UCS installations:

Creating a test user for testing user-specific quotas set up
Creating users/user object with {'username': 'umc_test_user_aqfdsb', 'position': 'cn=users,dc=autotest090,dc=local', 'password': 'univention', 'firstname': 'ybcw9hig5p', 'lastname': 'bwfpjc960w'}
Waiting for replication:
OK: replication complete (nid=9445 lid=9445)
Done: replication complete.
Making 'quota/partitions' query request
Checking quotas query response structure
Choosing partition device for the test (with '/boot' mount point)
Failed to select a partition for the test, skipping
Cleaning up created quotas and test user (if any), restoring initial partition quota setting to 'inUse=None'
Cleanup after exception: <type 'exceptions.SystemExit'> 77
Performing UCSTestUDM cleanup...
UCSTestUDM cleanup done
Comment 4 Dmitry Galkin univentionstaff 2014-06-02 16:19:06 CEST
r50817:

  * /60_umc-system/50_umc-service-quotas-management: 
  now using '/' mount point to test quotas management
  with any partitioning scheme (Bug #34625)


The test assumes that setting quotas for '/' now works, i.e. that Bug #31277 is resolved. (Verified on UCS member server with manually patched /usr/lib/pymodules/python2.6/univention/management/console/modules/quota/tools.py)
Comment 5 Erik Damrose univentionstaff 2014-07-01 14:54:58 CEST
(In reply to Dmitry Galkin from comment #4)
> The test assumes that setting quotas for '/' now works, i.e. that Bug #31277
> is resolved.

Looks good: While QAing Bug #31277 the test passed successfully
Comment 6 Philipp Hahn univentionstaff 2014-07-08 11:51:51 CEST
The test currently fails in EC2, even thou Bug #31277 is fixed. After adding a debug statement in /usr/share/pyshared/univention/management/console/modules/quota/tools.py it shows the cause:

# umc-command -U Administrator -P univention quota/users/set -o partitionDevice=/dev/vda1 -o user=y23j4odaqi -o sizeLimitSoft=10 -o sizeLimitHard=10 -o fileLimitHard=0 -o fileLimitSoft=0
...
# LANG=C /usr/sbin/setquota -u y23j4odaqi 10240 10240 0 0 /dev/vda1
setquota: Cannot stat() given mountpoint /dev/vda1: No such file or directory
Skipping...
setquota: No correct mountpoint specified.
setquota: Cannot initialize mountpoint scan.

In /etc/fstab "/dev/vda1" is used, but as EC2 is using Xen, it should be "/dev/*x*vda1":

# ucr search --brief --value vda
grub/boot: /dev/vda
grub/root: /dev/xvda1
installer/device/0/name: /dev/vda2
installer/device/1/name: /dev/vda1

PS: The test does a reverse-lookup for / through UMC "quota/partitions/query", which already returns the wrong "/dev/vda1":
 # umc-command -U Administrator -P univention quota/partitions/query
 RESULT   : [{...'mountPoint': '/', ... 'partitionDevice': '/dev/vda1'}, ...]
as its wrong in both mount files:
 # grep vda /etc/fstab /etc/mtab 
 /etc/fstab:/dev/vda1    /       ext3    acl,errors=remount-ro,user_xattr,usrquota       0       1
 /etc/fstab:/dev/xvda3   none    swap    sw      0       0
 /etc/mtab:/dev/vda1 / ext3 rw,acl,errors=remount-ro,user_xattr,usrquota 0 0

Actually swap is also wrong and does not exist:
  # cat /proc/partitions 
 major minor  #blocks  name
  202        1   10485760 xvda1

After fixing /etc/fstab manually and rebooting, UMC returns the right information and the test works.
This will be fixed through Bug #35269 in future EC2 images.
Comment 7 Dmitry Galkin univentionstaff 2014-07-08 12:10:03 CEST
r51608:

  * 60_umc-system/50_umc-service-quotas-management:
  don't run the test on UCS versions older than 3.2-3 (Bug #34625)
Comment 8 Philipp Hahn univentionstaff 2014-07-08 12:15:36 CEST
OK: r50463,r50817,r51608
OK: 50_umc-service-quotas-management
FYI: test currently fails with UCS-3.2-2 EC2 images due to the bug described in comment 6