Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit d8cbea0597a791196093cb2c9a4750b5b482a69f 1 parent 8a8ebdc
AB Srinivasan authored
View
2  cloud_controller/Gemfile.lock
@@ -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
BIN  stager/vendor/cache/vcap_staging-0.1.0.gem → cloud_controller/vendor/cache/vcap_staging-0.1.4.gem
Binary file not shown
View
2  stager/Gemfile.lock
@@ -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)
View
BIN  cloud_controller/vendor/cache/vcap_staging-0.1.3.gem → stager/vendor/cache/vcap_staging-0.1.4.gem
Binary file not shown
View
BIN  staging/lib/vcap/staging/plugin/java_web/resources/tomcat.zip
Binary file not shown
View
2  staging/lib/vcap/staging/version.rb
@@ -1,5 +1,5 @@
module VCAP
module Staging
- VERSION = '0.1.3'
+ VERSION = '0.1.4'
end
end
View
2  staging/spec/unit/java_web_spec.rb
@@ -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
View
19 staging/spec/unit/tomcat_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.