oneacct-export 0.2.7 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +1 -21
  5. data/bin/oneacct-export +7 -6
  6. data/config/conf.yml +25 -7
  7. data/lib/data_validators/apel_data_validator.rb +99 -0
  8. data/lib/data_validators/data_compute.rb +57 -0
  9. data/lib/data_validators/data_validator.rb +12 -0
  10. data/lib/data_validators/data_validator_helper.rb +15 -0
  11. data/lib/data_validators/logstash_data_validator.rb +82 -0
  12. data/lib/data_validators/pbs_data_validator.rb +86 -0
  13. data/lib/errors/not_implemented_error.rb +3 -0
  14. data/lib/errors/validation_error.rb +3 -0
  15. data/lib/errors.rb +2 -0
  16. data/lib/input_validator.rb +12 -2
  17. data/lib/one_data_accessor.rb +11 -10
  18. data/lib/one_worker.rb +109 -137
  19. data/lib/oneacct_exporter/version.rb +1 -1
  20. data/lib/oneacct_exporter.rb +9 -7
  21. data/lib/oneacct_opts.rb +36 -13
  22. data/lib/output_types.rb +5 -0
  23. data/lib/redis_conf.rb +2 -2
  24. data/lib/settings.rb +3 -3
  25. data/lib/templates/apel-0.2.erb +6 -6
  26. data/lib/templates/logstash-0.1.erb +3 -0
  27. data/lib/templates/pbs-0.1.erb +6 -0
  28. data/mock/{one_worker_vm8.xml → one_worker_vm_dn01.xml} +76 -74
  29. data/mock/one_worker_vm_dn02.xml +174 -0
  30. data/mock/{one_worker_DISK_missing.xml → one_worker_vm_empty_disk_records.xml} +10 -6
  31. data/mock/one_worker_vm_empty_history_records.xml +131 -0
  32. data/mock/one_worker_vm_image_name01.xml +175 -0
  33. data/mock/{one_worker_valid_machine.xml → one_worker_vm_image_name02.xml} +35 -7
  34. data/mock/one_worker_vm_image_name03.xml +167 -0
  35. data/mock/{one_worker_vm2.xml → one_worker_vm_image_name04.xml} +38 -9
  36. data/mock/{one_worker_vm1.xml → one_worker_vm_image_name05.xml} +36 -8
  37. data/mock/{one_worker_vm9.xml → one_worker_vm_image_name06.xml} +8 -5
  38. data/oneacct-export.gemspec +1 -0
  39. data/spec/data_validators/apel_data_validator_spec.rb +497 -0
  40. data/spec/data_validators/data_compute_spec.rb +193 -0
  41. data/spec/data_validators/data_validator_helper_spec.rb +66 -0
  42. data/spec/data_validators/data_validator_spec.rb +14 -0
  43. data/spec/data_validators/logstash_data_validator_spec.rb +469 -0
  44. data/spec/data_validators/pbs_data_validator_spec.rb +353 -0
  45. data/spec/one_worker_spec.rb +234 -542
  46. data/spec/oneacct_exporter_spec.rb +1 -41
  47. data/spec/oneacct_opts_spec.rb +135 -32
  48. data/spec/spec_helper.rb +18 -1
  49. metadata +51 -52
  50. data/mock/one_worker_DEPLOY_ID_missing.xml +0 -136
  51. data/mock/one_worker_DISK_SIZE_nan.xml +0 -147
  52. data/mock/one_worker_ETIME_0.xml +0 -137
  53. data/mock/one_worker_ETIME_missing.xml +0 -136
  54. data/mock/one_worker_ETIME_nan.xml +0 -137
  55. data/mock/one_worker_GID_missing.xml +0 -136
  56. data/mock/one_worker_GNAME_missing.xml +0 -136
  57. data/mock/one_worker_HISTORY_RECORDS_missing.xml +0 -91
  58. data/mock/one_worker_HISTORY_many.xml +0 -137
  59. data/mock/one_worker_HISTORY_missing.xml +0 -93
  60. data/mock/one_worker_HISTORY_one.xml +0 -115
  61. data/mock/one_worker_IMAGE_ID_missing.xml +0 -136
  62. data/mock/one_worker_MEMORY_0.xml +0 -137
  63. data/mock/one_worker_MEMORY_missing.xml +0 -135
  64. data/mock/one_worker_MEMORY_nan.xml +0 -137
  65. data/mock/one_worker_NET_RX_0.xml +0 -137
  66. data/mock/one_worker_NET_RX_missing.xml +0 -136
  67. data/mock/one_worker_NET_RX_nan.xml +0 -137
  68. data/mock/one_worker_NET_TX_0.xml +0 -137
  69. data/mock/one_worker_NET_TX_missing.xml +0 -136
  70. data/mock/one_worker_NET_TX_nan.xml +0 -137
  71. data/mock/one_worker_RETIME_0_RUNNING.xml +0 -115
  72. data/mock/one_worker_RETIME_0_STOPPED.xml +0 -115
  73. data/mock/one_worker_RETIME_missing.xml +0 -114
  74. data/mock/one_worker_RSTIME_0.xml +0 -115
  75. data/mock/one_worker_RSTIME_>_RETIME.xml +0 -115
  76. data/mock/one_worker_RSTIME_missing.xml +0 -114
  77. data/mock/one_worker_STATE_missing.xml +0 -136
  78. data/mock/one_worker_STATE_out_of_range.xml +0 -137
  79. data/mock/one_worker_STIME_>_ETIME.xml +0 -137
  80. data/mock/one_worker_STIME_missing.xml +0 -136
  81. data/mock/one_worker_STIME_nan.xml +0 -137
  82. data/mock/one_worker_TEMPLATE_missing.xml +0 -79
  83. data/mock/one_worker_UID_missing.xml +0 -136
  84. data/mock/one_worker_VCPU_0.xml +0 -137
  85. data/mock/one_worker_VCPU_missing.xml +0 -136
  86. data/mock/one_worker_VCPU_nan.xml +0 -137
  87. data/mock/one_worker_malformed_vm.xml +0 -136
  88. data/mock/one_worker_vm3.xml +0 -137
  89. data/mock/one_worker_vm4.xml +0 -106
  90. data/mock/one_worker_vm5.xml +0 -106
  91. data/mock/one_worker_vm6.xml +0 -107
  92. data/mock/one_worker_vm7.xml +0 -147
