automate-standard-baseline 0.0.1 → 0.0.2

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.
@@ -266,18 +266,27 @@ rescue Timeout::Error
266
266
  logger.info 'Test duartion has over, pull tcpdump.'
267
267
 
268
268
  pull_out_tcpdump(devices)
269
- delete_pid_file($pid_file)
270
269
 
271
- logger.info "Kill all sub_processes"
270
+ logger.info "Kill sub-processes"
272
271
  # find the sub-processes of these pids
273
- to_kill = [Process.pid]
272
+ #main = [Process.pid]
273
+ #logger.info "Main process #{main}"
274
+
275
+ to_kill=[Process.pid]
274
276
  ProcTable.ps do |proc|
275
- to_kill << proc.pid if to_kill.include?(proc.ppid)
277
+ to_kill << proc.pid if to_kill.include?(proc.ppid)
276
278
  end
277
- logger.info "Processes will be killed (including sub-processes): #{to_kill}"
279
+
280
+ #delete the main process in case of kill itself
281
+ to_kill.delete_at(0)
282
+ logger.info "Processes will be killed : #{to_kill}"
278
283
  to_kill.each do |pid|
279
- Process.kill("KILL", pid) rescue nil # in case of the process doesn't exist.
284
+ Process.kill("KILL", pid) rescue nil # in case of the process doesn't exist.
280
285
  end
286
+
287
+ delete_pid_file($pid_file)
288
+ logger.info "Done."
289
+ #logger.info "Done. Please use command \"abs-stop -a\" to stop the test"
281
290
  end
282
291
 
283
292
 
data/lib/helpers.rb CHANGED
@@ -109,7 +109,9 @@ def download_file(url, saved_path = nil)
109
109
  uri = URI.parse(url)
110
110
  path = (!uri.query or uri.query.blank?) ? uri.path : uri.path+"?"+uri.query
111
111
  unless saved_path
112
- saved_path = "oc_apks/#{uri.path[uri.path.rindex("/") + 1, uri.path.length]}"
112
+ saved_path = 'oc_apks'
113
+ Dir.mkdir(saved_path) unless Dir.exists?(saved_path)
114
+ saved_path = "#{saved_path}/#{uri.path[uri.path.rindex("/") + 1, uri.path.length]}"
113
115
  end
114
116
  saved_path = File.expand_path(saved_path)
115
117
  puts "Download file by url #{url}; saved_path: #{saved_path}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automate-standard-baseline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-23 00:00:00.000000000 Z
12
+ date: 2013-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &15690080 !ruby/object:Gem::Requirement
16
+ requirement: &12927560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *15690080
24
+ version_requirements: *12927560
25
25
  description: auomated standard baseline test
26
26
  email: rfu@seven.com
27
27
  executables: