diff --git a/tests/test_partitions.py b/tests/test_partitions.py index 00c5c27fd9409ff690420a3a71216314f0634c31..d7f0fc22de81477e48639403531661935db0248c 100755 --- a/tests/test_partitions.py +++ b/tests/test_partitions.py @@ -28,24 +28,28 @@ paths = [ { 'mount_point': '/', 'recommended_types': ('ext4',), - 'min_size_gbytes': 14, + 'min_size_gbytes': 9, + 'reco_size_gbytes': 14, 'min_available_gbytes': 4, }, { 'mount_point': '/home/msuser/msinstance', - 'recommended_types': ('ext4', 'nfs', 'nfsv4'), - 'min_size_gbytes': 300, - 'min_available_gbytes': 15, + 'recommended_types': ('ext4', 'nfs', 'nfs4'), + 'min_size_gbytes': 5, + 'reco_size_gbytes': 300, + 'min_available_gbytes': 5, }, { 'mount_point': '/home/skyreach', - 'recommended_types': ('ext4', 'nfs', 'nfsv4'), - 'min_size_gbytes': 19, - 'min_available_gbytes': 5, + 'recommended_types': ('ext4', 'nfs', 'nfs4'), + 'min_size_gbytes': 5, + 'reco_size_gbytes': 9, + 'min_available_gbytes': 2, }, { 'type': 'swap', 'min_size_gbytes': 1, + 'reco_size_gbytes': 2, }, ] @@ -129,9 +133,13 @@ def check_path(p): name = 'swap' psize = get_swap_gbytes() - if psize and psize < p['min_size_gbytes']: - print('Partition of %s is smaller than the minimum required size %s(%s GB < %s GB)%s.' % (name, RED, psize, p['min_size_gbytes'], DEF)) - error = True + if psize: + if psize < p['min_size_gbytes']: + print('Partition of %s is smaller than the minimum required size %s(%s GB < %s GB)%s.' % (name, RED, psize, p['min_size_gbytes'], DEF)) + error = True + elif psize < p['reco_size_gbytes']: + print('Partition of %s is smaller than the recommended size %s(%s GB < %s GB)%s.' % (name, YELLOW, psize, p['reco_size_gbytes'], DEF)) + warning = True for p in paths: check_path(p)