Skip to content

Commit

Permalink
Strike 3 ..
Browse files Browse the repository at this point in the history
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
AB Srinivasan committed Sep 13, 2011
1 parent 8a8ebdc commit d8cbea0
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cloud_controller/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion stager/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file not shown.
Binary file modified staging/lib/vcap/staging/plugin/java_web/resources/tomcat.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion staging/lib/vcap/staging/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module VCAP
module Staging
VERSION = '0.1.3'
VERSION = '0.1.4'
end
end
2 changes: 1 addition & 1 deletion staging/spec/unit/java_web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions staging/spec/unit/tomcat_spec.rb
Original file line number Diff line number Diff line change
@@ -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.