omf_ec 6.0.7.1 → 6.0.8.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b35340c3fde964edf505401ceeaf2aa6bd4bbc26
4
- data.tar.gz: a6270d75c002b94eca26ded2038e12e49ebfc291
5
- SHA512:
6
- metadata.gz: 63bb6972c62085a4d1e24ab030dde5cd3c156322752b8afa77268bae6b78ff85822cba2d8946bebf960e36f9fc39481c54d9ddb6912e77a5c64703db45ea45b8
7
- data.tar.gz: 7cb143e77406ef4cf5243f9a094c468a86edb51a36fc5ac17ac58db74f2afcf927cfda9f52750548e7db94bb5e391e8316c55ef51e0b0bc9f7b2a283ab25d84f
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YmRmNjg3NjEwYzNkMWJlODQ3MWYyYTMzYmUwYzc1YWRkZjhmMWZiNg==
5
+ data.tar.gz: !binary |-
6
+ ZjgxMTE4NGZhODc1NGEzNWJlNDgwMjM3NTIxN2EwMGViZjQ2M2NmNw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZWFlMjZmZjdlOWM5M2QzYzhiZDE2NzNmN2M5ZDY1ZDMyNjNkMjdjZDRhZmQ4
10
+ Y2NiM2U3OWE5YjQ2OTkzM2I1ZjgzZjg5YzJmMzhhNTc5MjcwNWU2ZjYwYWQ2
11
+ YTgwYmIwOWM5ZDUyYTI1ZmVhMmI1YTA1MzYzYTBjM2IxZWM2MDY=
12
+ data.tar.gz: !binary |-
13
+ YmNhZGJmMzZkYTNlZjkxZTI4YTdmYmVmNTgyZTg1YWQwOTQ2ZmIzZGVjMDdk
14
+ N2Y5NTlmNDM0N2FkYmU1ODM1YmU2ZGU5MmNkNjUxYWU4M2JhYTAwNzc1NWQz
15
+ NDNhMDI4ZWQwZjFmNWEwMzdiNTBhYzA5M2M3ZWFjZmQ1MDI3MzY=
data/bin/omf_ec CHANGED
@@ -54,10 +54,22 @@ command :exec do |c|
54
54
  c.arg_name "experiment_name"
55
55
  c.flag [:e, :experiment]
56
56
 
57
- c.desc "Default OML URI to use for collecting measurements"
57
+ c.desc "OML URI to use for collecting the experiment's measurements"
58
58
  c.arg_name "uri"
59
59
  c.flag [:oml_uri]
60
60
 
61
+ c.desc "OML URI to use for EC Instrumentation"
62
+ c.arg_name "uri"
63
+ c.flag [:inst_oml_uri]
64
+
65
+ c.desc "OML ID to use for EC Instrumentation"
66
+ c.arg_name "id"
67
+ c.flag [:inst_oml_id]
68
+
69
+ c.desc "OML Domain to use for EC Instrumentation"
70
+ c.arg_name "domain"
71
+ c.flag [:inst_oml_domain]
72
+
61
73
  c.desc "Check script version (you need to define OMF_VERSIONS in your script"
62
74
  c.switch "version_check"
63
75
 
@@ -252,11 +264,11 @@ end
252
264
 
253
265
  def load_exp(exp_path, global_options = {} , options = {}, properties = {})
254
266
  begin
255
- if global_options[:cert] && File.exist?(File.expand_path(global_options[:cert])) &&
256
- global_options[:key] && File.exist?(File.expand_path(global_options[:key]))
257
267
 
258
- entity = OmfCommon::Auth::Certificate.create_from_x509(File.read(File.expand_path(global_options[:cert])),
259
- File.read(File.expand_path(global_options[:key])))
268
+ if options[:inst_oml_uri] && options[:inst_oml_id] && options[:inst_oml_domain]
269
+ require 'oml4r'
270
+ instrument_ec = OML4R::init(nil, { collect: options[:inst_oml_uri], nodeID: options[:inst_oml_id], domain: options[:inst_oml_domain] , appName: File.basename($PROGRAM_NAME)} )
271
+ OmfCommon::Measure.enable if instrument_ec
260
272
  end
261
273
 
262
274
  opts = {
@@ -274,7 +286,7 @@ def load_exp(exp_path, global_options = {} , options = {}, properties = {})
274
286
  }
275
287
  }
276
288
 
