tem_multi_updater 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.4. Updating TEMs also emits them.
2
+
1
3
  v0.3. Added tem_multi_reset_fw which forces the update, resetting the TEM cards.
2
4
 
3
5
  v0.2. Complete test coverage.
@@ -112,13 +112,25 @@ class Updater
112
112
  @logger.info "Uploading TEM firmware to #{transport.inspect}"
113
113
  begin
114
114
  Tem::Firmware::Uploader.upload_cap transport
115
- return true
116
115
  rescue Exception => e
117
116
  @logger.error "Error while uploading TEM firmware to " +
118
117
  "#{transport.inspect} - #{e.class.name}: #{e.message}"
119
118
  @logger.info e.backtrace.join("\n")
120
119
  return false
121
120
  end
121
+
122
+ @logger.info "Emitting TEM at #{transport.inspect}"
123
+ begin
124
+ tem = Tem::Session.new transport
125
+ tem.activate
126
+ tem.emit
127
+ return true
128
+ rescue Exception => e
129
+ @logger.error "Error while emitting TEM at " +
130
+ "#{transport.inspect} - #{e.class.name}: #{e.message}"
131
+ @logger.info e.backtrace.join("\n")
132
+ return false
133
+ end
122
134
  end
123
135
 
124
136
  # Checks if the a smart-card needs a TEM firmware upload.
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{tem_multi_updater}
5
- s.version = "0.3"
5
+ s.version = "0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
9
- s.date = %q{2009-11-10}
9
+ s.date = %q{2009-11-18}
10
10
  s.description = %q{Updates the firmware on all TEMs connected to a tem_multi_proxy.}
11
11
  s.email = %q{victor@costan.us}
12
12
  s.executables = ["tem_multi_reset_fw", "tem_multi_update_fw"]
@@ -68,6 +68,12 @@ class UpdaterTest < Test::Unit::TestCase
68
68
  and_return(true).once
69
69
  flexmock(Tem::Firmware::Uploader).should_receive(:upload_cap).
70
70
  with(:old_transport).once
71
+
72
+ session = Object.new
73
+ flexmock(Tem::Session).should_receive(:new).with(:old_transport).
74
+ and_return(session).once
75
+ flexmock(session).should_receive(:activate).and_return(true).once
76
+ flexmock(session).should_receive(:emit).and_return([]).once
71
77
  assert_equal true, @updater.update_transport(:old_transport),
72
78
  'Outdated smartcard'
73
79
 
@@ -107,7 +113,7 @@ class UpdaterTest < Test::Unit::TestCase
107
113
  [{:major => fw_version[:major], :minor => fw_version[:minor] + 1}, false],
108
114
  [{:data => [], :status => 0x6A88}, true],
109
115
  ].each do |test_case|
110
- _test_needs_update *test_case
116
+ _test_needs_update(*test_case)
111
117
  end
112
118
  end
113
119
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tem_multi_updater
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.3"
4
+ version: "0.4"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-10 00:00:00 -05:00
12
+ date: 2009-11-18 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency