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,970 @@
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_runscale</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_runscale</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_runscale_rb.html">
59
+ lib/mu/command/cmd_runscale.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="#M000178">cmd_help</a>&nbsp;&nbsp;
90
+ <a href="#M000180">cmd_run_dir</a>&nbsp;&nbsp;
91
+ <a href="#M000179">cmd_run_file</a>&nbsp;&nbsp;
92
+ <a href="#M000183">cmd_running?</a>&nbsp;&nbsp;
93
+ <a href="#M000184">configure_hosts</a>&nbsp;&nbsp;
94
+ <a href="#M000187">dump_status</a>&nbsp;&nbsp;
95
+ <a href="#M000192">help</a>&nbsp;&nbsp;
96
+ <a href="#M000188">output_csv</a>&nbsp;&nbsp;
97
+ <a href="#M000191">parse_cli</a>&nbsp;&nbsp;
98
+ <a href="#M000190">parse_status</a>&nbsp;&nbsp;
99
+ <a href="#M000189">parse_verify_response</a>&nbsp;&nbsp;
100
+ <a href="#M000182">run</a>&nbsp;&nbsp;
101
+ <a href="#M000186">set_hosts</a>&nbsp;&nbsp;
102
+ <a href="#M000185">set_hosts_byname</a>&nbsp;&nbsp;
103
+ <a href="#M000181">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">hosts</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">offset_indexes</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-M000178" class="method-detail">
159
+ <a name="M000178"></a>
160
+
161
+ <div class="method-heading">
162
+ <a href="#M000178" 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_runscale.html#M000192">help</a>
170
+ </p>
171
+ <pre>
172
+ * argv = command-line arguments
173
+ </pre>
174
+ <p><a class="source-toggle" href="#"
175
+ onclick="toggleCode('M000178-source');return false;">[Source]</a></p>
176
+ <div class="method-source-code" id="M000178-source">
177
+ <pre>
178
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 14</span>
179
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_help</span> <span class="ruby-identifier">argv</span>
180
+ <span class="ruby-identifier">help</span>
181
+ <span class="ruby-keyword kw">end</span>
182
+ </pre>
183
+ </div>
184
+ </div>
185
+ </div>
186
+
187
+ <div id="method-M000180" class="method-detail">
188
+ <a name="M000180"></a>
189
+
190
+ <div class="method-heading">
191
+ <a href="#M000180" class="method-signature">
192
+ <span class="method-name">cmd_run_dir</span><span class="method-args">(argv)</span>
193
+ </a>
194
+ </div>
195
+
196
+ <div class="method-description">
197
+ <p>
198
+ sets up, executes, and closes a Studio <a href="../Scale.html">Scale</a>
199
+ test for each scenario (.msl file) found in the specified directory
200
+ </p>
201
+ <pre>
202
+ * argv = command-line arguments, requires a directory (-d) argument
203
+ </pre>
204
+ <p><a class="source-toggle" href="#"
205
+ onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
206
+ <div class="method-source-code" id="M000180-source">
207
+ <pre>
208
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 59</span>
209
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_run_dir</span> <span class="ruby-identifier">argv</span>
210
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
211
+
212
+ <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>]
213
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">help</span>
214
+ <span class="ruby-keyword kw">else</span>
215
+ <span class="ruby-ivar">@dir</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'dir'</span>]
216
+ <span class="ruby-keyword kw">end</span>
217
+
218
+ <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>)
219
+ <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>)
220
+
221
+ <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>)
222
+ <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>)
223
+ <span class="ruby-ivar">@params</span> = {}
224
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;dir&quot;</span>] = <span class="ruby-ivar">@dir</span>
225
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;hosts&quot;</span>] = <span class="ruby-ivar">@cmd_line_hosts</span>
226
+ <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>])
227
+ <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>)
228
+ <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>)
229
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">files</span>.<span class="ruby-identifier">empty?</span>
230
+ <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>
231
+ <span class="ruby-identifier">run</span>(<span class="ruby-identifier">f</span>)
232
+ <span class="ruby-identifier">output_csv</span>(<span class="ruby-identifier">f</span>)
233
+ <span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
234
+ <span class="ruby-keyword kw">end</span>
235
+ <span class="ruby-keyword kw">else</span>
236
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;no msl files found in #{@dir}&quot;</span>
237
+ <span class="ruby-keyword kw">end</span>
238
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">release</span>
239
+ <span class="ruby-keyword kw">end</span>
240
+ </pre>
241
+ </div>
242
+ </div>
243
+ </div>
244
+
245
+ <div id="method-M000179" class="method-detail">
246
+ <a name="M000179"></a>
247
+
248
+ <div class="method-heading">
249
+ <a href="#M000179" class="method-signature">
250
+ <span class="method-name">cmd_run_file</span><span class="method-args">(argv)</span>
251
+ </a>
252
+ </div>
253
+
254
+ <div class="method-description">
255
+ <p>
256
+ sets up, executes, and closes a Studio <a href="../Scale.html">Scale</a>
257
+ test
258
+ </p>
259
+ <pre>
260
+ * argv = command-line arguments , requires a scenario (-s) argument
261
+ </pre>
262
+ <p><a class="source-toggle" href="#"
263
+ onclick="toggleCode('M000179-source');return false;">[Source]</a></p>
264
+ <div class="method-source-code" id="M000179-source">
265
+ <pre>
266
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 20</span>
267
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_run_file</span> <span class="ruby-identifier">argv</span>
268
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
269
+
270
+ <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>]
271
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;scenario required&quot;</span>
272
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">help</span>
273
+ <span class="ruby-keyword kw">else</span>
274
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'scenario'</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;.msl&quot;</span>)
275
+ <span class="ruby-identifier">scenario</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'scenario'</span>]
276
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># TODO: eventually, xml and mus file may be supported by scale api</span>
277
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;only .msl files are currently supported&quot;</span>
278
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">help</span>
279
+ <span class="ruby-keyword kw">end</span>
280
+ <span class="ruby-keyword kw">end</span>
281
+
282
+ <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>]
283
+ <span class="ruby-ivar">@dir</span> = <span class="ruby-value str">&quot;&quot;</span>
284
+ <span class="ruby-identifier">path</span> = <span class="ruby-identifier">scenario</span>
285
+ <span class="ruby-keyword kw">else</span>
286
+ <span class="ruby-ivar">@dir</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'dir'</span>]
287
+ <span class="ruby-identifier">path</span> = <span class="ruby-ivar">@dir</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">scenario</span>
288
+ <span class="ruby-keyword kw">end</span>
289
+
290
+ <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">path</span>)
291
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;*** Error: File #{path} does not exist&quot;</span>
292
+ <span class="ruby-keyword kw">end</span>
293
+
294
+ <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>)
295
+ <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>)
296
+ <span class="ruby-ivar">@params</span> = {}
297
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;dir&quot;</span>] = <span class="ruby-ivar">@dir</span>
298
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;msl&quot;</span>] = <span class="ruby-identifier">scenario</span>
299
+ <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;hosts&quot;</span>] = <span class="ruby-ivar">@cmd_line_hosts</span>
300
+ <span class="ruby-identifier">run</span>(<span class="ruby-identifier">scenario</span>)
301
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">release</span>
302
+ <span class="ruby-keyword kw">end</span>
303
+ </pre>
304
+ </div>
305
+ </div>
306
+ </div>
307
+
308
+ <h3 class="section-bar">Private Instance methods</h3>
309
+
310
+ <div id="method-M000183" class="method-detail">
311
+ <a name="M000183"></a>
312
+
313
+ <div class="method-heading">
314
+ <a href="#M000183" class="method-signature">
315
+ <span class="method-name">cmd_running?</span><span class="method-args">()</span>
316
+ </a>
317
+ </div>
318
+
319
+ <div class="method-description">
320
+ <p><a class="source-toggle" href="#"
321
+ onclick="toggleCode('M000183-source');return false;">[Source]</a></p>
322
+ <div class="method-source-code" id="M000183-source">
323
+ <pre>
324
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 191</span>
325
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_running?</span>
326
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">nil?</span>
327
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;false&quot;</span>
328
+ <span class="ruby-keyword kw">return</span>
329
+ <span class="ruby-keyword kw">end</span>
330
+
331
+ <span class="ruby-identifier">status</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">status</span>
332
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">status</span>.<span class="ruby-identifier">nil?</span>
333
+ <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>
334
+ <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>]
335
+ <span class="ruby-keyword kw">end</span>
336
+ <span class="ruby-keyword kw">else</span>
337
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;false&quot;</span>
338
+ <span class="ruby-keyword kw">end</span>
339
+ <span class="ruby-keyword kw">end</span>
340
+ </pre>
341
+ </div>
342
+ </div>
343
+ </div>
344
+
345
+ <div id="method-M000184" class="method-detail">
346
+ <a name="M000184"></a>
347
+
348
+ <div class="method-heading">
349
+ <a href="#M000184" class="method-signature">
350
+ <span class="method-name">configure_hosts</span><span class="method-args">()</span>
351
+ </a>
352
+ </div>
353
+
354
+ <div class="method-description">
355
+ <p><a class="source-toggle" href="#"
356
+ onclick="toggleCode('M000184-source');return false;">[Source]</a></p>
357
+ <div class="method-source-code" id="M000184-source">
358
+ <pre>
359
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 207</span>
360
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_hosts</span>
361
+ <span class="ruby-ivar">@hosts</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
362
+ <span class="ruby-ivar">@addr_indexes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
363
+ <span class="ruby-ivar">@offset_indexes</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
364
+ <span class="ruby-identifier">hosts</span> = <span class="ruby-ivar">@params</span>[<span class="ruby-value str">&quot;hosts&quot;</span>]
365
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">nil?</span>
366
+ <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>)
367
+ <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>
368
+ <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>
369
+ <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>)
370
+ <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>]
371
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">q</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;:&quot;</span>) <span class="ruby-comment cmt"># -1000:20 to indicate offset within range</span>
372
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">q</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;:&quot;</span>)
373
+ <span class="ruby-ivar">@addr_indexes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">r</span>[<span class="ruby-value">0</span>]
374
+ <span class="ruby-ivar">@offset_indexes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">r</span>[<span class="ruby-value">1</span>]
375
+ <span class="ruby-keyword kw">else</span>
376
+ <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>]
377
+ <span class="ruby-ivar">@offset_indexes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">1</span>
378
+ <span class="ruby-keyword kw">end</span>
379
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># default to the 1st addr index</span>
380
+ <span class="ruby-ivar">@hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">h</span>
381
+ <span class="ruby-ivar">@addr_indexes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">1</span>
382
+ <span class="ruby-ivar">@offset_indexes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">1</span>
383
+ <span class="ruby-keyword kw">end</span>
384
+ <span class="ruby-keyword kw">end</span>
385
+ <span class="ruby-keyword kw">else</span>
386
+ <span class="ruby-ivar">@hosts</span> = [<span class="ruby-value str">'b1'</span>,<span class="ruby-value str">'b2'</span>]
387
+ <span class="ruby-ivar">@addr_indexes</span> = [<span class="ruby-value">1</span>,<span class="ruby-value">1</span>]
388
+ <span class="ruby-ivar">@offset_indexes</span> = [<span class="ruby-value">1</span>,<span class="ruby-value">1</span>]
389
+ <span class="ruby-keyword kw">end</span>
390
+
391
+ <span class="ruby-identifier">set_hosts_byname</span>(<span class="ruby-ivar">@hosts</span>, <span class="ruby-ivar">@addr_indexes</span>, <span class="ruby-ivar">@offset_indexes</span>)
392
+ <span class="ruby-keyword kw">end</span>
393
+ </pre>
394
+ </div>
395
+ </div>
396
+ </div>
397
+
398
+ <div id="method-M000187" class="method-detail">
399
+ <a name="M000187"></a>
400
+
401
+ <div class="method-heading">
402
+ <a href="#M000187" class="method-signature">
403
+ <span class="method-name">dump_status</span><span class="method-args">(status, msl)</span>
404
+ </a>
405
+ </div>
406
+
407
+ <div class="method-description">
408
+ <p><a class="source-toggle" href="#"
409
+ onclick="toggleCode('M000187-source');return false;">[Source]</a></p>
410
+ <div class="method-source-code" id="M000187-source">
411
+ <pre>
412
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 295</span>
413
+ <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>)
414
+ <span class="ruby-identifier">filename</span> = <span class="ruby-value str">&quot;app_id_status.json&quot;</span>
415
+ <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>)
416
+ <span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;filename&quot;</span>] = <span class="ruby-identifier">msl</span>
417
+ <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>)
418
+ <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>
419
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">str</span>)
420
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">close</span>
421
+ <span class="ruby-keyword kw">end</span>
422
+ </pre>
423
+ </div>
424
+ </div>
425
+ </div>
426
+
427
+ <div id="method-M000192" class="method-detail">
428
+ <a name="M000192"></a>
429
+
430
+ <div class="method-heading">
431
+ <a href="#M000192" class="method-signature">
432
+ <span class="method-name">help</span><span class="method-args">()</span>
433
+ </a>
434
+ </div>
435
+
436
+ <div class="method-description">
437
+ <p><a class="source-toggle" href="#"
438
+ onclick="toggleCode('M000192-source');return false;">[Source]</a></p>
439
+ <div class="method-source-code" id="M000192-source">
440
+ <pre>
441
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 479</span>
442
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>
443
+ <span class="ruby-identifier">helps</span> = [
444
+ { <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> },
445
+ { <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 the scenario file'</span> },
446
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-f'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--default_host'</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">'default_host setting'</span> },
447
+ { <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> },
448
+ { <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,b2 for ip range'</span> },
449
+ { <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> },
450
+ { <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> },
451
+ { <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 patterns, e.g. 1-100:60,100-100:60,100-1:60'</span> },
452
+ { <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">'scenario file to run'</span> },
453
+ { <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> },
454
+ { <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> }
455
+ ]
456
+
457
+ <span class="ruby-identifier">cmds</span> = [
458
+ <span class="ruby-value str">&quot;mu cmd_runscale:help&quot;</span>,
459
+ <span class="ruby-value str">&quot;mu cmd_runscale:run_file -s &lt;scenario&gt; -i &lt;hosts, e.g. a1,dell-9&gt; -p &lt;pattern, e.g. 1-1000:30&gt;&quot;</span>,
460
+ <span class="ruby-value str">&quot;mu cmd_runscale:run_dir -d &lt;scenario_directory&gt;&quot;</span>,
461
+ <span class="ruby-value str">&quot;mu cmd_runscale:running?&quot;</span>
462
+ ]
463
+
464
+ <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> }
465
+ <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> }
466
+ <span class="ruby-identifier">puts</span>
467
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Usage: mu cmd_runscale:&lt;command&gt; &lt;options&gt;&quot;</span>
468
+ <span class="ruby-identifier">puts</span>
469
+ <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>
470
+ <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>]]
471
+ <span class="ruby-keyword kw">end</span>
472
+ <span class="ruby-identifier">puts</span>
473
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Available Commands&quot;</span>
474
+ <span class="ruby-identifier">puts</span>
475
+ <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>
476
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">c</span>
477
+ <span class="ruby-keyword kw">end</span>
478
+ <span class="ruby-identifier">puts</span>
479
+ <span class="ruby-keyword kw">end</span>
480
+ </pre>
481
+ </div>
482
+ </div>
483
+ </div>
484
+
485
+ <div id="method-M000188" class="method-detail">
486
+ <a name="M000188"></a>
487
+
488
+ <div class="method-heading">
489
+ <a href="#M000188" class="method-signature">
490
+ <span class="method-name">output_csv</span><span class="method-args">(msl_file)</span>
491
+ </a>
492
+ </div>
493
+
494
+ <div class="method-description">
495
+ <p><a class="source-toggle" href="#"
496
+ onclick="toggleCode('M000188-source');return false;">[Source]</a></p>
497
+ <div class="method-source-code" id="M000188-source">
498
+ <pre>
499
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 305</span>
500
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output_csv</span>(<span class="ruby-identifier">msl_file</span>)
501
+ <span class="ruby-identifier">filename</span> = <span class="ruby-value str">&quot;app_id_stats.csv&quot;</span>
502
+ <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>)
503
+ <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>
504
+ <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>) }
505
+ <span class="ruby-keyword kw">end</span>
506
+ </pre>
507
+ </div>
508
+ </div>
509
+ </div>
510
+
511
+ <div id="method-M000191" class="method-detail">
512
+ <a name="M000191"></a>
513
+
514
+ <div class="method-heading">
515
+ <a href="#M000191" class="method-signature">
516
+ <span class="method-name">parse_cli</span><span class="method-args">(argv)</span>
517
+ </a>
518
+ </div>
519
+
520
+ <div class="method-description">
521
+ <p><a class="source-toggle" href="#"
522
+ onclick="toggleCode('M000191-source');return false;">[Source]</a></p>
523
+ <div class="method-source-code" id="M000191-source">
524
+ <pre>
525
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 389</span>
526
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
527
+ <span class="ruby-ivar">@hash</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
528
+ <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>
529
+ <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>
530
+
531
+ <span class="ruby-identifier">k</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
532
+
533
+ <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>
534
+ <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>)
535
+ <span class="ruby-keyword kw">next</span>
536
+ <span class="ruby-keyword kw">end</span>
537
+
538
+ <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>
539
+ <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>)
540
+ <span class="ruby-keyword kw">next</span>
541
+ <span class="ruby-keyword kw">end</span>
542
+
543
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-f'</span>, <span class="ruby-value str">'--default_host'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
544
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'default_host'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
545
+ <span class="ruby-keyword kw">next</span>
546
+ <span class="ruby-keyword kw">end</span>
547
+
548
+ <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>
549
+ <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>)
550
+ <span class="ruby-keyword kw">next</span>
551
+ <span class="ruby-keyword kw">end</span>
552
+
553
+ <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>
554
+ <span class="ruby-identifier">help</span>
555
+ <span class="ruby-identifier">exit</span>
556
+ <span class="ruby-keyword kw">end</span>
557
+
558
+ <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>
559
+ <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>)
560
+ <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>
561
+ <span class="ruby-ivar">@@mu_admin_user</span> = <span class="ruby-identifier">$1</span>
562
+ <span class="ruby-ivar">@@mu_admin_pass</span> = <span class="ruby-identifier">$2</span>
563
+ <span class="ruby-ivar">@@mu_ip</span> = <span class="ruby-identifier">$3</span>
564
+ <span class="ruby-keyword kw">end</span>
565
+ <span class="ruby-keyword kw">next</span>
566
+ <span class="ruby-keyword kw">end</span>
567
+
568
+ <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>
569
+ <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>)
570
+ <span class="ruby-keyword kw">next</span>
571
+ <span class="ruby-keyword kw">end</span>
572
+
573
+ <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>
574
+ <span class="ruby-identifier">patterns</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
575
+ <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>)
576
+ <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>)
577
+ <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>
578
+ <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>
579
+ <span class="ruby-identifier">start_vol</span> = <span class="ruby-identifier">$1</span>
580
+ <span class="ruby-identifier">end_vol</span> = <span class="ruby-identifier">$2</span>
581
+ <span class="ruby-identifier">duration</span> = <span class="ruby-identifier">$3</span>
582
+ <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>
583
+ <span class="ruby-keyword kw">end</span>
584
+ <span class="ruby-keyword kw">end</span>
585
+ <span class="ruby-identifier">ps</span> = <span class="ruby-value str">&quot;{ \&quot;iterations\&quot;: 1, \&quot;intervals\&quot;: [&quot;</span>
586
+ <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>
587
+ <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>
588
+ <span class="ruby-keyword kw">end</span>
589
+ <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>
590
+ <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>
591
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'pattern'</span>] = <span class="ruby-identifier">ps</span>
592
+ <span class="ruby-keyword kw">next</span>
593
+ <span class="ruby-keyword kw">end</span>
594
+
595
+ <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>
596
+ <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>)
597
+ <span class="ruby-keyword kw">next</span>
598
+ <span class="ruby-keyword kw">end</span>
599
+
600
+ <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>
601
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'test'</span>] = <span class="ruby-keyword kw">true</span>
602
+ <span class="ruby-keyword kw">next</span>
603
+ <span class="ruby-keyword kw">end</span>
604
+
605
+ <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>
606
+ <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>
607
+ <span class="ruby-keyword kw">next</span>
608
+ <span class="ruby-keyword kw">end</span>
609
+
610
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unknown option #{k}&quot;</span>
611
+ <span class="ruby-keyword kw">end</span>
612
+
613
+ <span class="ruby-ivar">@hash</span>
614
+ <span class="ruby-keyword kw">end</span>
615
+ </pre>
616
+ </div>
617
+ </div>
618
+ </div>
619
+
620
+ <div id="method-M000190" class="method-detail">
621
+ <a name="M000190"></a>
622
+
623
+ <div class="method-heading">
624
+ <a href="#M000190" class="method-signature">
625
+ <span class="method-name">parse_status</span><span class="method-args">(status)</span>
626
+ </a>
627
+ </div>
628
+
629
+ <div class="method-description">
630
+ <p><a class="source-toggle" href="#"
631
+ onclick="toggleCode('M000190-source');return false;">[Source]</a></p>
632
+ <div class="method-source-code" id="M000190-source">
633
+ <pre>
634
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 336</span>
635
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_status</span>(<span class="ruby-identifier">status</span>)
636
+ <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>
637
+ <span class="ruby-ivar">@reported_volume</span> = <span class="ruby-value">0</span>
638
+ <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>
639
+ <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>
640
+ <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>]
641
+ <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>]
642
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;*** Error = #{@error}, reason = #{@reason} ***\n\n&quot;</span>
643
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
644
+ <span class="ruby-keyword kw">end</span>
645
+ <span class="ruby-keyword kw">end</span>
646
+
647
+ <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>]
648
+ <span class="ruby-ivar">@duration</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;duration&quot;</span>]
649
+ <span class="ruby-ivar">@instances</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;instances&quot;</span>]
650
+ <span class="ruby-ivar">@total_instances</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;total&quot;</span>]
651
+ <span class="ruby-ivar">@executed</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;executed&quot;</span>]
652
+ <span class="ruby-ivar">@timeouts</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;timeouts&quot;</span>]
653
+ <span class="ruby-ivar">@errors</span> = <span class="ruby-ivar">@instances</span>[<span class="ruby-value str">&quot;errors&quot;</span>]
654
+ <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>]
655
+ <span class="ruby-ivar">@server</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;server&quot;</span>]
656
+ <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>]
657
+ <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>]
658
+ <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>]
659
+ <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>]
660
+ <span class="ruby-ivar">@client</span> = <span class="ruby-ivar">@stats_summary</span>[<span class="ruby-value str">&quot;client&quot;</span>]
661
+ <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>]
662
+ <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>]
663
+ <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>]
664
+ <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>]
665
+ <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>]
666
+ <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>
667
+ <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>]
668
+ <span class="ruby-keyword kw">end</span>
669
+
670
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;&quot;</span>
671
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;duration: #{format_float(2, @duration)}&quot;</span>
672
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;concurrency: #{@reported_volume}&quot;</span>
673
+ <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>
674
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;passed: #{@executed}&quot;</span>
675
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;errors: #{@errors}&quot;</span>
676
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;timeouts: #{@timeouts}&quot;</span>
677
+ <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>
678
+ <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>
679
+ <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>
680
+ <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>
681
+ <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>
682
+ <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>
683
+ <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>
684
+ <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>
685
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;&quot;</span>
686
+ <span class="ruby-keyword kw">end</span>
687
+ </pre>
688
+ </div>
689
+ </div>
690
+ </div>
691
+
692
+ <div id="method-M000189" class="method-detail">
693
+ <a name="M000189"></a>
694
+
695
+ <div class="method-heading">
696
+ <a href="#M000189" class="method-signature">
697
+ <span class="method-name">parse_verify_response</span><span class="method-args">(response)</span>
698
+ </a>
699
+ </div>
700
+
701
+ <div class="method-description">
702
+ <p><a class="source-toggle" href="#"
703
+ onclick="toggleCode('M000189-source');return false;">[Source]</a></p>
704
+ <div class="method-source-code" id="M000189-source">
705
+ <pre>
706
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 312</span>
707
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_verify_response</span>(<span class="ruby-identifier">response</span>)
708
+ <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>
709
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;*** error = no response received from /verify ***\n\n&quot;</span>
710
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
711
+ <span class="ruby-keyword kw">end</span>
712
+ <span class="ruby-keyword kw">begin</span>
713
+ <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>
714
+ <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>
715
+ <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>
716
+ <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>]
717
+ <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>]
718
+ <span class="ruby-identifier">dump_status</span>(<span class="ruby-identifier">response</span>)
719
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;*** Error = #{@error}, reason = #{@reason} ***\n\n&quot;</span>
720
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
721
+ <span class="ruby-keyword kw">end</span>
722
+ <span class="ruby-keyword kw">end</span>
723
+ <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>
724
+ <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;*** verify: okay ***&quot;</span>
725
+ <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
726
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">e</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</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">end</span>
730
+ </pre>
731
+ </div>
732
+ </div>
733
+ </div>
734
+
735
+ <div id="method-M000182" class="method-detail">
736
+ <a name="M000182"></a>
737
+
738
+ <div class="method-heading">
739
+ <a href="#M000182" class="method-signature">
740
+ <span class="method-name">run</span><span class="method-args">(scenario)</span>
741
+ </a>
742
+ </div>
743
+
744
+ <div class="method-description">
745
+ <p><a class="source-toggle" href="#"
746
+ onclick="toggleCode('M000182-source');return false;">[Source]</a></p>
747
+ <div class="method-source-code" id="M000182-source">
748
+ <pre>
749
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 123</span>
750
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">scenario</span>)
751
+ <span class="ruby-comment cmt"># assume the scenario and testset files are in dir unless they contain '/'</span>
752
+ <span class="ruby-comment cmt"># in which case they are assumed to be absolute paths</span>
753
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">scenario</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;/&quot;</span>)
754
+ <span class="ruby-identifier">musl_file</span> = <span class="ruby-identifier">scenario</span>
755
+ <span class="ruby-keyword kw">else</span>
756
+ <span class="ruby-identifier">musl_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-identifier">scenario</span>
757
+ <span class="ruby-keyword kw">end</span>
758
+ <span class="ruby-comment cmt"># msg musl_file, Logger::DEBUG</span>
759
+ <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">musl_file</span>))
760
+
761
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@testset</span>.<span class="ruby-identifier">empty?</span>
762
+ <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>)
763
+ <span class="ruby-identifier">csv_file</span> = <span class="ruby-ivar">@testset</span>
764
+ <span class="ruby-keyword kw">else</span>
765
+ <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>
766
+ <span class="ruby-keyword kw">end</span>
767
+ <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>))
768
+ <span class="ruby-keyword kw">end</span>
769
+
770
+ <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>)
771
+ <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>)
772
+
773
+ <span class="ruby-identifier">configure_hosts</span>
774
+
775
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;verifying #{scenario} ...&quot;</span>
776
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">verify</span>
777
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
778
+ <span class="ruby-comment cmt"># sleep 3</span>
779
+ <span class="ruby-identifier">v</span> = <span class="ruby-identifier">parse_verify_response</span>(<span class="ruby-identifier">response</span>)
780
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;#{v}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
781
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">nil?</span>
782
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;error in verify&quot;</span>
783
+ <span class="ruby-keyword kw">return</span>
784
+ <span class="ruby-keyword kw">end</span>
785
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@verify_only</span>
786
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">v</span>
787
+ <span class="ruby-keyword kw">return</span>
788
+ <span class="ruby-keyword kw">end</span>
789
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;starting #{scenario} ...&quot;</span>
790
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">start</span>
791
+ <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>
792
+ <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
793
+ <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
794
+ <span class="ruby-identifier">status</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">status</span>
795
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">status</span>.<span class="ruby-identifier">nil?</span>
796
+ <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>
797
+ <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>
798
+ <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>
799
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">parse_status</span>(<span class="ruby-identifier">status</span>)
800
+ <span class="ruby-identifier">dump_status</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">musl_file</span>)
801
+ <span class="ruby-keyword kw">return</span>
802
+ <span class="ruby-keyword kw">else</span>
803
+ <span class="ruby-identifier">r</span> = <span class="ruby-identifier">parse_status</span>(<span class="ruby-identifier">status</span>)
804
+ <span class="ruby-keyword kw">end</span>
805
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># status['status'].nil? ... no bonafide status was returned</span>
806
+ <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>
807
+ <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>
808
+ <span class="ruby-comment cmt"># puts &quot;\nError: timing out after 20 seconds. Test had failed to start or verify&quot;</span>
809
+ <span class="ruby-keyword kw">break</span>
810
+ <span class="ruby-keyword kw">end</span>
811
+ <span class="ruby-keyword kw">end</span>
812
+ <span class="ruby-keyword kw">end</span>
813
+ <span class="ruby-keyword kw">end</span>
814
+ <span class="ruby-keyword kw">ensure</span>
815
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;stopping #{scenario} ...&quot;</span>
816
+ <span class="ruby-keyword kw">end</span>
817
+ </pre>
818
+ </div>
819
+ </div>
820
+ </div>
821
+
822
+ <div id="method-M000186" class="method-detail">
823
+ <a name="M000186"></a>
824
+
825
+ <div class="method-heading">
826
+ <a href="#M000186" class="method-signature">
827
+ <span class="method-name">set_hosts</span><span class="method-args">(hosts=[&quot;b1&quot;,&quot;b2&quot;])</span>
828
+ </a>
829
+ </div>
830
+
831
+ <div class="method-description">
832
+ <p>
833
+ expects full strings: e.g. b1/12.89.0.1 &#8230;
834
+ </p>
835
+ <p><a class="source-toggle" href="#"
836
+ onclick="toggleCode('M000186-source');return false;">[Source]</a></p>
837
+ <div class="method-source-code" id="M000186-source">
838
+ <pre>
839
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 269</span>
840
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_hosts</span>(<span class="ruby-identifier">hosts</span>=[<span class="ruby-value str">&quot;b1&quot;</span>,<span class="ruby-value str">&quot;b2&quot;</span>])
841
+ <span class="ruby-identifier">host_params</span> = {}
842
+
843
+ <span class="ruby-comment cmt"># assign hosts to consecutive string keys, host_0, host_1, etc ...</span>
844
+ <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>
845
+ <span class="ruby-identifier">host_params</span>[<span class="ruby-node">&quot;host_#{i}&quot;</span>] = <span class="ruby-identifier">hosts</span>[<span class="ruby-identifier">i</span>]
846
+ <span class="ruby-keyword kw">end</span>
847
+
848
+ <span class="ruby-comment cmt"># convert keys to symbols</span>
849
+ <span class="ruby-comment cmt"># host_params.each_key { |k| host_params[k.to_sym] = host_params[k] }</span>
850
+ <span class="ruby-identifier">new_host_params</span> = {}
851
+ <span class="ruby-identifier">host_params</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_host_params</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">host_params</span>[<span class="ruby-identifier">k</span>] }
852
+
853
+ ??
854
+
855
+ <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-value str">&quot;hosts&quot;</span>, <span class="ruby-identifier">new_host_params</span>)
856
+
857
+ <span class="ruby-keyword kw">end</span>
858
+ </pre>
859
+ </div>
860
+ </div>
861
+ </div>
862
+
863
+ <div id="method-M000185" class="method-detail">
864
+ <a name="M000185"></a>
865
+
866
+ <div class="method-heading">
867
+ <a href="#M000185" class="method-signature">
868
+ <span class="method-name">set_hosts_byname</span><span class="method-args">(hosts=@hosts, count=[1,1], offset=[1,1], v4=true)</span>
869
+ </a>
870
+ </div>
871
+
872
+ <div class="method-description">
873
+ <p><a class="source-toggle" href="#"
874
+ onclick="toggleCode('M000185-source');return false;">[Source]</a></p>
875
+ <div class="method-source-code" id="M000185-source">
876
+ <pre>
877
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 241</span>
878
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_hosts_byname</span>(<span class="ruby-identifier">hosts</span>=<span class="ruby-ivar">@hosts</span>, <span class="ruby-identifier">count</span>=[<span class="ruby-value">1</span>,<span class="ruby-value">1</span>], <span class="ruby-identifier">offset</span>=[<span class="ruby-value">1</span>,<span class="ruby-value">1</span>], <span class="ruby-identifier">v4</span>=<span class="ruby-keyword kw">true</span>)
879
+ <span class="ruby-identifier">new_hosts</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
880
+ <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;&quot;</span>
881
+ <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">n</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
882
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^[ab][1-4]$/</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;.&quot;</span>) <span class="ruby-comment cmt"># possible vlan</span>
883
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">count</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">count</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">nil?</span>
884
+ <span class="ruby-identifier">str</span> = <span class="ruby-node">&quot;#{n}/*&quot;</span>
885
+ <span class="ruby-keyword kw">else</span>
886
+ <span class="ruby-identifier">str</span> = <span class="ruby-node">&quot;#{n}/*,#{count[i]},#{offset[i]}&quot;</span>
887
+ <span class="ruby-keyword kw">end</span>
888
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;using host #{str}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
889
+ <span class="ruby-keyword kw">else</span>
890
+ <span class="ruby-ivar">@net</span> = <span class="ruby-constant">Netconfig</span>.<span class="ruby-identifier">new</span>
891
+ <span class="ruby-ivar">@net</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-ivar">@hosts</span>, <span class="ruby-ivar">@username</span>, <span class="ruby-ivar">@password</span>)
892
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v4</span>
893
+ <span class="ruby-identifier">addr</span> = <span class="ruby-ivar">@net</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">&quot;hosts/#{n}&quot;</span>)[<span class="ruby-value str">'v4_addr'</span>]
894
+ <span class="ruby-keyword kw">else</span>
895
+ <span class="ruby-identifier">addr</span> = <span class="ruby-ivar">@net</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">&quot;hosts/#{n}&quot;</span>)[<span class="ruby-value str">'v6_addr'</span>]
896
+ <span class="ruby-keyword kw">end</span>
897
+ <span class="ruby-identifier">str</span> = <span class="ruby-node">&quot;#{addr}&quot;</span>
898
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;using host #{str}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
899
+ <span class="ruby-keyword kw">end</span>
900
+ <span class="ruby-identifier">new_hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>
901
+ <span class="ruby-keyword kw">end</span>
902
+ <span class="ruby-identifier">set_hosts</span>(<span class="ruby-identifier">new_hosts</span>)
903
+ <span class="ruby-keyword kw">end</span>
904
+ </pre>
905
+ </div>
906
+ </div>
907
+ </div>
908
+
909
+ <div id="method-M000181" class="method-detail">
910
+ <a name="M000181"></a>
911
+
912
+ <div class="method-heading">
913
+ <a href="#M000181" class="method-signature">
914
+ <span class="method-name">setup</span><span class="method-args">(argv)</span>
915
+ </a>
916
+ </div>
917
+
918
+ <div class="method-description">
919
+ <p><a class="source-toggle" href="#"
920
+ onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
921
+ <div class="method-source-code" id="M000181-source">
922
+ <pre>
923
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_runscale.rb, line 93</span>
924
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
925
+ <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
926
+ <span class="ruby-ivar">@params</span> = {}
927
+
928
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'test'</span>]
929
+ <span class="ruby-ivar">@verify_only</span> = <span class="ruby-keyword kw">true</span>
930
+ <span class="ruby-keyword kw">else</span>
931
+ <span class="ruby-ivar">@verify_only</span> = <span class="ruby-keyword kw">false</span>
932
+ <span class="ruby-keyword kw">end</span>
933
+
934
+ <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>]
935
+ <span class="ruby-ivar">@testset</span> = <span class="ruby-value str">&quot;&quot;</span>
936
+ <span class="ruby-keyword kw">else</span>
937
+ <span class="ruby-ivar">@testset</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'testset'</span>]
938
+ <span class="ruby-keyword kw">end</span>
939
+
940
+ <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>]
941
+ <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>
942
+ <span class="ruby-keyword kw">else</span>
943
+ <span class="ruby-ivar">@cmd_line_pattern</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'pattern'</span>]
944
+ <span class="ruby-keyword kw">end</span>
945
+
946
+ <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>]
947
+ <span class="ruby-ivar">@cmd_line_hosts</span> = <span class="ruby-value str">&quot;b1,b2&quot;</span>
948
+ <span class="ruby-keyword kw">else</span>
949
+ <span class="ruby-ivar">@cmd_line_hosts</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'interfaces'</span>]
950
+ <span class="ruby-keyword kw">end</span>
951
+
952
+ <span class="ruby-keyword kw">end</span>
953
+ </pre>
954
+ </div>
955
+ </div>
956
+ </div>
957
+
958
+
959
+ </div>
960
+
961
+
962
+ </div>
963
+
964
+
965
+ <div id="validator-badges">
966
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
967
+ </div>
968
+
969
+ </body>
970
+ </html>