mu 5.7.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/Mu_Gem.html +1591 -0
  2. data/bin/mu +11 -0
  3. data/lib/mu.rb +65 -0
  4. data/lib/mu/api/ddt.rb +233 -0
  5. data/lib/mu/api/homepage.rb +54 -0
  6. data/lib/mu/api/muapi.rb +231 -0
  7. data/lib/mu/api/netconfig.rb +233 -0
  8. data/lib/mu/api/scale.rb +199 -0
  9. data/lib/mu/api/system.rb +40 -0
  10. data/lib/mu/client.rb +31 -0
  11. data/lib/mu/command.rb +28 -0
  12. data/lib/mu/command/api.rb +95 -0
  13. data/lib/mu/command/cmd_appid.rb +486 -0
  14. data/lib/mu/command/cmd_cli.rb +151 -0
  15. data/lib/mu/command/cmd_ddt.rb +449 -0
  16. data/lib/mu/command/cmd_homepage.rb +146 -0
  17. data/lib/mu/command/cmd_muapi.rb +361 -0
  18. data/lib/mu/command/cmd_netconfig.rb +262 -0
  19. data/lib/mu/command/cmd_runscale.rb +533 -0
  20. data/lib/mu/command/cmd_runscenario.rb +258 -0
  21. data/lib/mu/command/cmd_runverify.rb +336 -0
  22. data/lib/mu/command/cmd_scale.rb +333 -0
  23. data/lib/mu/command/cmd_system.rb +127 -0
  24. data/lib/mu/command/curl.rb +246 -0
  25. data/lib/mu/command/help.rb +29 -0
  26. data/lib/mu/curl/error.rb +54 -0
  27. data/lib/mu/curl/verify.rb +137 -0
  28. data/lib/mu/helper.rb +55 -0
  29. data/lib/mu/http_helper.rb +232 -0
  30. data/rdoc/classes/Mu.html +305 -0
  31. data/rdoc/classes/Mu/Client.html +265 -0
  32. data/rdoc/classes/Mu/Command.html +208 -0
  33. data/rdoc/classes/Mu/Command/API.html +524 -0
  34. data/rdoc/classes/Mu/Command/Cmd_appid.html +934 -0
  35. data/rdoc/classes/Mu/Command/Cmd_cli.html +515 -0
  36. data/rdoc/classes/Mu/Command/Cmd_ddt.html +1169 -0
  37. data/rdoc/classes/Mu/Command/Cmd_homepage.html +489 -0
  38. data/rdoc/classes/Mu/Command/Cmd_muapi.html +968 -0
  39. data/rdoc/classes/Mu/Command/Cmd_netconfig.html +743 -0
  40. data/rdoc/classes/Mu/Command/Cmd_runscale.html +970 -0
  41. data/rdoc/classes/Mu/Command/Cmd_runscenario.html +530 -0
  42. data/rdoc/classes/Mu/Command/Cmd_runverify.html +621 -0
  43. data/rdoc/classes/Mu/Command/Cmd_scale.html +939 -0
  44. data/rdoc/classes/Mu/Command/Cmd_system.html +426 -0
  45. data/rdoc/classes/Mu/Command/Curl.html +524 -0
  46. data/rdoc/classes/Mu/Command/Help.html +166 -0
  47. data/rdoc/classes/Mu/Curl.html +116 -0
  48. data/rdoc/classes/Mu/Curl/Error.html +157 -0
  49. data/rdoc/classes/Mu/Curl/Error/Authorize.html +178 -0
  50. data/rdoc/classes/Mu/Curl/Error/Connect.html +149 -0
  51. data/rdoc/classes/Mu/Curl/Error/DNS.html +113 -0
  52. data/rdoc/classes/Mu/Curl/Error/Region.html +160 -0
  53. data/rdoc/classes/Mu/Curl/Error/Status.html +149 -0
  54. data/rdoc/classes/Mu/Curl/Error/Timeout.html +149 -0
  55. data/rdoc/classes/Mu/Curl/Verify.html +282 -0
  56. data/rdoc/classes/Mu/Curl/Verify/Request.html +227 -0
  57. data/rdoc/classes/Mu/Curl/Verify/Response.html +187 -0
  58. data/rdoc/classes/Mu/Curl/Verify/Result.html +188 -0
  59. data/rdoc/classes/Mu/Ddt.html +914 -0
  60. data/rdoc/classes/Mu/Helper.html +308 -0
  61. data/rdoc/classes/Mu/Homepage.html +377 -0
  62. data/rdoc/classes/Mu/HttpHelper.html +639 -0
  63. data/rdoc/classes/Mu/Muapi.html +816 -0
  64. data/rdoc/classes/Mu/Netconfig.html +781 -0
  65. data/rdoc/classes/Mu/Scale.html +832 -0
  66. data/rdoc/classes/Mu/System.html +281 -0
  67. data/rdoc/classes/Object.html +148 -0
  68. data/rdoc/classes/TCTestMu.html +1793 -0
  69. data/rdoc/classes/Test.html +107 -0
  70. data/rdoc/classes/Test/Unit.html +107 -0
  71. data/rdoc/classes/Test/Unit/TestCase.html +113 -0
  72. data/rdoc/created.rid +1 -0
  73. data/rdoc/files/lib/mu/api/ddt_rb.html +101 -0
  74. data/rdoc/files/lib/mu/api/homepage_rb.html +101 -0
  75. data/rdoc/files/lib/mu/api/muapi_rb.html +101 -0
  76. data/rdoc/files/lib/mu/api/netconfig_rb.html +101 -0
  77. data/rdoc/files/lib/mu/api/scale_rb.html +101 -0
  78. data/rdoc/files/lib/mu/api/system_rb.html +101 -0
  79. data/rdoc/files/lib/mu/client_rb.html +101 -0
  80. data/rdoc/files/lib/mu/command/api_rb.html +101 -0
  81. data/rdoc/files/lib/mu/command/cmd_appid_rb.html +119 -0
  82. data/rdoc/files/lib/mu/command/cmd_cli_rb.html +108 -0
  83. data/rdoc/files/lib/mu/command/cmd_ddt_rb.html +117 -0
  84. data/rdoc/files/lib/mu/command/cmd_homepage_rb.html +115 -0
  85. data/rdoc/files/lib/mu/command/cmd_muapi_rb.html +116 -0
  86. data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +116 -0
  87. data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +119 -0
  88. data/rdoc/files/lib/mu/command/cmd_runscenario_rb.html +115 -0
  89. data/rdoc/files/lib/mu/command/cmd_runverify_rb.html +117 -0
  90. data/rdoc/files/lib/mu/command/cmd_scale_rb.html +115 -0
  91. data/rdoc/files/lib/mu/command/cmd_system_rb.html +116 -0
  92. data/rdoc/files/lib/mu/command/curl_rb.html +101 -0
  93. data/rdoc/files/lib/mu/command/help_rb.html +101 -0
  94. data/rdoc/files/lib/mu/command_rb.html +107 -0
  95. data/rdoc/files/lib/mu/curl/error_rb.html +101 -0
  96. data/rdoc/files/lib/mu/curl/verify_rb.html +101 -0
  97. data/rdoc/files/lib/mu/helper_rb.html +101 -0
  98. data/rdoc/files/lib/mu/http_helper_rb.html +101 -0
  99. data/rdoc/files/lib/mu_rb.html +121 -0
  100. data/rdoc/files/test/helper_rb.html +112 -0
  101. data/rdoc/files/test/tc_test_mu_rb.html +111 -0
  102. data/rdoc/fr_class_index.html +68 -0
  103. data/rdoc/fr_file_index.html +55 -0
  104. data/rdoc/fr_method_index.html +374 -0
  105. data/rdoc/index.html +24 -0
  106. data/rdoc/rdoc-style.css +208 -0
  107. data/test/data/app_id_stats.csv +1 -0
  108. data/test/data/data_cgi.msl +94 -0
  109. data/test/data/data_cgi.xml +322 -0
  110. data/test/data/default_test.csv +3 -0
  111. data/test/data/ftp_with_channel.xml +1643 -0
  112. data/test/data/irc.xml +3837 -0
  113. data/test/data/scale_configuration.json +25 -0
  114. data/test/data/test_data_cgi_error.xml +35 -0
  115. data/test/helper.rb +18 -0
  116. data/test/tc_test_mu.rb +716 -0
  117. metadata +322 -0
