summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-02-24 13:08:19 -0800
committerelijah <elijah@riseup.net>2016-02-24 13:08:19 -0800
commit25204787dfa9fd3486a9244de56d92fe3d5bfb99 (patch)
tree112cb4c388dc7969b15ea353225bff9a156212ca
parent393d46feb9890a87c5764f40b61c51d03fe0a4fe (diff)
fix time comparison bug in network test
-rw-r--r--tests/white-box/network.rb4
1 files 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