deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 2/6] RHEVM tests: do not record username/password/hostname with VCR
Date Thu, 07 Mar 2013 22:57:40 GMT
From: David Lutterkort <lutter@redhat.com>

---
 server/tests/drivers/rhevm/common.rb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/server/tests/drivers/rhevm/common.rb b/server/tests/drivers/rhevm/common.rb
index b3d3a63..88d7d36 100644
--- a/server/tests/drivers/rhevm/common.rb
+++ b/server/tests/drivers/rhevm/common.rb
@@ -18,6 +18,14 @@ VCR.configure do |c|
   # NOTE: Empty this directory before re-recording
   c.cassette_library_dir = File.join(File.dirname(__FILE__), 'fixtures')
   c.hook_into :webmock
+  # Rewrite sensitive information before recording
+  c.before_record do |i|
+    u = URI::parse(i.request.uri)
+    u.host = "rhevm.example.com"
+    u.user = "admin"
+    u.password = "secret"
+    i.request.uri = u.to_s
+  end
   # Set :record to :all, when re-recording and between re-record attemps
   # be sure to clear fixtures/*.yml files which can be done with "git checkout".
   # e.g.:
-- 
1.8.1.4


Mime
View raw message