@@ -119,24 +119,7 @@ describe OneacctExporter do
119
119
  end
120
120
  end
121
121
 
122
- context 'with not related files' do
123
- before :example do
124
- FileUtils.touch("#{testdir_path}/aa")
125
- FileUtils.touch("#{testdir_path}/11")
126
- FileUtils.touch("#{testdir_path}/aa11")
127
- FileUtils.touch("#{testdir_path}/11aa")
128
- FileUtils.touch("#{testdir_path}/0")
129
- FileUtils.touch("#{testdir_path}/01")
130
- FileUtils.touch("#{testdir_path}/0000000000001")
131
- end
132
-
133
- it 'keeps non-related files in the directory' do
134
- subject.clean_output_dir
135
- expect(Dir.entries(testdir_path).count).to eq(9)
136
- end
137
- end
138
-
139
- context 'with related files' do
122
+ context 'with files in output directory' do
140
123
  before :example do
141
124
  FileUtils.touch("#{testdir_path}/00000000000001")
142
125
  FileUtils.touch("#{testdir_path}/00000000000002")
@@ -151,29 +134,6 @@ describe OneacctExporter do
151
134
  expect(Dir.entries(testdir_path).count).to eq(2)
152
135
  end
153
136
  end
154
-
155
- context 'with both related and on-related files' do
156
- before :example do
157
- FileUtils.touch("#{testdir_path}/00000000000001")
158
- FileUtils.touch("#{testdir_path}/00000000000002")
159
- FileUtils.touch("#{testdir_path}/00000000000003")
160
- FileUtils.touch("#{testdir_path}/00000000000004")
161
- FileUtils.touch("#{testdir_path}/00000000000005")
162
- FileUtils.touch("#{testdir_path}/00000000000006")
163
- FileUtils.touch("#{testdir_path}/aa")
164
- FileUtils.touch("#{testdir_path}/11")
165
- FileUtils.touch("#{testdir_path}/aa11")
166
- FileUtils.touch("#{testdir_path}/11aa")
167
- FileUtils.touch("#{testdir_path}/0")
168
- FileUtils.touch("#{testdir_path}/01")
169
- FileUtils.touch("#{testdir_path}/0000000000001")
170
- end
171
-
172
- it 'removes all related files and keeps all non-related files' do
173
- subject.clean_output_dir
174
- expect(Dir.entries(testdir_path).count).to eq(9)
175
- end
176
- end
177
137
  end
