1 When /^I set the system time to "([^"]+)"$/ do |time|
2 next if @skip_steps_while_restoring_background
3 @vm.execute("date -s '#{time}'")
6 When /^I bump the system time with "([^"]+)"$/ do |timediff|
7 next if @skip_steps_while_restoring_background
8 @vm.execute("date -s 'now #{timediff}'")
11 Then /^Tails clock is less than (\d+) minutes incorrect$/ do |max_diff_mins|
12 next if @skip_steps_while_restoring_background
13 guest_time_str = @vm.execute("date --rfc-2822").stdout.chomp
14 guest_time = Time.rfc2822(guest_time_str)
16 diff = (host_time - guest_time).abs
17 assert(diff < max_diff_mins.to_i*60,
18 "The guest's clock is off by #{diff} seconds (#{guest_time})")
19 puts "Time was #{diff} seconds off"