Permalink
Browse files

Strike 3 ..

Revert tomcat.zip change that introduced a digest in the archive (and the
corresponding BVT addition) in preference to a more effective unit test
described below. Also fix an incomplete test description.
We now save a SHA1 digest of the tomcat.zip resulting from running the update /
upgrade script (see vcap-java/tomcat-setup) and use a unit test (included in
this change) to verify that the SHA1 digest of the 'tomcat.zip' used by the
CloudController matches the saved SHA1 thus helping us prevent out-of-band
(to the update script) updates to the tomcat.zip used by the CloudController.
Updated to include this change in the new staging gem.
Before this change can be actually merged, an update to the 'java' submodule
reference is needed. That will be part of a different commit. (This is now done)
- Included in the new staging gem.
- Updated vcap_staging gem in vendor cache in 'stager'

Change-Id: I4006c1d04dc307a7b4c17362b565de93aa4971f9
  • Loading branch information...
1 parent 8a8ebdc commit d8cbea0597a791196093cb2c9a4750b5b482a69f AB Srinivasan committed Aug 31, 2011
@@ -132,7 +132,7 @@ GEM
tzinfo (0.3.26)
uuidtools (2.1.2)
vcap_logging (0.1.0)
- vcap_staging (0.1.3)
+ vcap_staging (0.1.4)
yajl-ruby (0.8.2)
PLATFORMS
View
@@ -54,7 +54,7 @@ GEM
rack (>= 1.0.0)
tilt (1.3.2)
vcap_logging (0.1.1)
- vcap_staging (0.1.0)
+ vcap_staging (0.1.4)
vegas (0.1.8)
rack (>= 1.0.0)
webmock (1.6.4)
Binary file not shown.
@@ -1,5 +1,5 @@
module VCAP
module Staging
- VERSION = '0.1.3'
+ VERSION = '0.1.4'
end
end
@@ -11,7 +11,7 @@
end
end
-describe "A Java web being staged " do
+describe "A Java web application being staged " do
before(:all) do
app_fixture :java_web
end
@@ -0,0 +1,19 @@
+require 'spec_helper'
+require 'fileutils'
+require 'digest/sha1'
+
+describe "Cloud Foundry Tomcat contents fingerprint verification" do
+
+ CF_TOMCAT_SHA1_REL_PATH = "../../../java/tomcat-setup/cf-tomcat.zip.sha1"
+ it "should match the saved fingerprint generated by the Tomcat update script" do
+ tomcat_path = File.join(File.dirname(__FILE__),
+ "../../lib/vcap/staging/plugin/java_web/resources")
+ tomcat_zip = File.join(tomcat_path, "tomcat.zip")
+ digest = Digest::SHA1.hexdigest(File.read(tomcat_zip))
+
+ saved_digest_file = File.join(File.dirname(__FILE__), CF_TOMCAT_SHA1_REL_PATH)
+ saved_digest = IO.readlines(saved_digest_file)[0].split[0]
+
+ digest.should == saved_digest
+ end
+end

0 comments on commit d8cbea0

Please sign in to comment.