summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <tails@boum.org>2015-02-18 10:56:26 +0000
committerTails developers <tails@boum.org>2015-02-18 11:15:28 +0000
commit68e96960af355bfeec48f21a019c91c7e2df49ff (patch)
treebc161a11b22335baaf72f4b0631fb91f9f611f6b
parent4035e748b09b442b27a334c06bb209eaf1d24e87 (diff)
Add clarifying explanatory comment and variable.
-rw-r--r--features/support/helpers/storage_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/features/support/helpers/storage_helper.rb b/features/support/helpers/storage_helper.rb
index 9860e2a..5b1aeb1 100644
--- a/features/support/helpers/storage_helper.rb
+++ b/features/support/helpers/storage_helper.rb
@@ -70,7 +70,10 @@ class VMStorage
options[:size] ||= 2
options[:unit] ||= "GiB"
options[:type] ||= "qcow2"
- needed = convert_to_MiB(options[:size].to_i, options[:unit]) + 500
+ # Require 'slightly' more space to be available to give a bit more leeway
+ # with rounding, temp file creation, etc.
+ extrapadding = 500
+ needed = convert_to_MiB(options[:size].to_i, options[:unit]) + extrapadding
avail = convert_to_MiB(get_free_space('host', "#{@pool_path}"), "KiB")
assert(avail > needed, "Error creating disk \"#{name}\" in \"#{@pool_path}\". Need " +
"#{needed} MiB but only #{avail} MiB is available.")