277
- opts[:communication][:auth] = {} if entity
289
+ opts[:communication][:auth] = { authenticate: true } if global_options[:cert]
278
290
 
279
291
  OmfCommon.init(:development, opts) do |el|
280
292
 
@@ -286,8 +298,14 @@ def load_exp(exp_path, global_options = {} , options = {}, properties = {})
286
298
  info "Execute: #{exp_path}"
287
299
  info "Properties: #{OmfEc.experiment.cmdline_properties}"
288
300
 
289
- OmfCommon::Auth::CertificateStore.instance.register_default_certs(File.expand_path(global_options[:root_cert_dir])) if global_options[:root_cert_dir]
290
- OmfCommon::Auth::CertificateStore.instance.register(entity, OmfCommon.comm.local_address) if entity
301
+ ec_cert = OmfCommon.load_credentials(
302
+ root_cert_dir: global_options[:root_cert_dir],
303
+ entity_cert: global_options[:cert],
304
+ entity_key: global_options[:key]
305
+ )
306
+
307
+ ec_cert.resource_id = OmfCommon.comm.local_address
308
+ OmfCommon::Auth::CertificateStore.instance.register(ec_cert)
291
309
 
292
310
  begin
293
311
  include OmfEc::Backward::DefaultEvents
@@ -10,6 +10,18 @@ class Array
10
10
  end
11
11
  end
12
12
 
13
+ def startApplication(app_name)
14
+ if !self.empty? && self.all? { |v| v.class == OmfEc::Group }
15
+ self.each { |g| g.startApplication(app_name) }
16
+ end
17
+ end
18
+
19
+ def startApplication(app_name)
20
+ if !self.empty? && self.all? { |v| v.class == OmfEc::Group }
21
+ self.each { |g| g.startApplication(app_name) }
22
+ end
23
+ end
24
+
13
25
  def stopApplications
14
26
  if !self.empty? && self.all? { |v| v.class == OmfEc::Group }
15
27
  self.each { |g| g.stopApplications }
@@ -14,7 +14,7 @@ module OmfEc
14
14
  def_event :ALL_NODES_UP do |state|
15
15
  all_groups? do |g|
16
16
  plan = g.members.values.uniq.sort
17
- actual = state.find_all { |v| v.joined?(g.address) }.map { |v| v[:address] }.sort
17
+ actual = state.find_all { |v| v.joined?(g.address) }.map { |v| v[:address].to_s }.sort
18
18
 
19
19
  debug "Planned: #{g.name}(#{g.address}): #{plan}"
20
20
  debug "Actual: #{g.name}(#{g.address}): #{actual}"
@@ -22,6 +22,7 @@ module OmfEc
22
22
  if plan.empty? && actual.empty?
23
23
  warn "Group '#{g.name}' is empty"
24
24
  end
25
+
25
26
  plan.empty? ? true : plan == actual
26
27
  end
27
28
  end
@@ -36,6 +36,22 @@ module OmfEc
36
36
  end
37
37
  end
38
38
 
39
+ def startApplication(app_name)
40
+ if self.app_contexts.find { |v| v.name == app_name }
41
+ resources[type: 'application', name: app_name].state = :running
42
+ else
43
+ warn "No application with name '#{app_name}' defined in group #{self.name}. Nothing to start"
44
+ end
45
+ end
46
+
47
+ def startApplication(app_name)
48
+ if self.app_contexts.find { |v| v.name == app_name }
49
+ resources[type: 'application', name: app_name].state = :running
50
+ else
51
+ warn "No application with name '#{app_name}' defined in group #{self.name}. Nothing to start"
52
+ end
53
+ end
54
+
39
55
  def startApplications
40
56
  if self.app_contexts.empty?
41
57
  warn "No applications defined in group #{self.name}. Nothing to start"
@@ -140,7 +140,7 @@ module OmfEc
140
140
 
141
141
  # Unique experiment id
142
142
  def id
143
- @name.nil? ? @id : "#{@name}-#{@id}"
143
+ @name.nil? ? @id : @name
144
144
  end
145
145
 
146
146
  # Parsing user defined events, checking conditions against internal state, and execute callbacks if triggered
data/lib/omf_ec/group.rb CHANGED
@@ -41,7 +41,7 @@ module OmfEc
41
41
 
42
42
  def address(suffix = nil)
43
43
  t_id = suffix ? "#{self.id}_#{suffix.to_s}" : self.id
