omf_ec 6.1.2.pre.2 → 6.1.2.pre.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require 'bundler/setup'
1
2
  require 'rake/testtask'
2
3
  require "bundler/gem_tasks"
3
4
 
@@ -22,20 +22,23 @@ defEvent :rpm_reached_4000 do |state|
22
22
  end
23
23
 
24
24
  # Define a group and add garages to it.
25
- defGroup('garages', prop.garage)
25
+ defGroup('garages', prop.garage, include_childern: true)
26
26
 
27
27
  # :ALL_UP is a pre-defined event,
28
28
  # triggered when all resources set to be part of groups are available and configured as members of the associated groups.
29
29
  onEvent :ALL_UP do
30
30
  group('garages') do |g|
31
- g.create_resource('my_engine', type: 'engine')
31
+ #g.request("child_resources")
32
+ g.engines.request(:rpm)
33
+
34
+ g.create_engine('my_engine') do #, type: 'engine')
32
35
 
33
36
  onEvent :engine_created do
34
37
  info ">>> Accelerating all engines"
35
38
  g.resources[type: 'engine'].throttle = 50
36
-
37
39
  # We periodically check engine RPM
38
40
  every 2.second do
41
+ g.engines.request(:rpm)
39
42
  g.resources[type: 'engine'].rpm
40
43
  end
41
44
  end
@@ -26,18 +26,20 @@ module OmfEc
26
26
  end
27
27
 
28
28
  def all_interfaces_ready?(state)
29
+ results = []
29
30
  all_groups? do |g|
30
31
  plan = g.net_ifs.map { |v| v.conf[:if_name] }.uniq.size * g.members.values.uniq.size
31
- actual = state.count { |v| v.joined?(g.address("wlan"), g.address("net")) }
32
- plan == 0 ? false : plan == actual
32
+ actual = state.count { |v| v.joined?(g.address("wlan"), g.address("net")) && v[:state] == 'UP' }
33
+ results << (plan == actual) unless (plan == 0)
33
34
  end
35
+ !results.include?(false)
34
36
  end
35
37
 
36
38
  def all_apps_ready?(state)
37
39
  results = []
38
40
  all_groups? do |g|
39
41
  plan = g.app_contexts.size * g.members.values.uniq.size
40
- actual = state.count { |v| v.joined?(g.address("application")) }
42
+ actual = state.count { |v| v.joined?(g.address("application")) }
41
43
  results << (plan == actual) unless (plan == 0)
42
44
  end
43
45
  !results.include?(false)
data/lib/omf_ec/runner.rb CHANGED
@@ -152,7 +152,7 @@ module OmfEc
152
152
  end
153
153
 
154
154
  def remove_cmd_opts_from_argv(*args)
155
- args.each { |v| @argv.delete(v) }
155
+ args.each { |v| @argv.slice!(@argv.index(v)) if @argv.index(v) }
156
156
  end
157
157
 
158
158
  def setup_experiment
@@ -174,6 +174,12 @@ module OmfEc
174
174
 
175
175
  remove_cmd_opts_from_argv("exec")
176
176
 
177
+ @argv.in_groups_of(2) do |arg_g|
178
+ if arg_g[0] =~ /^--(.+)/ && !arg_g[1].nil?
179
+ remove_cmd_opts_from_argv(*arg_g)
180
+ end
181
+ end
182
+
177
183
  @oedl_path = @argv[0] && File.expand_path(@argv[0])
178
184
 
179
185
  if @oedl_path.nil? || !File.exist?(@oedl_path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_ec
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.2.pre.2
4
+ version: 6.1.2.pre.3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-29 00:00:00.000000000 Z
12
+ date: 2014-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - '='
100
100
  - !ruby/object:Gem::Version
101
- version: 6.1.2.pre.2
101
+ version: 6.1.2.pre.3
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 6.1.2.pre.2
109
+ version: 6.1.2.pre.3
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: gli
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: 1.3.1
213
213
  requirements: []
214
214
  rubyforge_project: omf_ec
215
- rubygems_version: 1.8.28
215
+ rubygems_version: 1.8.23
216
216
  signing_key:
217
217
  specification_version: 3
218
218
  summary: OMF experiment controller