automate-standard-baseline 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -15,10 +15,12 @@ include Seven::ASB::Operations
|
|
15
15
|
|
16
16
|
|
17
17
|
$pid_file = '.pid'
|
18
|
+
$config_file='asb.yml'
|
18
19
|
|
19
20
|
# For now we hard code the timeout value in case of the
|
20
21
|
# program run more than 24 hours
|
21
22
|
$time_out = 24 * 60 * 60
|
23
|
+
$v_port=18080
|
22
24
|
|
23
25
|
##-------------------------------------------------------------
|
24
26
|
## define methods
|
@@ -167,6 +169,24 @@ def archive_logs(devices)
|
|
167
169
|
Dir.mkdir('logs') unless Dir.exists?('logs')
|
168
170
|
end
|
169
171
|
|
172
|
+
def load_config()
|
173
|
+
config_info=nil
|
174
|
+
if File.exists?($config_file)
|
175
|
+
logger.info "config #{$config_file} exist."
|
176
|
+
config_info=YAML.load_file($config_file)
|
177
|
+
|
178
|
+
|
179
|
+
if config_info.key?("time_out")
|
180
|
+
$time_out=config_info['time_out']
|
181
|
+
end
|
182
|
+
|
183
|
+
if config_info.key?("v_port")
|
184
|
+
$v_port=config_info['v_port']
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
189
|
+
|
170
190
|
## operation steps ---start test ...
|
171
191
|
|
172
192
|
trap_signals()
|
@@ -175,6 +195,8 @@ option = opt_parse(ARGV)
|
|
175
195
|
|
176
196
|
logger.info "#{option}"
|
177
197
|
|
198
|
+
load_config()
|
199
|
+
|
178
200
|
check_if_old_process_killed($pid_file)
|
179
201
|
|
180
202
|
devices = get_available_devices
|
@@ -214,7 +236,7 @@ for i in 0...devices.length
|
|
214
236
|
set_env(devices[i],i)
|
215
237
|
|
216
238
|
|
217
|
-
install_or_dump_oc_client(option[:oc_path],option[:reinstall])
|
239
|
+
install_or_dump_oc_client(option[:oc_path],option[:reinstall],$v_port)
|
218
240
|
reset_data()
|
219
241
|
|
220
242
|
if option[:enable_logcat]
|
@@ -17,6 +17,7 @@ module Operations
|
|
17
17
|
@@default_device = nil
|
18
18
|
|
19
19
|
@@default_time_out = 300 # 5 minutes
|
20
|
+
@@v_port=nil
|
20
21
|
|
21
22
|
def default_device
|
22
23
|
unless @@default_device
|
@@ -27,8 +28,9 @@ module Operations
|
|
27
28
|
end
|
28
29
|
|
29
30
|
|
30
|
-
def install_or_dump_oc_client(path, reinstall = true)
|
31
|
+
def install_or_dump_oc_client(path, reinstall = true,port)
|
31
32
|
|
33
|
+
@@v_port=port
|
32
34
|
|
33
35
|
if reinstall
|
34
36
|
uri = URI.parse(path)
|
@@ -142,7 +144,8 @@ module Operations
|
|
142
144
|
cmd = "#{adb_command} shell su -c iptables -t nat -nvL"
|
143
145
|
log cmd
|
144
146
|
result = exec_command(cmd, @@default_time_out)
|
145
|
-
|
147
|
+
log "veirfy redirect port #{@@v_port}"
|
148
|
+
raise "iptables is not modified" unless result.output.include?("redir ports #{@@v_port}")
|
146
149
|
end
|
147
150
|
puts "oc client is started."
|
148
151
|
end
|
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.
|
4
|
+
version: 0.0.6
|
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-
|
12
|
+
date: 2013-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: retriable
|
16
|
-
requirement: &
|
16
|
+
requirement: &14437900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *14437900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sys-proctable
|
27
|
-
requirement: &
|
27
|
+
requirement: &14436380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *14436380
|
36
36
|
description: auomated standard baseline test
|
37
37
|
email: rfu@seven.com
|
38
38
|
executables:
|