44
- "#{OmfCommon.comm.conn_info[:proto]}://#{t_id}@#{OmfCommon.comm.conn_info[:domain]}"
44
+ OmfCommon.comm.string_to_address(t_id)
45
45
  end
46
46
 
47
47
  def associate_topic(topic)
@@ -3,6 +3,8 @@
3
3
  # You should find a copy of the License in LICENSE.TXT or at http://opensource.org/licenses/MIT.
4
4
  # By downloading or using this software you accept the terms and the liability disclaimer in the License.
5
5
 
6
+ require 'omf_common/version'
7
+
6
8
  module OmfEc
7
- VERSION = "6.0.7.1"
9
+ VERSION = OmfCommon.version_of('omf_ec')
8
10
  end
data/lib/omf_ec.rb CHANGED
@@ -19,6 +19,16 @@ require "omf_ec/context"
19
19
  require "omf_ec/dsl"
20
20
 
21
21
  module OmfEc
22
+
23
+ # OML Measurement Point (MP)
24
+ # This MP is for measurements about messages received by the Resource Proxy
25
+ class OmfEc::MPReceived < OML4R::MPBase
26
+ name :ec_received
27
+ param :time, :type => :double # Time (s) when this message was received
28
+ param :topic, :type => :string # Pubsub topic where this message came from
29
+ param :mid, :type => :string # Unique ID this message
30
+ end
31
+
22
32
  class << self
23
33
  # Experiment instance
24
34
  #
@@ -36,7 +46,8 @@ module OmfEc
36
46
 
37
47
  def register_default_callback(topic)
38
48
  topic.on_inform do |msg|
39
- case msg.itype
49
+ OmfEc::MPReceived.inject(Time.now.to_f, topic.id, msg.mid) if OmfCommon::Measure.enabled?
50
+ case msg.itype.upcase
40
51
  when 'CREATION.FAILED'
41
52
  warn "RC reports creation.failed: '#{msg[:reason]}'", msg.src
42
53
  debug msg, msg.src
data/omf_ec.gemspec CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |s|
27
27
  s.add_development_dependency "pry"
28
28
  s.add_development_dependency "mocha"
29
29
 
30
- s.add_runtime_dependency "omf_common", "= 6.0.7.1"
31
- s.add_runtime_dependency "gli", "~> 2.5.3"
30
+ s.add_runtime_dependency "omf_common", "= #{OmfCommon::VERSION}"
31
+ s.add_runtime_dependency "gli"
32
32
  end
@@ -15,7 +15,7 @@ describe OmfEc::Experiment do
15
15
  @experiment.id.wont_be_nil
16
16
 
17
17
  @experiment.name = 'bob'
18
- @experiment.id.must_match /bob-/
18
+ @experiment.id.must_match /bob/
19
19
  end
20
20
 
21
21
  it "must be able to add event" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_ec
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.7.1
4
+ version: 6.0.8.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - NICTA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-30 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -42,42 +42,42 @@ dependencies:
42
42
  name: simplecov
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mocha
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 6.0.7.1
89
+ version: 6.0.8.pre.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 6.0.7.1
96
+ version: 6.0.8.pre.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: gli
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
- version: 2.5.3
103
+ version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
- version: 2.5.3
110
+ version: '0'
111
111
  description: Experiment controller of OMF, a generic framework for controlling and
112
112
  managing networking testbeds.
113
113
  email:
@@ -165,24 +165,18 @@ require_paths:
165
165
  - lib
166
166
  required_ruby_version: !ruby/object:Gem::Requirement
167
167
  requirements:
168
- - - '>='
168
+ - - ! '>='
169
169
  - !ruby/object:Gem::Version
170
170
  version: 1.9.3
171
171
  required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
- - - '>='
173
+ - - ! '>'
174
174
  - !ruby/object:Gem::Version
175
- version: '0'
175
+ version: 1.3.1
176
176
  requirements: []
177
177
  rubyforge_project: omf_ec
178
- rubygems_version: 2.0.6
178
+ rubygems_version: 2.0.7
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: OMF experiment controller
182
- test_files:
183
- - test/omf_ec/context_spec.rb
184
- - test/omf_ec/dsl_spec.rb
185
- - test/omf_ec/experiment_property_spec.rb
186
- - test/omf_ec/experiment_spec.rb
187
- - test/omf_ec/group_spec.rb
188
- - test/test_helper.rb
182
+ test_files: []