178
138
 
179
139
  describe '.all_workers_done?' do
@@ -118,96 +118,199 @@ describe OneacctOpts do
118
118
 
119
119
  describe '#check_settings_restrictions' do
120
120
  before :example do
121
- Settings['site_name'] = 'Hogwarts'
122
- Settings['cloud_type'] = 'OpenNebula'
123
- Settings['endpoint'] = 'machine.hogwarts.co.uk'
124
121
  Settings.output['output_dir'] = '/some/output/dir'
125
122
  Settings.output['output_type'] = 'apel-v0.2'
126
123
  Settings.logging['log_type'] = 'file'
127
124
  Settings.logging['log_file'] = '/var/log/oneacct.log'
128
125
  end
129
126
 
130
- context 'with missing mandatory paramter' do
131
- context 'site_name' do
127
+ context 'with missing mandatory parameter' do
128
+ context 'output_dir' do
132
129
  before :example do
133
- Settings['site_name'] = nil
130
+ Settings.output['output_dir'] = nil
134
131
  end
135
132
 
136
- it 'falis with ArgumentError' do
133
+ it 'fails with ArgumentError' do
137
134
  expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
138
135
  end
139
136
  end
140
137
 
141
- context 'cloud_type' do
138
+ context 'output_type' do
142
139
  before :example do
143
- Settings['cloud_type'] = nil
140
+ Settings.output['output_type'] = nil
144
141
  end
145
142
 
146
- it 'falis with ArgumentError' do
143
+ it 'fails with ArgumentError' do
147
144
  expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
148
145
  end
149
146
  end
147
+ end
150
148
 
151
- context 'endpoint' do
149
+ context 'with logging set to file without file specified' do
150
+ before :example do
151
+ Settings.logging['log_type'] = 'file'
152
+ Settings.logging['log_file'] = nil
153
+ end
154
+
155
+ it 'fails with ArgumentError' do
156
+ expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
157
+ end
158
+ end
159
+
160
+ context 'with non existing template' do
161
+ before :example do
162
+ allow(OneWriter).to receive(:template_filename) { 'nonexisting_file' }
163
+ end
164
+
165
+ it 'fails with ArgumentError' do
166
+ expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
167
+ end
168
+ end
169
+
170
+ context 'with all settings correct' do
171
+ it 'finishes without any failure' do
172
+ OneacctOpts.check_settings_restrictions
173
+ end
174
+ end
175
+ end
176
+
177
+ describe '#check_output_type_specific_settings' do
178
+ before :example do
179
+ Settings.output['output_dir'] = '/some/output/dir'
180
+ Settings.output['output_type'] = 'pbs-v0.2'
181
+ Settings.output.pbs['realm'] = 'REALM'
182
+ Settings.output.pbs['queue'] = 'queue'
183
+ Settings.output.pbs['scratch_type'] = 'local'
184
+ Settings.output.pbs['host_identifier'] = 'on_localhost'
185
+ Settings.logging['log_type'] = 'file'
186
+ Settings.logging['log_file'] = '/var/log/oneacct.log'
187
+ end
188
+
189
+ context 'with missing mandatory parameter of Apel output type' do
190
+ before :example do
191
+ Settings.output['output_type'] = 'apel-0.2'
192
+ end
193
+
194
+ context 'site_name' do
152
195
  before :example do
153
- Settings['endpoint'] = nil
196
+ Settings.output.apel['site_name'] = nil
154
197
  end
155
198
 
156
- it 'falis with ArgumentError' do
199
+ it 'fails with ArgumentError' do
157
200
  expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
158
201
  end
159
202
  end
160
203
 
161
- context 'output_dir' do
204
+ context 'cloud_type' do
162
205
  before :example do
