From 25204787dfa9fd3486a9244de56d92fe3d5bfb99 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 24 Feb 2016 13:08:19 -0800 Subject: fix time comparison bug in network test --- tests/white-box/network.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/white-box/network.rb b/tests/white-box/network.rb index 2436230b..436fc8a8 100644 --- a/tests/white-box/network.rb +++ b/tests/white-box/network.rb @@ -77,9 +77,9 @@ class Network < LeapTest cert_paths.each do |cert_path| if File.exists?(cert_path) cert = OpenSSL::X509::Certificate.new(File.read(cert_path)) - if cert.not_after > Time.now + if Time.now > cert.not_after fail "The certificate #{cert_path} expired on #{cert.not_after}" - elsif cert.not_after > Time.now + THIRTY_DAYS + elsif Time.now + THIRTY_DAYS > cert.not_after fail "The certificate #{cert_path} will expire soon, on #{cert.not_after}" end end -- cgit v1.2.3