@@ -0,0 +1,934 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Mu::Command::Cmd_appid</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Mu::Command::Cmd_appid</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/mu/command/cmd_appid_rb.html">
59
+ lib/mu/command/cmd_appid.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Command
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000163">cmd_help</a>&nbsp;&nbsp;
90
+ <a href="#M000166">cmd_run_dir</a>&nbsp;&nbsp;
91
+ <a href="#M000165">cmd_run_file</a>&nbsp;&nbsp;
92
+ <a href="#M000164">cmd_running?</a>&nbsp;&nbsp;
93
+ <a href="#M000170">dump_status</a>&nbsp;&nbsp;
94
+ <a href="#M000172">get_all_hosts_from_musl</a>&nbsp;&nbsp;
95
+ <a href="#M000177">help</a>&nbsp;&nbsp;
96
+ <a href="#M000173">map_all_hosts_to_json</a>&nbsp;&nbsp;
97
+ <a href="#M000171">output_csv</a>&nbsp;&nbsp;
98
+ <a href="#M000176">parse_cli</a>&nbsp;&nbsp;
99
+ <a href="#M000175">parse_status</a>&nbsp;&nbsp;
100
+ <a href="#M000174">parse_verify_response</a>&nbsp;&nbsp;
101
+ <a href="#M000168">run</a>&nbsp;&nbsp;
102
+ <a href="#M000169">set_global_hosts</a>&nbsp;&nbsp;
103
+ <a href="#M000167">setup</a>&nbsp;&nbsp;
104
+ </div>
105
+ </div>
106
+
107
+ </div>
108
+
109
+
110
+ <!-- if includes -->
111
+
112
+ <div id="section">
113
+
114
+
115
+
116
+
117
+
118
+ <div id="attribute-list">
119
+ <h3 class="section-bar">Attributes</h3>
120
+
121
+ <div class="name-list">
122
+ <table>
123
+ <tr class="top-aligned-row context-row">
124
+ <td class="context-item-name">addr_indexes</td>
125
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
126
+ <td class="context-item-desc"></td>
127
+ </tr>
128
+ <tr class="top-aligned-row context-row">
129
+ <td class="context-item-name">api</td>
130
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
131
+ <td class="context-item-desc"></td>
132
+ </tr>
133
+ <tr class="top-aligned-row context-row">
134
+ <td class="context-item-name">hash</td>
135
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
136
+ <td class="context-item-desc"></td>
137
+ </tr>
138
+ <tr class="top-aligned-row context-row">
139
+ <td class="context-item-name">hosts</td>
140
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
141
+ <td class="context-item-desc"></td>
142
+ </tr>
143
+ <tr class="top-aligned-row context-row">
144
+ <td class="context-item-name">params</td>
145
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
146
+ <td class="context-item-desc"></td>
147
+ </tr>
148
+ </table>
149
+ </div>
150
+ </div>
151
+
152
+
153
+
154
+ <!-- if method_list -->
155
+ <div id="methods">
156
+ <h3 class="section-bar">Public Instance methods</h3>
157
+
158
+ <div id="method-M000163" class="method-detail">
159
+ <a name="M000163"></a>
160
+
161
+ <div class="method-heading">
162
+ <a href="#M000163" class="method-signature">
163
+ <span class="method-name">cmd_help</span><span class="method-args">(argv)</span>
164
+ </a>
165
+ </div>
166
+
167
+ <div class="method-description">
168
+ <p>
169
+ displays command-line <a href="Cmd_appid.html#M000177">help</a>
170
+ </p>
171
+ <p><a class="source-toggle" href="#"
172
+ onclick="toggleCode('M000163-source');return false;">[Source]</a></p>
173
+ <div class="method-source-code" id="M000163-source">
174
+ <pre>
175
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 13</span>
176
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_help</span> <span class="ruby-identifier">argv</span>
177
+ <span class="ruby-identifier">help</span>
178
+ <span class="ruby-keyword kw">end</span>
179
+ </pre>
180
+ </div>
181
+ </div>
182
+ </div>
183
+
184
+ <div id="method-M000166" class="method-detail">
185
+ <a name="M000166"></a>
186
+
187
+ <div class="method-heading">
188
+ <a href="#M000166" class="method-signature">
189
+ <span class="method-name">cmd_run_dir</span><span class="method-args">(argv)</span>
190
+ </a>
191
+ </div>
192
+
193
+ <div class="method-description">
194
+ <p>
195
+ runs through a directory of msl files and executes a Studio <a
196
+ href="../Scale.html">Scale</a> test for each one
197
+ </p>
198
+ <pre>
199
+ * argv = command-line arguments, require a directory (-d) argument
200
+ </pre>
201
+ <p><a class="source-toggle" href="#"
202
+ onclick="toggleCode('M000166-source');return false;">[Source]</a></p>
203
+ <div class="method-source-code" id="M000166-source">
204
+ <pre>
205
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 64</span>
206
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_run_dir</span> <span class="ruby-identifier">argv</span>
207
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
208
+
209
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'dir'</span>]
210
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;*** Error: directory required, using -d option&quot;</span>
211
+ <span class="ruby-keyword kw">else</span>
212
+ <span class="ruby-identifier">dir</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'dir'</span>]
213
+ <span class="ruby-keyword kw">end</span>
214
+
215
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>)
216
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_stats.csv&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_stats.csv&quot;</span>)
217
+
218
+ <span class="ruby-ivar">@api</span> = <span class="ruby-constant">Scale</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@@mu_ip</span>, <span class="ruby-ivar">@@mu_admin_user</span>, <span class="ruby-ivar">@@mu_admin_pass</span>)
219
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-value str">&quot;pattern&quot;</span>, <span class="ruby-ivar">@cmd_line_pattern</span>)
220
+ <span class="ruby-ivar">@params</span> = {}
221
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;dir&quot;</span>] = <span class="ruby-identifier">dir</span>
222
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;hosts&quot;</span>] = <span class="ruby-ivar">@cmd_line_hosts</span>
223
+ <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;dir&quot;</span>])
224
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>)
225
+ <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-value str">&quot;*.msl&quot;</span>)
226
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">files</span>.<span class="ruby-identifier">empty?</span>
227
+ <span class="ruby-identifier">files</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">|</span>
228
+ <span class="ruby-identifier">run</span>(<span class="ruby-identifier">f</span>)
229
+ <span class="ruby-identifier">output_csv</span>(<span class="ruby-identifier">f</span>)
230
+ <span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
231
+ <span class="ruby-keyword kw">end</span>
232
+ <span class="ruby-keyword kw">else</span>
233
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;no msl files found in #{dir}&quot;</span>
234
+ <span class="ruby-keyword kw">end</span>
235
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">release</span>
236
+ <span class="ruby-keyword kw">end</span>
237
+ </pre>
238
+ </div>
239
+ </div>
240
+ </div>
241
+
242
+ <div id="method-M000165" class="method-detail">
243
+ <a name="M000165"></a>
244
+
245
+ <div class="method-heading">
246
+ <a href="#M000165" class="method-signature">
247
+ <span class="method-name">cmd_run_file</span><span class="method-args">(argv)</span>
248
+ </a>
249
+ </div>
250
+
251
+ <div class="method-description">
252
+ <p>
253
+ runs a single Studio <a href="../Scale.html">Scale</a> test
254
+ </p>
255
+ <pre>
256
+ * argv = command-line arguments, requires a scenario (-s) argument
257
+ </pre>
258
+ <p><a class="source-toggle" href="#"
259
+ onclick="toggleCode('M000165-source');return false;">[Source]</a></p>
260
+ <div class="method-source-code" id="M000165-source">
261
+ <pre>
262
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 37</span>
263
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_run_file</span> <span class="ruby-identifier">argv</span>
264
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
265
+
266
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'scenario'</span>]
267
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;*** Error: scenario required, using -s option&quot;</span>
268
+ <span class="ruby-keyword kw">else</span>
269
+ <span class="ruby-identifier">scenario</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'scenario'</span>]
270
+ <span class="ruby-keyword kw">end</span>
271
+
272
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">scenario</span>)
273
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;*** Error: Scenario file #{scenario} was not found&quot;</span>
274
+ <span class="ruby-keyword kw">end</span>
275
+
276
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>)
277
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_stats.csv&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_stats.csv&quot;</span>)
278
+
279
+ <span class="ruby-ivar">@api</span> = <span class="ruby-constant">Scale</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@@mu_ip</span>, <span class="ruby-ivar">@@mu_admin_user</span>, <span class="ruby-ivar">@@mu_admin_pass</span>)
280
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-value str">&quot;pattern&quot;</span>, <span class="ruby-ivar">@cmd_line_pattern</span>)
281
+ <span class="ruby-ivar">@params</span> = {}
282
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;msl&quot;</span>] = <span class="ruby-identifier">scenario</span>
283
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;hosts&quot;</span>] = <span class="ruby-ivar">@cmd_line_hosts</span>
284
+ <span class="ruby-identifier">run</span>(<span class="ruby-identifier">scenario</span>)
285
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">release</span>
286
+ <span class="ruby-keyword kw">end</span>
287
+ </pre>
288
+ </div>
289
+ </div>
290
+ </div>
291
+
292
+ <div id="method-M000164" class="method-detail">
293
+ <a name="M000164"></a>
294
+
295
+ <div class="method-heading">
296
+ <a href="#M000164" class="method-signature">
297
+ <span class="method-name">cmd_running?</span><span class="method-args">(argv)</span>
298
+ </a>
299
+ </div>
300
+
301
+ <div class="method-description">
302
+ <p>
303
+ returns a boolean indicating whether the scale test is running or not
304
+ </p>
305
+ <pre>
306
+ * argv = command-line arguments
307
+ </pre>
308
+ <p><a class="source-toggle" href="#"
309
+ onclick="toggleCode('M000164-source');return false;">[Source]</a></p>
310
+ <div class="method-source-code" id="M000164-source">
311
+ <pre>
312
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 19</span>
313
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_running?</span> <span class="ruby-identifier">argv</span>
314
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">nil?</span>
315
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;false&quot;</span>
316
+ <span class="ruby-keyword kw">return</span>
317
+ <span class="ruby-keyword kw">end</span>
318
+
319
+ <span class="ruby-identifier">status</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">status</span>
320
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">status</span>.<span class="ruby-identifier">nil?</span>
321
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>].<span class="ruby-identifier">nil?</span>
322
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;running&quot;</span>]
323
+ <span class="ruby-keyword kw">end</span>
324
+ <span class="ruby-keyword kw">else</span>
325
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;false&quot;</span>
326
+ <span class="ruby-keyword kw">end</span>
327
+ <span class="ruby-keyword kw">end</span>
328
+ </pre>
329
+ </div>
330
+ </div>
331
+ </div>
332
+
333
+ <h3 class="section-bar">Private Instance methods</h3>
334
+
335
+ <div id="method-M000170" class="method-detail">
336
+ <a name="M000170"></a>
337
+
338
+ <div class="method-heading">
339
+ <a href="#M000170" class="method-signature">
340
+ <span class="method-name">dump_status</span><span class="method-args">(status, msl)</span>
341
+ </a>
342
+ </div>
343
+
344
+ <div class="method-description">
345
+ <p><a class="source-toggle" href="#"
346
+ onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
347
+ <div class="method-source-code" id="M000170-source">
348
+ <pre>
349
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 211</span>
350
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dump_status</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">msl</span>)
351
+ <span class="ruby-identifier">filename</span> = <span class="ruby-value str">&quot;app_id_status.json&quot;</span>
352
+ <span class="ruby-identifier">f</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;a&quot;</span>)
353
+ <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;filename&quot;</span>] = <span class="ruby-identifier">msl</span>
354
+ <span class="ruby-identifier">str</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-identifier">status</span>)
355
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;,&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">zero?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-comment cmt"># if appending, we need to insert a comma</span>
356
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">str</span>)
357
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>
358
+ <span class="ruby-keyword kw">end</span>
359
+ </pre>
360
+ </div>
361
+ </div>
362
+ </div>
363
+
364
+ <div id="method-M000172" class="method-detail">
365
+ <a name="M000172"></a>
366
+
367
+ <div class="method-heading">
368
+ <a href="#M000172" class="method-signature">
369
+ <span class="method-name">get_all_hosts_from_musl</span><span class="method-args">(msl)</span>
370
+ </a>
371
+ </div>
372
+
373
+ <div class="method-description">
374
+ <p>
375
+ finds all the hosts in the musl file
376
+ </p>
377
+ <p><a class="source-toggle" href="#"
378
+ onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
379
+ <div class="method-source-code" id="M000172-source">
380
+ <pre>
381
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 229</span>
382
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_all_hosts_from_musl</span>(<span class="ruby-identifier">msl</span>)
383
+ <span class="ruby-identifier">f</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">msl</span>)
384
+ <span class="ruby-identifier">hosts</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/host_\d+/</span>)
385
+ <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">uniq!</span>
386
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">hosts</span>
387
+ <span class="ruby-keyword kw">end</span>
388
+ </pre>
389
+ </div>
390
+ </div>
391
+ </div>
392
+
393
+ <div id="method-M000177" class="method-detail">
394
+ <a name="M000177"></a>
395
+
396
+ <div class="method-heading">
397
+ <a href="#M000177" class="method-signature">
398
+ <span class="method-name">help</span><span class="method-args">()</span>
399
+ </a>
400
+ </div>
401
+
402
+ <div class="method-description">
403
+ <p><a class="source-toggle" href="#"
404
+ onclick="toggleCode('M000177-source');return false;">[Source]</a></p>
405
+ <div class="method-source-code" id="M000177-source">
406
+ <pre>
407
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 425</span>
408
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>
409
+ <span class="ruby-identifier">helps</span> = [
410
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-c'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--csv'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'name of the csv testset to run'</span> },
411
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-d'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--dir'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'directory containing msl files, required for run_dir'</span> },
412
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-h'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--help'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'help on command line options'</span> },
413
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-i'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--interfaces'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'comma-separated list of interfaces, e.g. b1,b2 or b1-1000:0,b2 for ip range and offset'</span> },
414
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-m'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--mu_string'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'user, password, mu_ip in the form of admin:admin@10.9.8.7'</span> },
415
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-o'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--output'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'output logging to this file'</span> },
416
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-p'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--pattern'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'pattern in the form of comma-separated concurrency_start-end:duration strings, e.g. 1-10000:60,10000-1:30. Duration is in seconds'</span> },
417
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-s'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--scenario'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'msl file, required for run_msl'</span> },
418
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-t'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--test'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'do verify only'</span> },
419
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-v'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--verbose'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'set Logger::DEBUG level'</span> }
420
+ ]
421
+
422
+ <span class="ruby-identifier">cmds</span> = [
423
+ <span class="ruby-value str">&quot;mu cmd_appid:help&quot;</span>,
424
+ <span class="ruby-value str">&quot;mu cmd_appid:run_file -s &lt;file&gt;&quot;</span>,
425
+ <span class="ruby-value str">&quot;mu cmd_appid:run_dir -d &lt;dir&gt;&quot;</span>,
426
+ <span class="ruby-value str">&quot;mu cmd_appid:running?&quot;</span>
427
+ ]
428
+
429
+ <span class="ruby-identifier">max_long_size</span> = <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">memo</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> [ <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">:long</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
430
+ <span class="ruby-identifier">max_value_size</span> = <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">memo</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> [ <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">:value</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
431
+ <span class="ruby-identifier">puts</span>
432
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Usage: mu cmd_appid:&lt;command&gt; &lt;options&gt;&quot;</span>
433
+ <span class="ruby-identifier">puts</span>
434
+ <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span>
435
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;%-*s %*s %-*s %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">max_long_size</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:long</span>], <span class="ruby-value">2</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:short</span>], <span class="ruby-identifier">max_value_size</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:value</span>], <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:help</span>]]
436
+ <span class="ruby-keyword kw">end</span>
437
+ <span class="ruby-identifier">puts</span>
438
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Available Commands&quot;</span>
439
+ <span class="ruby-identifier">puts</span>
440
+ <span class="ruby-identifier">cmds</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">|</span>
441
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">c</span>
442
+ <span class="ruby-keyword kw">end</span>
443
+ <span class="ruby-identifier">puts</span>
444
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Outputs&quot;</span>
445
+ <span class="ruby-identifier">puts</span>
446
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;app_id_stats.csv&quot;</span>
447
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;scenario_name , passed , errors , timeouts,&quot;</span>
448
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;client tx bytes/sec , client tx msgs/sec , client rx bytes/sec , client rx msgs/src,&quot;</span>
449
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;server tx bytes/sec , server tx msgs/sec , server rx bytes/sec , server rx msgs/src&quot;</span>
450
+ <span class="ruby-identifier">puts</span>
451
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;app_id_status.json&quot;</span>
452
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;contains the last status json object returned from polling, per scenario&quot;</span>
453
+ <span class="ruby-keyword kw">end</span>
454
+ </pre>
455
+ </div>
456
+ </div>
457
+ </div>
458
+
459
+ <div id="method-M000173" class="method-detail">
460
+ <a name="M000173"></a>
461
+
462
+ <div class="method-heading">
463
+ <a href="#M000173" class="method-signature">
464
+ <span class="method-name">map_all_hosts_to_json</span><span class="method-args">(hosts=[])</span>
465
+ </a>
466
+ </div>
467
+
468
+ <div class="method-description">
469
+ <p>
470
+ maps host_0 to the client interface maps all other hosts to the server
471
+ interface
472
+ </p>
473
+ <p><a class="source-toggle" href="#"
474
+ onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
475
+ <div class="method-source-code" id="M000173-source">
476
+ <pre>
477
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 238</span>
478
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">map_all_hosts_to_json</span>(<span class="ruby-identifier">hosts</span>=[])
479
+ <span class="ruby-identifier">new_hosts</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
480
+ <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>, <span class="ruby-identifier">i</span> <span class="ruby-operator">|</span>
481
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
482
+ <span class="ruby-identifier">new_hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@hosts</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/*,#{@addr_indexes[0]}&quot;</span>
483
+ <span class="ruby-keyword kw">else</span>
484
+ <span class="ruby-identifier">new_hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@hosts</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">+</span> <span class="ruby-node">&quot;/*,#{@addr_indexes[1]}&quot;</span>
485
+ <span class="ruby-keyword kw">end</span>
486
+ <span class="ruby-keyword kw">end</span>
487
+
488
+ <span class="ruby-identifier">hosts_config</span> = {}
489
+
490
+ <span class="ruby-comment cmt"># assign hosts to consecutive string keys, host_0, host_1, etc ...</span>
491
+ <span class="ruby-identifier">new_hosts</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>, <span class="ruby-identifier">i</span> <span class="ruby-operator">|</span>
492
+ <span class="ruby-identifier">hosts_config</span>[<span class="ruby-node">&quot;host_#{i}&quot;</span>] = <span class="ruby-identifier">h</span> <span class="ruby-comment cmt"># new_hosts[i]</span>
493
+ <span class="ruby-keyword kw">end</span>
494
+
495
+ <span class="ruby-comment cmt"># convert keys to symbols</span>
496
+ <span class="ruby-identifier">new_hosts_config</span> = {}
497
+ <span class="ruby-identifier">hosts_config</span>.<span class="ruby-identifier">each_key</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">new_hosts_config</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">hosts_config</span>[<span class="ruby-identifier">k</span>] }
498
+
499
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">new_hosts_config</span>
500
+ <span class="ruby-keyword kw">end</span>
501
+ </pre>
502
+ </div>
503
+ </div>
504
+ </div>
505
+
506
+ <div id="method-M000171" class="method-detail">
507
+ <a name="M000171"></a>
508
+
509
+ <div class="method-heading">
510
+ <a href="#M000171" class="method-signature">
511
+ <span class="method-name">output_csv</span><span class="method-args">(msl_file)</span>
512
+ </a>
513
+ </div>
514
+
515
+ <div class="method-description">
516
+ <p><a class="source-toggle" href="#"
517
+ onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
518
+ <div class="method-source-code" id="M000171-source">
519
+ <pre>
520
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 221</span>
521
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output_csv</span>(<span class="ruby-identifier">msl_file</span>)
522
+ <span class="ruby-identifier">filename</span> = <span class="ruby-value str">&quot;app_id_stats.csv&quot;</span>
523
+ <span class="ruby-identifier">f</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;a&quot;</span>)
524
+ <span class="ruby-identifier">doc</span> = <span class="ruby-node">&quot;#{msl_file},#{@executed},#{@errors.to_i},#{@timeouts.to_i},#{@client_tx_bytes},#{@client_tx_msgs},#{@client_rx_bytes},#{@client_rx_msgs},#{@server_tx_bytes},#{@server_tx_msgs},#{@server_rx_bytes},#{@server_rx_msgs}\n&quot;</span>
525
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">'a'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">doc</span>) }
526
+ <span class="ruby-keyword kw">end</span>
527
+ </pre>
528
+ </div>
529
+ </div>
530
+ </div>
531
+
532
+ <div id="method-M000176" class="method-detail">
533
+ <a name="M000176"></a>
534
+
535
+ <div class="method-heading">
536
+ <a href="#M000176" class="method-signature">
537
+ <span class="method-name">parse_cli</span><span class="method-args">(argv)</span>
538
+ </a>
539
+ </div>
540
+
541
+ <div class="method-description">
542
+ <p><a class="source-toggle" href="#"
543
+ onclick="toggleCode('M000176-source');return false;">[Source]</a></p>
544
+ <div class="method-source-code" id="M000176-source">
545
+ <pre>
546
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 340</span>
547
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
548
+ <span class="ruby-ivar">@hash</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
549
+ <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">empty?</span>
550
+ <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">first</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">!=</span> <span class="ruby-value str">'-'</span>
551
+
552
+ <span class="ruby-identifier">k</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
553
+
554
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-c'</span>, <span class="ruby-value str">'--csv'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
555
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'testset'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
556
+ <span class="ruby-keyword kw">next</span>
557
+ <span class="ruby-keyword kw">end</span>
558
+
559
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-d'</span>, <span class="ruby-value str">'--dir'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
560
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'dir'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
561
+ <span class="ruby-keyword kw">next</span>
562
+ <span class="ruby-keyword kw">end</span>
563
+
564
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-i'</span>, <span class="ruby-value str">'--interfaces'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
565
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'interfaces'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
566
+ <span class="ruby-keyword kw">next</span>
567
+ <span class="ruby-keyword kw">end</span>
568
+
569
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-h'</span>, <span class="ruby-value str">'--help'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
570
+ <span class="ruby-identifier">help</span>
571
+ <span class="ruby-identifier">exit</span>
572
+ <span class="ruby-keyword kw">end</span>
573
+
574
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-m'</span>, <span class="ruby-value str">'--mu_string'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
575
+ <span class="ruby-identifier">mu_string</span> = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
576
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mu_string</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+?):(.+?)@(.*)/</span>
577
+ <span class="ruby-ivar">@@mu_admin_user</span> = <span class="ruby-identifier">$1</span>
578
+ <span class="ruby-ivar">@@mu_admin_pass</span> = <span class="ruby-identifier">$2</span>
579
+ <span class="ruby-ivar">@@mu_ip</span> = <span class="ruby-identifier">$3</span>
580
+ <span class="ruby-keyword kw">end</span>
581
+ <span class="ruby-keyword kw">next</span>
582
+ <span class="ruby-keyword kw">end</span>
583
+
584
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-o'</span>, <span class="ruby-value str">'--output'</span>].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
585
+ <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>), <span class="ruby-value str">&quot;w&quot;</span>)
586
+ <span class="ruby-keyword kw">next</span>
587
+ <span class="ruby-keyword kw">end</span>
588
+
589
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-p'</span>, <span class="ruby-value str">'--pattern'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
590
+ <span class="ruby-identifier">patterns</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
591
+ <span class="ruby-identifier">pattern_string</span> = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
592
+ <span class="ruby-identifier">pstrings</span> = <span class="ruby-identifier">pattern_string</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;,&quot;</span>)
593
+ <span class="ruby-identifier">pstrings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">|</span>
594
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+?)-(.+?):(.*)/</span> <span class="ruby-comment cmt"># e.g. 1-10000:60</span>
595
+ <span class="ruby-identifier">start_vol</span> = <span class="ruby-identifier">$1</span>
596
+ <span class="ruby-identifier">end_vol</span> = <span class="ruby-identifier">$2</span>
597
+ <span class="ruby-identifier">duration</span> = <span class="ruby-identifier">$3</span>
598
+ <span class="ruby-identifier">patterns</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;{\&quot;iterations\&quot;:1, \&quot;end\&quot;:#{end_vol}, \&quot;start\&quot;:#{start_vol}, \&quot;duration\&quot;:#{duration} }&quot;</span>
599
+ <span class="ruby-keyword kw">end</span>
600
+ <span class="ruby-keyword kw">end</span>
601
+ <span class="ruby-identifier">ps</span> = <span class="ruby-value str">&quot;{ \&quot;iterations\&quot;: 1, \&quot;intervals\&quot;: [&quot;</span>
602
+ <span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">|</span>
603
+ <span class="ruby-identifier">ps</span> = <span class="ruby-identifier">ps</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;,&quot;</span>
604
+ <span class="ruby-keyword kw">end</span>
605
+ <span class="ruby-identifier">ps</span> = <span class="ruby-identifier">ps</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-identifier">ps</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">2</span>] <span class="ruby-comment cmt"># remove final comma</span>
606
+ <span class="ruby-identifier">ps</span> = <span class="ruby-identifier">ps</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;] }&quot;</span>
607
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'pattern'</span>] = <span class="ruby-identifier">ps</span>
608
+ <span class="ruby-keyword kw">next</span>
609
+ <span class="ruby-keyword kw">end</span>
610
+
611
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-s'</span>, <span class="ruby-value str">'--scenario'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
612
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'scenario'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
613
+ <span class="ruby-keyword kw">next</span>
614
+ <span class="ruby-keyword kw">end</span>
615
+
616
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-t'</span>, <span class="ruby-value str">'--test'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
617
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'test'</span>] = <span class="ruby-keyword kw">true</span>
618
+ <span class="ruby-keyword kw">next</span>
619
+ <span class="ruby-keyword kw">end</span>
620
+
621
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-v'</span>, <span class="ruby-value str">'--verbose'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
622
+ <span class="ruby-identifier">$log</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
623
+ <span class="ruby-keyword kw">next</span>
624
+ <span class="ruby-keyword kw">end</span>
625
+
626
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown option #{k}&quot;</span>
627
+ <span class="ruby-keyword kw">end</span>
628
+
629
+ <span class="ruby-identifier">hash</span>
630
+ <span class="ruby-keyword kw">end</span>
631
+ </pre>
632
+ </div>
633
+ </div>
634
+ </div>
635
+
636
+ <div id="method-M000175" class="method-detail">
637
+ <a name="M000175"></a>
638
+
639
+ <div class="method-heading">
640
+ <a href="#M000175" class="method-signature">
641
+ <span class="method-name">parse_status</span><span class="method-args">(status)</span>
642
+ </a>
643
+ </div>
644
+
645
+ <div class="method-description">
646
+ <p><a class="source-toggle" href="#"
647
+ onclick="toggleCode('M000175-source');return false;">[Source]</a></p>
648
+ <div class="method-source-code" id="M000175-source">
649
+ <pre>
650
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 286</span>
651
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_status</span>(<span class="ruby-identifier">status</span>)
652
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">nil?</span>
653
+ <span class="ruby-identifier">msg</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-identifier">status</span>), <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
654
+ <span class="ruby-ivar">@reported_volume</span> = <span class="ruby-value">0</span>
655
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;error&quot;</span>].<span class="ruby-identifier">nil?</span>
656
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;error&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span>
657
+ <span class="ruby-ivar">@error</span> = <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;error&quot;</span>]
658
+ <span class="ruby-ivar">@reason</span> = <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;reason&quot;</span>]
659
+ <span class="ruby-comment cmt"># puts &quot;*** Error = #{@error}, reason = #{@reason} ***\n\n&quot;</span>
660
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
661
+ <span class="ruby-keyword kw">end</span>
662
+ <span class="ruby-keyword kw">end</span>
663
+
664
+ <span class="ruby-ivar">@stats_summary</span> = <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>]
665
+ <span class="ruby-ivar">@duration</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;duration&quot;</span>]
666
+ <span class="ruby-ivar">@instances</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;instances&quot;</span>]
667
+ <span class="ruby-ivar">@total_instances</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;total&quot;</span>]
668
+ <span class="ruby-ivar">@executed</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;executed&quot;</span>]
669
+ <span class="ruby-ivar">@timeouts</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;timeouts&quot;</span>]
670
+ <span class="ruby-ivar">@errors</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;errors&quot;</span>]
671
+ <span class="ruby-ivar">@asserts_failed</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;asserts&quot;</span>][<span class="ruby-value str">&quot;failed&quot;</span>]
672
+ <span class="ruby-ivar">@server</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;server&quot;</span>]
673
+ <span class="ruby-ivar">@server_tx_bytes</span> = <span class="ruby-ivar">@server</span>[<span class="ruby-value str">&quot;tx&quot;</span>][<span class="ruby-value str">&quot;bytes&quot;</span>]
674
+ <span class="ruby-ivar">@server_tx_msgs</span> = <span class="ruby-ivar">@server</span>[<span class="ruby-value str">&quot;tx&quot;</span>][<span class="ruby-value str">&quot;msgs&quot;</span>]
675
+ <span class="ruby-ivar">@server_rx_bytes</span> = <span class="ruby-ivar">@server</span>[<span class="ruby-value str">&quot;rx&quot;</span>][<span class="ruby-value str">&quot;bytes&quot;</span>]
676
+ <span class="ruby-ivar">@server_rx_msgs</span> = <span class="ruby-ivar">@server</span>[<span class="ruby-value str">&quot;rx&quot;</span>][<span class="ruby-value str">&quot;msgs&quot;</span>]
677
+ <span class="ruby-ivar">@client</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;client&quot;</span>]
678
+ <span class="ruby-ivar">@client_tx_bytes</span> = <span class="ruby-ivar">@client</span>[<span class="ruby-value str">&quot;tx&quot;</span>][<span class="ruby-value str">&quot;bytes&quot;</span>]
679
+ <span class="ruby-ivar">@client_tx_msgs</span> = <span class="ruby-ivar">@client</span>[<span class="ruby-value str">&quot;tx&quot;</span>][<span class="ruby-value str">&quot;msgs&quot;</span>]
680
+ <span class="ruby-ivar">@client_rx_bytes</span> = <span class="ruby-ivar">@client</span>[<span class="ruby-value str">&quot;rx&quot;</span>][<span class="ruby-value str">&quot;bytes&quot;</span>]
681
+ <span class="ruby-ivar">@client_rx_msgs</span> = <span class="ruby-ivar">@client</span>[<span class="ruby-value str">&quot;rx&quot;</span>][<span class="ruby-value str">&quot;msgs&quot;</span>]
682
+ <span class="ruby-ivar">@scenarios</span> = <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;scenarios&quot;</span>]
683
+ <span class="ruby-ivar">@scenarios</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">scenario</span> <span class="ruby-operator">|</span>
684
+ <span class="ruby-ivar">@reported_volume</span> = <span class="ruby-ivar">@reported_volume</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">scenario</span>[<span class="ruby-value str">&quot;volume&quot;</span>]
685
+ <span class="ruby-keyword kw">end</span>
686
+
687
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;&quot;</span>
688
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;duration: #{format_float(2, @duration)}&quot;</span>
689
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;concurrency: #{@reported_volume}&quot;</span>
690
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;tests/sec: #{format_float(2, @executed.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
691
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;passed: #{@executed}&quot;</span>
692
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;errors: #{@errors}&quot;</span>
693
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;timeouts: #{@timeouts}&quot;</span>
694
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;client tx bytes/sec #{format_float(2, @client_tx_bytes.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
695
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;client tx msgs/sec #{format_float(2, @client_tx_msgs.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
696
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;client rx bytes/sec #{format_float(2, @client_rx_bytes.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
697
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;client rx msgs/sec #{format_float(2, @client_rx_msgs.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
698
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;server tx bytes/sec #{format_float(2, @server_tx_bytes.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
699
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;server tx msgs/sec #{format_float(2, @server_tx_msgs.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
700
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;server rx bytes/sec #{format_float(2, @server_rx_bytes.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
701
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;server rx msgs/sec #{format_float(2, @server_rx_msgs.to_f / @duration)}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@duration</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
702
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;&quot;</span>
703
+ <span class="ruby-keyword kw">end</span>
704
+ </pre>
705
+ </div>
706
+ </div>
707
+ </div>
708
+
709
+ <div id="method-M000174" class="method-detail">
710
+ <a name="M000174"></a>
711
+
712
+ <div class="method-heading">
713
+ <a href="#M000174" class="method-signature">
714
+ <span class="method-name">parse_verify_response</span><span class="method-args">(response)</span>
715
+ </a>
716
+ </div>
717
+
718
+ <div class="method-description">
719
+ <p><a class="source-toggle" href="#"
720
+ onclick="toggleCode('M000174-source');return false;">[Source]</a></p>
721
+ <div class="method-source-code" id="M000174-source">
722
+ <pre>
723
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 262</span>
724
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_verify_response</span>(<span class="ruby-identifier">response</span>)
725
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-comment cmt"># || response.empty?</span>
726
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;*** error = no response received from /verify ***\n\n&quot;</span>
727
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
728
+ <span class="ruby-keyword kw">end</span>
729
+ <span class="ruby-keyword kw">begin</span>
730
+ <span class="ruby-identifier">msg</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-identifier">response</span>), <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
731
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">response</span>[<span class="ruby-value str">&quot;status&quot;</span>].<span class="ruby-identifier">nil?</span>
732
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;error&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span>
733
+ <span class="ruby-ivar">@error</span> = <span class="ruby-identifier">response</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;error&quot;</span>]
734
+ <span class="ruby-ivar">@reason</span> = <span class="ruby-identifier">response</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;reason&quot;</span>]
735
+ <span class="ruby-identifier">dump_status</span>(<span class="ruby-identifier">response</span>)
736
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;*** Error = #{@error}, reason = #{@reason} ***\n\n&quot;</span>
737
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
738
+ <span class="ruby-keyword kw">end</span>
739
+ <span class="ruby-keyword kw">end</span>
740
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;*** verify: okay ***&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
741
+ <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;*** verify: okay ***&quot;</span>
742
+ <span class="ruby-keyword kw">rescue</span>
743
+ <span class="ruby-comment cmt"># could nbe json parse error</span>
744
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
745
+ <span class="ruby-keyword kw">end</span>
746
+ <span class="ruby-keyword kw">end</span>
747
+ </pre>
748
+ </div>
749
+ </div>
750
+ </div>
751
+
752
+ <div id="method-M000168" class="method-detail">
753
+ <a name="M000168"></a>
754
+
755
+ <div class="method-heading">
756
+ <a href="#M000168" class="method-signature">
757
+ <span class="method-name">run</span><span class="method-args">(msl)</span>
758
+ </a>
759
+ </div>
760
+
761
+ <div class="method-description">
762
+ <p><a class="source-toggle" href="#"
763
+ onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
764
+ <div class="method-source-code" id="M000168-source">
765
+ <pre>
766
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 128</span>
767
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">msl</span>)
768
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">msl</span>)
769
+ <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;file not found: #{msl}&quot;</span>
770
+ <span class="ruby-keyword kw">end</span>
771
+
772
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-value str">&quot;musl&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">msl</span>))
773
+
774
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@testset</span>.<span class="ruby-identifier">empty?</span>
775
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@testset</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;/&quot;</span>) <span class="ruby-comment cmt"># assume it is the full path in this case</span>
776
+ <span class="ruby-identifier">csv_file</span> = <span class="ruby-ivar">@testset</span>
777
+ <span class="ruby-keyword kw">else</span>
778
+ <span class="ruby-identifier">csv_file</span> = <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;dir&quot;</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@testset</span>
779
+ <span class="ruby-keyword kw">end</span>
780
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-value str">&quot;csv&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">csv_file</span>))
781
+ <span class="ruby-keyword kw">end</span>
782
+
783
+ <span class="ruby-identifier">set_global_hosts</span>
784
+ <span class="ruby-identifier">all_hosts</span> = <span class="ruby-identifier">get_all_hosts_from_musl</span>(<span class="ruby-identifier">msl</span>)
785
+ <span class="ruby-ivar">@hosts_config</span> = <span class="ruby-identifier">map_all_hosts_to_json</span>(<span class="ruby-identifier">all_hosts</span>)
786
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-value str">&quot;hosts&quot;</span>, <span class="ruby-ivar">@hosts_config</span>)
787
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;verifying #{msl} ...&quot;</span>
788
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">verify</span>
789
+ <span class="ruby-comment cmt"># sleep 3</span>
790
+ <span class="ruby-identifier">v</span> = <span class="ruby-identifier">parse_verify_response</span>(<span class="ruby-identifier">response</span>)
791
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">nil?</span>
792
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;error in verify&quot;</span>
793
+ <span class="ruby-keyword kw">return</span>
794
+ <span class="ruby-keyword kw">end</span>
795
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@verify_only</span>
796
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">v</span>
797
+ <span class="ruby-keyword kw">return</span>
798
+ <span class="ruby-keyword kw">end</span>
799
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;starting #{msl} ...&quot;</span>
800
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">start</span>
801
+ <span class="ruby-identifier">start_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span>
802
+ <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
803
+ <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
804
+ <span class="ruby-identifier">status</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">status</span>
805
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">status</span>.<span class="ruby-identifier">nil?</span>
806
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>].<span class="ruby-identifier">nil?</span>
807
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;status&quot;</span>][<span class="ruby-value str">&quot;running&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
808
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;running = #{status[&quot;status&quot;][&quot;running&quot;]}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
809
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">parse_status</span>(<span class="ruby-identifier">status</span>)
810
+ <span class="ruby-identifier">dump_status</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">msl</span>)
811
+ <span class="ruby-keyword kw">return</span>
812
+ <span class="ruby-keyword kw">else</span>
813
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">parse_status</span>(<span class="ruby-identifier">status</span>)
814
+ <span class="ruby-keyword kw">end</span>
815
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># status['status'].nil? ... no bonafide status was returned</span>
816
+ <span class="ruby-identifier">time_now</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span>
817
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">time_now</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">start_time</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">20</span>
818
+ <span class="ruby-comment cmt"># puts &quot;\nError: timing out after 20 seconds. Test had failed to start or verify&quot;</span>
819
+ <span class="ruby-keyword kw">break</span>
820
+ <span class="ruby-keyword kw">end</span>
821
+ <span class="ruby-keyword kw">end</span>
822
+ <span class="ruby-keyword kw">end</span>
823
+ <span class="ruby-keyword kw">end</span>
824
+ <span class="ruby-keyword kw">ensure</span>
825
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;stopping #{msl} ...&quot;</span>
826
+ <span class="ruby-keyword kw">end</span>
827
+ </pre>
828
+ </div>
829
+ </div>
830
+ </div>
831
+
832
+ <div id="method-M000169" class="method-detail">
833
+ <a name="M000169"></a>
834
+
835
+ <div class="method-heading">
836
+ <a href="#M000169" class="method-signature">
837
+ <span class="method-name">set_global_hosts</span><span class="method-args">()</span>
838
+ </a>
839
+ </div>
840
+
841
+ <div class="method-description">
842
+ <p><a class="source-toggle" href="#"
843
+ onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
844
+ <div class="method-source-code" id="M000169-source">
845
+ <pre>
846
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 189</span>
847
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_global_hosts</span>
848
+ <span class="ruby-ivar">@hosts</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
849
+ <span class="ruby-ivar">@addr_indexes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
850
+ <span class="ruby-identifier">hosts</span> = <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;hosts&quot;</span>]
851
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">nil?</span>
852
+ <span class="ruby-identifier">p</span> = <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;,&quot;</span>)
853
+ <span class="ruby-identifier">p</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">h</span> <span class="ruby-operator">|</span>
854
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;-&quot;</span>) <span class="ruby-comment cmt"># b1-1000,b2-1 to indicate addr_count</span>
855
+ <span class="ruby-identifier">q</span> = <span class="ruby-identifier">h</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;-&quot;</span>)
856
+ <span class="ruby-ivar">@hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">q</span>[<span class="ruby-value">0</span>]
857
+ <span class="ruby-ivar">@addr_indexes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">q</span>[<span class="ruby-value">1</span>]
858
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># default to the 1st addr index</span>
859
+ <span class="ruby-ivar">@hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">h</span>
860
+ <span class="ruby-ivar">@addr_indexes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">1</span>
861
+ <span class="ruby-keyword kw">end</span>
862
+ <span class="ruby-keyword kw">end</span>
863
+ <span class="ruby-keyword kw">else</span>
864
+ <span class="ruby-ivar">@hosts</span> = [<span class="ruby-value str">'b1'</span>,<span class="ruby-value str">'b2'</span>]
865
+ <span class="ruby-ivar">@addr_indexes</span> = [<span class="ruby-value">1</span>,<span class="ruby-value">1</span>]
866
+ <span class="ruby-keyword kw">end</span>
867
+ <span class="ruby-keyword kw">end</span>
868
+ </pre>
869
+ </div>
870
+ </div>
871
+ </div>
872
+
873
+ <div id="method-M000167" class="method-detail">
874
+ <a name="M000167"></a>
875
+
876
+ <div class="method-heading">
877
+ <a href="#M000167" class="method-signature">
878
+ <span class="method-name">setup</span><span class="method-args">(argv)</span>
879
+ </a>
880
+ </div>
881
+
882
+ <div class="method-description">
883
+ <p><a class="source-toggle" href="#"
884
+ onclick="toggleCode('M000167-source');return false;">[Source]</a></p>
885
+ <div class="method-source-code" id="M000167-source">
886
+ <pre>
887
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_appid.rb, line 98</span>
888
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
889
+ <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
890
+ <span class="ruby-ivar">@params</span> = {}
891
+
892
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'test'</span>]
893
+ <span class="ruby-ivar">@verify_only</span> = <span class="ruby-keyword kw">true</span>
894
+ <span class="ruby-keyword kw">else</span>
895
+ <span class="ruby-ivar">@verify_only</span> = <span class="ruby-keyword kw">false</span>
896
+ <span class="ruby-keyword kw">end</span>
897
+
898
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'pattern'</span>]
899
+ <span class="ruby-ivar">@cmd_line_pattern</span> = <span class="ruby-value str">&quot;{ \&quot;iterations\&quot;: 1, \&quot;intervals\&quot;: [ {\&quot;iterations\&quot;:1, \&quot;end\&quot;:100, \&quot;start\&quot;:1, \&quot;duration\&quot;:20 } ] }&quot;</span>
900
+ <span class="ruby-keyword kw">else</span>
901
+ <span class="ruby-ivar">@cmd_line_pattern</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'pattern'</span>]
902
+ <span class="ruby-keyword kw">end</span>
903
+
904
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'interfaces'</span>]
905
+ <span class="ruby-ivar">@cmd_line_hosts</span> = <span class="ruby-value str">&quot;b1,b2&quot;</span>
906
+ <span class="ruby-keyword kw">else</span>
907
+ <span class="ruby-ivar">@cmd_line_hosts</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'interfaces'</span>]
908
+ <span class="ruby-keyword kw">end</span>
909
+
910
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'testset'</span>]
911
+ <span class="ruby-ivar">@testset</span> = <span class="ruby-value str">&quot;&quot;</span>
912
+ <span class="ruby-keyword kw">else</span>
913
+ <span class="ruby-ivar">@testset</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'testset'</span>]
914
+ <span class="ruby-keyword kw">end</span>
915
+
916
+ <span class="ruby-keyword kw">end</span>
917
+ </pre>
918
+ </div>
919
+ </div>
920
+ </div>
921
+
922
+
923
+ </div>
924
+
925
+
926
+ </div>
927
+
928
+
929
+ <div id="validator-badges">
930
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
931
+ </div>
932
+
933
+ </body>
934
+ </html>