163
- Settings.output['output_dir'] = nil
206
+ Settings.output.apel['cloud_type'] = nil
164
207
  end
165
208
 
166
- it 'falis with ArgumentError' do
209
+ it 'fails with ArgumentError' do
167
210
  expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
168
211
  end
169
212
  end
170
213
 
171
- context 'output_type' do
214
+ context 'endpoint' do
172
215
  before :example do
173
- Settings.output['output_type'] = nil
216
+ Settings.output.apel['endpoint'] = nil
174
217
  end
175
218
 
176
- it 'falis with ArgumentError' do
219
+ it 'fails with ArgumentError' do
177
220
  expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
178
221
  end
179
222
  end
180
223
  end
181
224
 
182
- context 'with logging set to file without file specified' do
225
+ context 'with missing mandatory parameter of PBS output type' do
183
226
  before :example do
184
- Settings.logging['log_type'] = 'file'
185
- Settings.logging['log_file'] = nil
227
+ Settings.output['output_type'] = 'pbs-0.1'
186
228
  end
187
229
 
188
- it 'falis with ArgumentError' do
189
- expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
230
+ context 'realm' do
231
+ before :example do
232
+ Settings.output.pbs['realm'] = nil
233
+ end
234
+
235
+ it 'replaces it with default value "META"' do
236
+ OneacctOpts.check_settings_restrictions
237
+ expect(Settings.output.pbs['realm']).to eq('META')
238
+ end
239
+ end
240
+
241
+ context 'queue' do
242
+ before :example do
243
+ Settings.output.pbs['queue'] = nil
244
+ end
245
+
246
+ it 'replaces it with default value "cloud"' do
247
+ OneacctOpts.check_settings_restrictions
248
+ expect(Settings.output.pbs['queue']).to eq('cloud')
249
+ end
250
+ end
251
+
252
+ context 'scratch_type' do
253
+ before :example do
254
+ Settings.output.pbs['scratch_type'] = nil
255
+ end
256
+
257
+ it 'replaces it with default value "local"' do
258
+ OneacctOpts.check_settings_restrictions
259
+ expect(Settings.output.pbs['scratch_type']).to eq('local')
260
+ end
261
+ end
262
+
263
+ context 'host_identifier' do
264
+ before :example do
265
+ Settings.output.pbs['host_identifier'] = nil
266
+ end
267
+
268
+ it 'replaces it with default value "on_localhost"' do
269
+ OneacctOpts.check_settings_restrictions
270
+ expect(Settings.output.pbs['host_identifier']).to eq('on_localhost')
271
+ end
190
272
  end
191
273
  end
192
274
 
193
- context 'with non existing template' do
275
+ context 'with missing mandatory parameter of logstash output type' do
194
276
  before :example do
195
- allow(OneWriter).to receive(:template_filename) { 'nonexisting_file' }
277
+ Settings.output['output_type'] = 'logstash-0.1'
196
278
  end
197
279
 
198
- it 'falis with ArgumentError' do
199
- expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
280
+ context 'host' do
281
+ before :example do
282
+ Settings.output.logstash['host'] = nil
283
+ end
284
+
285
+ it 'fails with ArgumentError' do
286
+ expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
287
+ end
200
288
  end
201
- end
202
289
 
203
- context 'with all settings correct' do
204
- it 'finishes without any failure' do
205
- OneacctOpts.check_settings_restrictions
290
+ context 'port' do
291
+ before :example do
292
+ Settings.output.logstash['port'] = nil
293
+ end
294
+
295
+ it 'fails with ArgumentError' do
296
+ expect { OneacctOpts.check_settings_restrictions }.to raise_error(ArgumentError)
297
+ end
206
298
  end
207
299
  end
208
300
  end
209
301
 
210
302
  describe '#parse' do
303
+ before :example do
304
+ Settings.output['output_dir'] = '/some/output/dir'
305
+ Settings.output['output_type'] = 'pbs-v0.2'
306
+ Settings.output.pbs['realm'] = 'REALM'
307
+ Settings.output.pbs['queue'] = 'queue'
308
+ Settings.output.pbs['scratch_type'] = 'local'
309
+ Settings.output.pbs['host_identifier'] = 'on_localhost'
310
+ Settings.logging['log_type'] = 'file'
311
+ Settings.logging['log_file'] = '/var/log/oneacct.log'
312
+ end
313
+
211
314
  let(:args) { ['--records-from', '01.01.2014', '--records-to', '01.07.2014', '--include-groups', 'aaa,bbb,ccc', '-b', '-t', '50', '-c'] }
