diff --git a/tests/test_partitions.py b/tests/test_partitions.py index 4c4caa119908c3a8a5e0536d74a542591322b4d7..1d1d8cda4e05acc8043254a436fcb3ea1a135717 100755 --- a/tests/test_partitions.py +++ b/tests/test_partitions.py @@ -81,6 +81,7 @@ def get_memory_gbytes(): def get_path_fs(path): + # Example of "df" output: # Filesystem Type 1B-blocks Used Available # /dev/loop2 ext4 52710469632 38253940736 11755397120 status, output = subprocess.getstatusoutput('df --output="source,fstype,size,avail" -B 1 %s | tail -n 1' % path) @@ -88,7 +89,14 @@ def get_path_fs(path): dev, fstype, size, available = output.split() else: dev = fstype = size = available = None - return dev, fstype, to_gbytes(int(size)), to_gbytes(int(available)) + # Example of "mount" output: + # /dev/sdb2 on / type ext4 (rw,relatime,errors=remount-ro) + status, output = subprocess.getstatusoutput("mount | grep '%s '" % dev) + if status == 0: + params = output.split()[-1].strip('()').split(',') + else: + params = list() + return dev, fstype, params, to_gbytes(int(size)), to_gbytes(int(available)) def check_allocation(dev): @@ -130,7 +138,7 @@ if __name__ == '__main__': if os.path.exists(mount_point): mount_point = os.path.realpath(mount_point) name = 'Partition of %s' % mount_point - dev, fstype, psize, available = get_path_fs(mount_point) + dev, fstype, params, psize, available = get_path_fs(mount_point) condition = part_info.get('condition') if condition: subdev = get_path_fs(condition.strip('!'))[0] @@ -145,6 +153,9 @@ if __name__ == '__main__': warning = True if 'nfs' not in fstype: warning = not check_allocation(dev) + if 'acl' in params: + print('%sThe device %s is mounted using ACL.%s Please set "noacl" mount parameter in fstab and reboot.' % (RED, dev, DEF)) + error = True min_available_gbytes = part_info.get('min_available_gbytes') if min_available_gbytes and available < min_available_gbytes: print('%s has less than %s GB available %s(%s GB available)%s.' % (name, min_available_gbytes, RED, available, DEF))