@@ -1521,15 +1521,26 @@ set_disk_free_limit_command1(_Config) ->
1521
1521
ok = control_action (set_disk_free_limit ,
1522
1522
[" 2000kiB" ]),
1523
1523
2048000 = rabbit_disk_monitor :get_disk_free_limit (),
1524
+
1525
+ % % Use an integer
1524
1526
ok = control_action (set_disk_free_limit ,
1525
- [" mem_relative" , " 1.1" ]),
1526
- ExpectedLimit = 1.1 * vm_memory_monitor :get_total_memory (),
1527
- % Total memory is unstable, so checking order
1528
- true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () < 1.2 ,
1529
- true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () > 0.98 ,
1527
+ [" mem_relative" , " 1" ]),
1528
+ check_limit (1 ),
1529
+
1530
+ % % Use a float
1531
+ ok = control_action (set_disk_free_limit ,
1532
+ [" mem_relative" , " 1.5" ]),
1533
+ check_limit (1.5 ),
1534
+
1530
1535
ok = control_action (set_disk_free_limit , [" 50MB" ]),
1531
1536
passed .
1532
1537
1538
+ check_limit (Limit ) ->
1539
+ ExpectedLimit = Limit * vm_memory_monitor :get_total_memory (),
1540
+ % Total memory is unstable, so checking order
1541
+ true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () < 1.2 ,
1542
+ true = ExpectedLimit / rabbit_disk_monitor :get_disk_free_limit () > 0.98 .
1543
+
1533
1544
% % ---------------------------------------------------------------------------
1534
1545
% % rabbitmqctl helpers.
1535
1546
% % ---------------------------------------------------------------------------
0 commit comments