212
315
 
213
316
  it 'returns correctly parsed options' do
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,28 @@
1
1
  require 'simplecov'
2
- SimpleCov.start
2
+ SimpleCov.start do
3
+ add_filter "/vendor/"
4
+ end
3
5
 
4
6
  ENV['RAILS_ENV'] = 'test'
7
+
5
8
  require 'one_writer'
6
9
  require 'redis_conf'
7
10
  require 'one_data_accessor'
8
11
  require 'oneacct_exporter'
9
12
  require 'sidekiq/testing'
10
13
  require 'oneacct_opts'
14
+ require 'data_validators/data_validator'
15
+ require 'data_validators/apel_data_validator'
16
+ require 'data_validators/data_compute'
17
+ require 'data_validators/data_validator_helper'
18
+ require 'data_validators/pbs_data_validator'
19
+
20
+ Sidekiq::Logging.logger = nil
21
+
11
22
  GEM_DIR = File.realdirpath("#{File.dirname(__FILE__)}/..")
23
+
24
+ RSpec.configure do |config|
25
+ config.color = true
26
+ config.tty = true
27
+ config.order = 'random'
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oneacct-export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Kimle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-09 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.0.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: fuubar
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.0.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.0.0
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: simplecov
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -145,6 +159,7 @@ extensions: []
145
159
  extra_rdoc_files: []
146
160
  files:
147
161
  - ".gitignore"
162
+ - ".rspec"
148
163
  - ".travis.yml"
149
164
  - ".yardopts"
150
165
  - Gemfile
@@ -158,12 +173,20 @@ files:
158
173
  - examples/etc/init.d/oneacct-export-cron
159
174
  - examples/etc/init.d/oneacct-export-sidekiq
160
175
  - examples/usr/bin/oneacct-export-cron
176
+ - lib/data_validators/apel_data_validator.rb
177
+ - lib/data_validators/data_compute.rb
178
+ - lib/data_validators/data_validator.rb
179
+ - lib/data_validators/data_validator_helper.rb
180
+ - lib/data_validators/logstash_data_validator.rb
181
+ - lib/data_validators/pbs_data_validator.rb
161
182
  - lib/errors.rb
162
183
  - lib/errors/authentication_error.rb
184
+ - lib/errors/not_implemented_error.rb
163
185
  - lib/errors/resource_not_found_error.rb
164
186
  - lib/errors/resource_retrieval_error.rb
165
187
  - lib/errors/resource_state_error.rb
166
188
  - lib/errors/user_not_authorized_error.rb
189
+ - lib/errors/validation_error.rb
167
190
  - lib/input_validator.rb
168
191
  - lib/one_data_accessor.rb
169
192
  - lib/one_worker.rb
@@ -172,61 +195,31 @@ files:
172
195
  - lib/oneacct_exporter/log.rb
173
196
  - lib/oneacct_exporter/version.rb
174
197
  - lib/oneacct_opts.rb
198
+ - lib/output_types.rb
175
199
  - lib/redis_conf.rb
176
200
  - lib/settings.rb
177
201
  - lib/sidekiq_conf.rb
178
202
  - lib/templates/apel-0.2.erb
179
- - mock/one_worker_DEPLOY_ID_missing.xml
180
- - mock/one_worker_DISK_SIZE_nan.xml
181
- - mock/one_worker_DISK_missing.xml
182
- - mock/one_worker_ETIME_0.xml
183
- - mock/one_worker_ETIME_missing.xml
184
- - mock/one_worker_ETIME_nan.xml
185
- - mock/one_worker_GID_missing.xml
186
- - mock/one_worker_GNAME_missing.xml
187
- - mock/one_worker_HISTORY_RECORDS_missing.xml
188
- - mock/one_worker_HISTORY_many.xml
189
- - mock/one_worker_HISTORY_missing.xml
190
- - mock/one_worker_HISTORY_one.xml
191
- - mock/one_worker_IMAGE_ID_missing.xml
192
- - mock/one_worker_MEMORY_0.xml
193
- - mock/one_worker_MEMORY_missing.xml
194
- - mock/one_worker_MEMORY_nan.xml
195
- - mock/one_worker_NET_RX_0.xml
196
- - mock/one_worker_NET_RX_missing.xml
197
- - mock/one_worker_NET_RX_nan.xml
198
- - mock/one_worker_NET_TX_0.xml
199
- - mock/one_worker_NET_TX_missing.xml
200
- - mock/one_worker_NET_TX_nan.xml
201
- - mock/one_worker_RETIME_0_RUNNING.xml
202
- - mock/one_worker_RETIME_0_STOPPED.xml
203
- - mock/one_worker_RETIME_missing.xml
204
- - mock/one_worker_RSTIME_0.xml
205
- - mock/one_worker_RSTIME_>_RETIME.xml
206
- - mock/one_worker_RSTIME_missing.xml
207
- - mock/one_worker_STATE_missing.xml
208
- - mock/one_worker_STATE_out_of_range.xml
209
- - mock/one_worker_STIME_>_ETIME.xml
210
- - mock/one_worker_STIME_missing.xml
211
- - mock/one_worker_STIME_nan.xml
212
- - mock/one_worker_TEMPLATE_missing.xml
213
- - mock/one_worker_UID_missing.xml
214
- - mock/one_worker_VCPU_0.xml
215
- - mock/one_worker_VCPU_missing.xml
216
- - mock/one_worker_VCPU_nan.xml
217
- - mock/one_worker_malformed_vm.xml
218
- - mock/one_worker_valid_machine.xml
219
- - mock/one_worker_vm1.xml
220
- - mock/one_worker_vm2.xml
221
- - mock/one_worker_vm3.xml
222
- - mock/one_worker_vm4.xml
223
- - mock/one_worker_vm5.xml
224
- - mock/one_worker_vm6.xml
225
- - mock/one_worker_vm7.xml
226
- - mock/one_worker_vm8.xml
227
- - mock/one_worker_vm9.xml
203
+ - lib/templates/logstash-0.1.erb
204
+ - lib/templates/pbs-0.1.erb
205
+ - mock/one_worker_vm_dn01.xml
206
+ - mock/one_worker_vm_dn02.xml
207
+ - mock/one_worker_vm_empty_disk_records.xml
208
+ - mock/one_worker_vm_empty_history_records.xml
209
+ - mock/one_worker_vm_image_name01.xml
210
+ - mock/one_worker_vm_image_name02.xml
211
+ - mock/one_worker_vm_image_name03.xml
212
+ - mock/one_worker_vm_image_name04.xml
213
+ - mock/one_worker_vm_image_name05.xml
214
+ - mock/one_worker_vm_image_name06.xml
228
215
  - mock/one_writer_testfile
229
216
  - oneacct-export.gemspec
217
+ - spec/data_validators/apel_data_validator_spec.rb
218
+ - spec/data_validators/data_compute_spec.rb
219
+ - spec/data_validators/data_validator_helper_spec.rb
220
+ - spec/data_validators/data_validator_spec.rb
221
+ - spec/data_validators/logstash_data_validator_spec.rb
222
+ - spec/data_validators/pbs_data_validator_spec.rb
230
223
  - spec/one_data_accessor_spec.rb
231
224
  - spec/one_worker_spec.rb
232
225
  - spec/one_writer_spec.rb
@@ -254,11 +247,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
247
  version: '0'
255
248
  requirements: []
256
249
  rubyforge_project:
257
- rubygems_version: 2.2.2
250
+ rubygems_version: 2.4.4
258
251
  signing_key:
259
252
  specification_version: 4
260
253
  summary: Exporting OpenNebula accounting data.
261
254
  test_files:
255
+ - spec/data_validators/apel_data_validator_spec.rb
256
+ - spec/data_validators/data_compute_spec.rb
257
+ - spec/data_validators/data_validator_helper_spec.rb
258
+ - spec/data_validators/data_validator_spec.rb
259
+ - spec/data_validators/logstash_data_validator_spec.rb
260
+ - spec/data_validators/pbs_data_validator_spec.rb
262
261
  - spec/one_data_accessor_spec.rb
263
262
  - spec/one_worker_spec.rb
264
263
  - spec/one_writer_spec.rb
@@ -1,136 +0,0 @@
1
- <VM>
2
- <ID>36551</ID>
3
- <UID>120</UID>
4
- <GID>0</GID>
5
- <UNAME>uname</UNAME>
6
- <GNAME>gname</GNAME>
7
- <NAME>one-36551</NAME>
8
- <PERMISSIONS>
9
- <OWNER_U>1</OWNER_U>
10
- <OWNER_M>1</OWNER_M>
11
- <OWNER_A>0</OWNER_A>
12
- <GROUP_U>0</GROUP_U>
13
- <GROUP_M>0</GROUP_M>
14
- <GROUP_A>0</GROUP_A>
15
- <OTHER_U>0</OTHER_U>
16
- <OTHER_M>0</OTHER_M>
17
- <OTHER_A>0</OTHER_A>
18
- </PERMISSIONS>
19
- <LAST_POLL>1383741679</LAST_POLL>
20
- <STATE>6</STATE>
21
- <LCM_STATE>0</LCM_STATE>
22
- <RESCHED>0</RESCHED>
23
- <STIME>1383741160</STIME>
24
- <ETIME>1383742270</ETIME>
25
- <MEMORY>1736960</MEMORY>
26
- <CPU>0</CPU>
27
- <NET_TX>0</NET_TX>
28
- <NET_RX>0</NET_RX>
29
- <TEMPLATE>
30
- <CONTEXT>
31
- <DISK_ID><![CDATA[1]]></DISK_ID>
32
- <FILES><![CDATA[https://somewhere.com/init.sh]]></FILES>
33
- <HOSTNAME><![CDATA[DebianVM]]></HOSTNAME>
34
- <PUBLIC_IP><![CDATA[123.123.5.5]]></PUBLIC_IP>
35
- <SSH_KEY><![CDATA[ssh-rsa AAAAB3NzaC1yc2EAAAADAQABasdgsdfhfgjhxhcHPNFthrHT5/+9lfrQCorJy5YjMJEGBC22dfgjghkDjSDFgjdhgKd54645dfJKd39LdlyzlEaCnjGUeD4C6tZdAISLSDfghSDFgSJ54sSFGJ5RTHARJIRJcX8QRVH46Zq02AeTgrty567ss34tqaa8Pt user@machine1.somewhere.com]]></SSH_KEY>
36
- <TARGET><![CDATA[xvdb]]></TARGET>
37
- </CONTEXT>
38
- <CPU><![CDATA[0.5]]></CPU>
39
- <DISK>
40
- <BUS><![CDATA[ide]]></BUS>
41
- <CLONE><![CDATA[YES]]></CLONE>
42
- <CLUSTER_ID><![CDATA[100]]></CLUSTER_ID>
43
- <DATASTORE><![CDATA[default]]></DATASTORE>
44
- <DATASTORE_ID><![CDATA[1]]></DATASTORE_ID>
45
- <DEV_PREFIX><![CDATA[xvd]]></DEV_PREFIX>
46
- <DISK_ID><![CDATA[0]]></DISK_ID>
47
- <DRIVER><![CDATA[tap2:tapdisk:aio:]]></DRIVER>
48
- <IMAGE><![CDATA[debian6]]></IMAGE>
49
- <IMAGE_ID><![CDATA[31]]></IMAGE_ID>
50
- <READONLY><![CDATA[NO]]></READONLY>
51
- <SAVE><![CDATA[NO]]></SAVE>
52
- <SOURCE><![CDATA[/opt/opennebula/var/datastores/1/bc8db254875412f417ac745b7d47820]]></SOURCE>
53
- <TARGET><![CDATA[xvda]]></TARGET>
54
- <TM_MAD><![CDATA[ssh]]></TM_MAD>
55
- <TYPE><![CDATA[FILE]]></TYPE>
56
- </DISK>
57
- <ERROR>
58
- <MESSAGE><![CDATA[Error executing image transfer script: Path https://somewhere.com/init.sh is not allowed!]]></MESSAGE>
59
- <TIMESTAMP><![CDATA[Wed Nov 6 13:34:19 2013]]></TIMESTAMP>
60
- </ERROR>
61
- <FEATURES>
62
- <ACPI><![CDATA[no]]></ACPI>
63
- </FEATURES>
64
- <MEMORY>1736960</MEMORY>
65
- <NAME><![CDATA[one-36551]]></NAME>
66
- <NIC>
67
- <BRIDGE><![CDATA[xenbr0]]></BRIDGE>
68
- <CLUSTER_ID><![CDATA[100]]></CLUSTER_ID>
69
- <IP><![CDATA[123.123.5.5]]></IP>
70
- <MAC><![CDATA[01:23:45:67:89:ab]]></MAC>
71
- <NETWORK><![CDATA[public]]></NETWORK>
72
- <NETWORK_ID><![CDATA[4]]></NETWORK_ID>
73
- <VLAN><![CDATA[NO]]></VLAN>
74
- <WHITE_PORTS_TCP><![CDATA[22]]></WHITE_PORTS_TCP>
75
- <WHITE_PORTS_UDP><![CDATA[67,68]]></WHITE_PORTS_UDP>
76
- </NIC>
77
- <OS>
78
- <BOOTLOADER><![CDATA[pygrub]]></BOOTLOADER>
79
- </OS>
80
- <RAW>
81
- <TYPE><![CDATA[xen]]></TYPE>
82
- </RAW>
83
- <TEMPLATE_ID><![CDATA[66]]></TEMPLATE_ID>
84
- <VCPU><![CDATA[1]]></VCPU>
85
- <VMID><![CDATA[36551]]></VMID>
86
- </TEMPLATE>
87
- <USER_TEMPLATE>
88
- <SCHED_REQUIREMENTS><![CDATA[CLUSTER_ID = 100]]></SCHED_REQUIREMENTS>
89
- </USER_TEMPLATE>
90
- <HISTORY_RECORDS>
91
- <HISTORY>
92
- <OID>36551</OID>
93
- <SEQ>0</SEQ>
94
- <HOSTNAME>supermachine1.somewhere.com</HOSTNAME>
95
- <HID>11</HID>
96
- <CID>100</CID>
97
- <STIME>1383741169</STIME>
98
- <ETIME>1383741259</ETIME>
99
- <VMMMAD>vmm_xen</VMMMAD>
100
- <VNMMAD>fw</VNMMAD>
101
- <TMMAD>ssh</TMMAD>
102
- <DS_LOCATION>/opt/opennebula/var/datastores</DS_LOCATION>
103
- <DS_ID>0</DS_ID>
104
- <PSTIME>1383741169</PSTIME>
105
- <PETIME>1383741259</PETIME>
106
- <RSTIME>0</RSTIME>
107
- <RETIME>0</RETIME>
108
- <ESTIME>0</ESTIME>
109
- <EETIME>0</EETIME>
110
- <REASON>1</REASON>
111
- <ACTION>0</ACTION>
112
- </HISTORY>
113
- <HISTORY>
114
- <OID>36551</OID>
115
- <SEQ>1</SEQ>
116
- <HOSTNAME>supermachine1.somewhere.com</HOSTNAME>
117
- <HID>11</HID>
118
- <CID>100</CID>
119
- <STIME>1383741589</STIME>
120
- <ETIME>1383742270</ETIME>
121
- <VMMMAD>vmm_xen</VMMMAD>
122
- <VNMMAD>fw</VNMMAD>
123
- <TMMAD>ssh</TMMAD>
124
- <DS_LOCATION>/opt/opennebula/var/datastores</DS_LOCATION>
125
- <DS_ID>0</DS_ID>
126
- <PSTIME>1383741589</PSTIME>
127
- <PETIME>1383741674</PETIME>
128
- <RSTIME>1383741674</RSTIME>
129
- <RETIME>1383742270</RETIME>
130
- <ESTIME>1383742270</ESTIME>
131
- <EETIME>1383742270</EETIME>
132
- <REASON>0</REASON>
133
- <ACTION>0</ACTION>
134
- </HISTORY>
135
- </HISTORY_RECORDS>
136
- </VM>