mu 5.7.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Mu_Gem.html +1591 -0
- data/bin/mu +11 -0
- data/lib/mu.rb +65 -0
- data/lib/mu/api/ddt.rb +233 -0
- data/lib/mu/api/homepage.rb +54 -0
- data/lib/mu/api/muapi.rb +231 -0
- data/lib/mu/api/netconfig.rb +233 -0
- data/lib/mu/api/scale.rb +199 -0
- data/lib/mu/api/system.rb +40 -0
- data/lib/mu/client.rb +31 -0
- data/lib/mu/command.rb +28 -0
- data/lib/mu/command/api.rb +95 -0
- data/lib/mu/command/cmd_appid.rb +486 -0
- data/lib/mu/command/cmd_cli.rb +151 -0
- data/lib/mu/command/cmd_ddt.rb +449 -0
- data/lib/mu/command/cmd_homepage.rb +146 -0
- data/lib/mu/command/cmd_muapi.rb +361 -0
- data/lib/mu/command/cmd_netconfig.rb +262 -0
- data/lib/mu/command/cmd_runscale.rb +533 -0
- data/lib/mu/command/cmd_runscenario.rb +258 -0
- data/lib/mu/command/cmd_runverify.rb +336 -0
- data/lib/mu/command/cmd_scale.rb +333 -0
- data/lib/mu/command/cmd_system.rb +127 -0
- data/lib/mu/command/curl.rb +246 -0
- data/lib/mu/command/help.rb +29 -0
- data/lib/mu/curl/error.rb +54 -0
- data/lib/mu/curl/verify.rb +137 -0
- data/lib/mu/helper.rb +55 -0
- data/lib/mu/http_helper.rb +232 -0
- data/rdoc/classes/Mu.html +305 -0
- data/rdoc/classes/Mu/Client.html +265 -0
- data/rdoc/classes/Mu/Command.html +208 -0
- data/rdoc/classes/Mu/Command/API.html +524 -0
- data/rdoc/classes/Mu/Command/Cmd_appid.html +934 -0
- data/rdoc/classes/Mu/Command/Cmd_cli.html +515 -0
- data/rdoc/classes/Mu/Command/Cmd_ddt.html +1169 -0
- data/rdoc/classes/Mu/Command/Cmd_homepage.html +489 -0
- data/rdoc/classes/Mu/Command/Cmd_muapi.html +968 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.html +743 -0
- data/rdoc/classes/Mu/Command/Cmd_runscale.html +970 -0
- data/rdoc/classes/Mu/Command/Cmd_runscenario.html +530 -0
- data/rdoc/classes/Mu/Command/Cmd_runverify.html +621 -0
- data/rdoc/classes/Mu/Command/Cmd_scale.html +939 -0
- data/rdoc/classes/Mu/Command/Cmd_system.html +426 -0
- data/rdoc/classes/Mu/Command/Curl.html +524 -0
- data/rdoc/classes/Mu/Command/Help.html +166 -0
- data/rdoc/classes/Mu/Curl.html +116 -0
- data/rdoc/classes/Mu/Curl/Error.html +157 -0
- data/rdoc/classes/Mu/Curl/Error/Authorize.html +178 -0
- data/rdoc/classes/Mu/Curl/Error/Connect.html +149 -0
- data/rdoc/classes/Mu/Curl/Error/DNS.html +113 -0
- data/rdoc/classes/Mu/Curl/Error/Region.html +160 -0
- data/rdoc/classes/Mu/Curl/Error/Status.html +149 -0
- data/rdoc/classes/Mu/Curl/Error/Timeout.html +149 -0
- data/rdoc/classes/Mu/Curl/Verify.html +282 -0
- data/rdoc/classes/Mu/Curl/Verify/Request.html +227 -0
- data/rdoc/classes/Mu/Curl/Verify/Response.html +187 -0
- data/rdoc/classes/Mu/Curl/Verify/Result.html +188 -0
- data/rdoc/classes/Mu/Ddt.html +914 -0
- data/rdoc/classes/Mu/Helper.html +308 -0
- data/rdoc/classes/Mu/Homepage.html +377 -0
- data/rdoc/classes/Mu/HttpHelper.html +639 -0
- data/rdoc/classes/Mu/Muapi.html +816 -0
- data/rdoc/classes/Mu/Netconfig.html +781 -0
- data/rdoc/classes/Mu/Scale.html +832 -0
- data/rdoc/classes/Mu/System.html +281 -0
- data/rdoc/classes/Object.html +148 -0
- data/rdoc/classes/TCTestMu.html +1793 -0
- data/rdoc/classes/Test.html +107 -0
- data/rdoc/classes/Test/Unit.html +107 -0
- data/rdoc/classes/Test/Unit/TestCase.html +113 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/lib/mu/api/ddt_rb.html +101 -0
- data/rdoc/files/lib/mu/api/homepage_rb.html +101 -0
- data/rdoc/files/lib/mu/api/muapi_rb.html +101 -0
- data/rdoc/files/lib/mu/api/netconfig_rb.html +101 -0
- data/rdoc/files/lib/mu/api/scale_rb.html +101 -0
- data/rdoc/files/lib/mu/api/system_rb.html +101 -0
- data/rdoc/files/lib/mu/client_rb.html +101 -0
- data/rdoc/files/lib/mu/command/api_rb.html +101 -0
- data/rdoc/files/lib/mu/command/cmd_appid_rb.html +119 -0
- data/rdoc/files/lib/mu/command/cmd_cli_rb.html +108 -0
- data/rdoc/files/lib/mu/command/cmd_ddt_rb.html +117 -0
- data/rdoc/files/lib/mu/command/cmd_homepage_rb.html +115 -0
- data/rdoc/files/lib/mu/command/cmd_muapi_rb.html +116 -0
- data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +116 -0
- data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +119 -0
- data/rdoc/files/lib/mu/command/cmd_runscenario_rb.html +115 -0
- data/rdoc/files/lib/mu/command/cmd_runverify_rb.html +117 -0
- data/rdoc/files/lib/mu/command/cmd_scale_rb.html +115 -0
- data/rdoc/files/lib/mu/command/cmd_system_rb.html +116 -0
- data/rdoc/files/lib/mu/command/curl_rb.html +101 -0
- data/rdoc/files/lib/mu/command/help_rb.html +101 -0
- data/rdoc/files/lib/mu/command_rb.html +107 -0
- data/rdoc/files/lib/mu/curl/error_rb.html +101 -0
- data/rdoc/files/lib/mu/curl/verify_rb.html +101 -0
- data/rdoc/files/lib/mu/helper_rb.html +101 -0
- data/rdoc/files/lib/mu/http_helper_rb.html +101 -0
- data/rdoc/files/lib/mu_rb.html +121 -0
- data/rdoc/files/test/helper_rb.html +112 -0
- data/rdoc/files/test/tc_test_mu_rb.html +111 -0
- data/rdoc/fr_class_index.html +68 -0
- data/rdoc/fr_file_index.html +55 -0
- data/rdoc/fr_method_index.html +374 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/test/data/app_id_stats.csv +1 -0
- data/test/data/data_cgi.msl +94 -0
- data/test/data/data_cgi.xml +322 -0
- data/test/data/default_test.csv +3 -0
- data/test/data/ftp_with_channel.xml +1643 -0
- data/test/data/irc.xml +3837 -0
- data/test/data/scale_configuration.json +25 -0
- data/test/data/test_data_cgi_error.xml +35 -0
- data/test/helper.rb +18 -0
- data/test/tc_test_mu.rb +716 -0
- metadata +322 -0
@@ -0,0 +1,281 @@
|
|
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::System</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::System</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/mu/api/system_rb.html">
|
59
|
+
lib/mu/api/system.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
|
+
<a href="../Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000296">new</a>
|
92
|
+
<a href="#M000297">restart</a>
|
93
|
+
<a href="#M000298">status</a>
|
94
|
+
<a href="#M000299">status2</a>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
<div id="includes">
|
103
|
+
<h3 class="section-bar">Included Modules</h3>
|
104
|
+
|
105
|
+
<div id="includes-list">
|
106
|
+
<span class="include-name"><a href="Helper.html">Helper</a></span>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
<div id="section">
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<div id="attribute-list">
|
117
|
+
<h3 class="section-bar">Attributes</h3>
|
118
|
+
|
119
|
+
<div class="name-list">
|
120
|
+
<table>
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">docroot</td>
|
123
|
+
<td class="context-item-value"> [RW] </td>
|
124
|
+
<td class="context-item-desc"></td>
|
125
|
+
</tr>
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td class="context-item-name">host</td>
|
128
|
+
<td class="context-item-value"> [RW] </td>
|
129
|
+
<td class="context-item-desc"></td>
|
130
|
+
</tr>
|
131
|
+
<tr class="top-aligned-row context-row">
|
132
|
+
<td class="context-item-name">password</td>
|
133
|
+
<td class="context-item-value"> [RW] </td>
|
134
|
+
<td class="context-item-desc"></td>
|
135
|
+
</tr>
|
136
|
+
<tr class="top-aligned-row context-row">
|
137
|
+
<td class="context-item-name">username</td>
|
138
|
+
<td class="context-item-value"> [RW] </td>
|
139
|
+
<td class="context-item-desc"></td>
|
140
|
+
</tr>
|
141
|
+
</table>
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<!-- if method_list -->
|
148
|
+
<div id="methods">
|
149
|
+
<h3 class="section-bar">Public Class methods</h3>
|
150
|
+
|
151
|
+
<div id="method-M000296" class="method-detail">
|
152
|
+
<a name="M000296"></a>
|
153
|
+
|
154
|
+
<div class="method-heading">
|
155
|
+
<a href="#M000296" class="method-signature">
|
156
|
+
<span class="method-name">new</span><span class="method-args">(host=ENV['MU_IP'], username=ENV['MU_ADMIN_USER'], password=ENV['MU_ADMIN_PASS'])</span>
|
157
|
+
</a>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
<div class="method-description">
|
161
|
+
<p><a class="source-toggle" href="#"
|
162
|
+
onclick="toggleCode('M000296-source');return false;">[Source]</a></p>
|
163
|
+
<div class="method-source-code" id="M000296-source">
|
164
|
+
<pre>
|
165
|
+
<span class="ruby-comment cmt"># File lib/mu/api/system.rb, line 7</span>
|
166
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>=<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_IP'</span>], <span class="ruby-identifier">username</span>=<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_USER'</span>], <span class="ruby-identifier">password</span>=<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_PASS'</span>])
|
167
|
+
<span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
|
168
|
+
<span class="ruby-ivar">@username</span> = <span class="ruby-identifier">username</span>
|
169
|
+
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
|
170
|
+
<span class="ruby-ivar">@docroot</span> = <span class="ruby-value str">"/api/v5/system/"</span>
|
171
|
+
<span class="ruby-ivar">@cookie</span> = <span class="ruby-value str">""</span>
|
172
|
+
<span class="ruby-ivar">@response</span> = <span class="ruby-keyword kw">nil</span>
|
173
|
+
<span class="ruby-ivar">@http</span> = <span class="ruby-constant">HttpHelper</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@username</span>, <span class="ruby-ivar">@password</span>, <span class="ruby-ivar">@docroot</span>)
|
174
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-node">"Created System Api object to :#{@host}"</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
|
175
|
+
<span class="ruby-keyword kw">end</span>
|
176
|
+
</pre>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
182
|
+
|
183
|
+
<div id="method-M000297" class="method-detail">
|
184
|
+
<a name="M000297"></a>
|
185
|
+
|
186
|
+
<div class="method-heading">
|
187
|
+
<a href="#M000297" class="method-signature">
|
188
|
+
<span class="method-name">restart</span><span class="method-args">()</span>
|
189
|
+
</a>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
<div class="method-description">
|
193
|
+
<p>
|
194
|
+
restarts the <a href="../Mu.html">Mu</a> system
|
195
|
+
</p>
|
196
|
+
<p><a class="source-toggle" href="#"
|
197
|
+
onclick="toggleCode('M000297-source');return false;">[Source]</a></p>
|
198
|
+
<div class="method-source-code" id="M000297-source">
|
199
|
+
<pre>
|
200
|
+
<span class="ruby-comment cmt"># File lib/mu/api/system.rb, line 19</span>
|
201
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restart</span>
|
202
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value str">"restart/"</span>)
|
203
|
+
<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>
|
204
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
205
|
+
<span class="ruby-keyword kw">end</span>
|
206
|
+
</pre>
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<div id="method-M000298" class="method-detail">
|
212
|
+
<a name="M000298"></a>
|
213
|
+
|
214
|
+
<div class="method-heading">
|
215
|
+
<a href="#M000298" class="method-signature">
|
216
|
+
<span class="method-name">status</span><span class="method-args">()</span>
|
217
|
+
</a>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
<div class="method-description">
|
221
|
+
<p>
|
222
|
+
returns <a href="../Mu.html">Mu</a> <a href="System.html">System</a> <a
|
223
|
+
href="System.html#M000298">status</a>
|
224
|
+
</p>
|
225
|
+
<p><a class="source-toggle" href="#"
|
226
|
+
onclick="toggleCode('M000298-source');return false;">[Source]</a></p>
|
227
|
+
<div class="method-source-code" id="M000298-source">
|
228
|
+
<pre>
|
229
|
+
<span class="ruby-comment cmt"># File lib/mu/api/system.rb, line 26</span>
|
230
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">status</span>
|
231
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value str">"status/"</span>)
|
232
|
+
<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>
|
233
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
234
|
+
<span class="ruby-keyword kw">end</span>
|
235
|
+
</pre>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<div id="method-M000299" class="method-detail">
|
241
|
+
<a name="M000299"></a>
|
242
|
+
|
243
|
+
<div class="method-heading">
|
244
|
+
<a href="#M000299" class="method-signature">
|
245
|
+
<span class="method-name">status2</span><span class="method-args">()</span>
|
246
|
+
</a>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method-description">
|
250
|
+
<p>
|
251
|
+
returns more <a href="../Mu.html">Mu</a> <a href="System.html">System</a>
|
252
|
+
<a href="System.html#M000298">status</a>
|
253
|
+
</p>
|
254
|
+
<p><a class="source-toggle" href="#"
|
255
|
+
onclick="toggleCode('M000299-source');return false;">[Source]</a></p>
|
256
|
+
<div class="method-source-code" id="M000299-source">
|
257
|
+
<pre>
|
258
|
+
<span class="ruby-comment cmt"># File lib/mu/api/system.rb, line 33</span>
|
259
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">status2</span>
|
260
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value str">"status2/"</span>)
|
261
|
+
<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>
|
262
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
263
|
+
<span class="ruby-keyword kw">end</span>
|
264
|
+
</pre>
|
265
|
+
</div>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
<div id="validator-badges">
|
277
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
</body>
|
281
|
+
</html>
|
@@ -0,0 +1,148 @@
|
|
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: Object</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">Object</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/test/tc_test_mu_rb.html">
|
59
|
+
test/tc_test_mu.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
|
+
<a href="Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000050">deep_clone</a>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
<!-- if includes -->
|
99
|
+
|
100
|
+
<div id="section">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<!-- if method_list -->
|
110
|
+
<div id="methods">
|
111
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
112
|
+
|
113
|
+
<div id="method-M000050" class="method-detail">
|
114
|
+
<a name="M000050"></a>
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
<a href="#M000050" class="method-signature">
|
118
|
+
<span class="method-name">deep_clone</span><span class="method-args">()</span>
|
119
|
+
</a>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<div class="method-description">
|
123
|
+
<p><a class="source-toggle" href="#"
|
124
|
+
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
125
|
+
<div class="method-source-code" id="M000050-source">
|
126
|
+
<pre>
|
127
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 7</span>
|
128
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deep_clone</span>
|
129
|
+
<span class="ruby-constant">Marshal</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-keyword kw">self</span>))
|
130
|
+
<span class="ruby-keyword kw">end</span>
|
131
|
+
</pre>
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
</div>
|
138
|
+
|
139
|
+
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
<div id="validator-badges">
|
144
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
</body>
|
148
|
+
</html>
|
@@ -0,0 +1,1793 @@
|
|
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: TCTestMu</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">TCTestMu</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/test/tc_test_mu_rb.html">
|
59
|
+
test/tc_test_mu.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
|
+
<a href="Test/Unit/TestCase.html">
|
69
|
+
Test::Unit::TestCase
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000025">make_uuid_args</a>
|
92
|
+
<a href="#M000001">setup</a>
|
93
|
+
<a href="#M000002">teardown</a>
|
94
|
+
<a href="#M000005">test_cli_history</a>
|
95
|
+
<a href="#M000006">test_cli_question</a>
|
96
|
+
<a href="#M000004">test_cmd_appid_run_dir</a>
|
97
|
+
<a href="#M000003">test_cmd_appid_run_file</a>
|
98
|
+
<a href="#M000007">test_cmd_ddt_get_all_sessions</a>
|
99
|
+
<a href="#M000010">test_cmd_ddt_get_set_channels</a>
|
100
|
+
<a href="#M000009">test_cmd_ddt_get_set_hosts</a>
|
101
|
+
<a href="#M000008">test_cmd_ddt_get_set_options</a>
|
102
|
+
<a href="#M000024">test_cmd_muapi_analysis</a>
|
103
|
+
<a href="#M000026">test_cmd_muapi_archive</a>
|
104
|
+
<a href="#M000023">test_cmd_muapi_capture</a>
|
105
|
+
<a href="#M000027">test_cmd_muapi_delete</a>
|
106
|
+
<a href="#M000022">test_cmd_muapi_export_by_type_and_name</a>
|
107
|
+
<a href="#M000021">test_cmd_muapi_export_by_uuid</a>
|
108
|
+
<a href="#M000020">test_cmd_muapi_types</a>
|
109
|
+
<a href="#M000035">test_cmd_netconfig_add_modify_delete_route</a>
|
110
|
+
<a href="#M000034">test_cmd_netconfig_create_delete_host</a>
|
111
|
+
<a href="#M000031">test_cmd_netconfig_get_interfaces_a1</a>
|
112
|
+
<a href="#M000032">test_cmd_netconfig_modify_interfaces_a1</a>
|
113
|
+
<a href="#M000036">test_cmd_netconfig_resolve_hosts</a>
|
114
|
+
<a href="#M000037">test_cmd_netconfig_save</a>
|
115
|
+
<a href="#M000033">test_cmd_netconfig_vlans</a>
|
116
|
+
<a href="#M000040">test_cmd_runscale_run_dir</a>
|
117
|
+
<a href="#M000039">test_cmd_runscale_run_file</a>
|
118
|
+
<a href="#M000041">test_cmd_runscenario</a>
|
119
|
+
<a href="#M000042">test_cmd_runverify</a>
|
120
|
+
<a href="#M000048">test_cmd_system_status</a>
|
121
|
+
<a href="#M000049">test_cmd_system_status2</a>
|
122
|
+
<a href="#M000013">test_ddt_close_all_sessions</a>
|
123
|
+
<a href="#M000012">test_ddt_get_all_sessions</a>
|
124
|
+
<a href="#M000011">test_ddt_new</a>
|
125
|
+
<a href="#M000014">test_ddt_set_hosts</a>
|
126
|
+
<a href="#M000017">test_homepage_all</a>
|
127
|
+
<a href="#M000018">test_homepage_latest_test</a>
|
128
|
+
<a href="#M000019">test_homepage_new</a>
|
129
|
+
<a href="#M000016">test_homepage_recent</a>
|
130
|
+
<a href="#M000015">test_homepage_status</a>
|
131
|
+
<a href="#M000029">test_muapi_list_by_status</a>
|
132
|
+
<a href="#M000028">test_muapi_new</a>
|
133
|
+
<a href="#M000030">test_muapi_types</a>
|
134
|
+
<a href="#M000038">test_netconfig_new</a>
|
135
|
+
<a href="#M000044">test_scale_about</a>
|
136
|
+
<a href="#M000045">test_scale_list</a>
|
137
|
+
<a href="#M000043">test_scale_new</a>
|
138
|
+
<a href="#M000046">test_scale_session</a>
|
139
|
+
<a href="#M000047">test_system_new</a>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
<!-- if includes -->
|
147
|
+
|
148
|
+
<div id="section">
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<!-- if method_list -->
|
158
|
+
<div id="methods">
|
159
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
160
|
+
|
161
|
+
<div id="method-M000025" class="method-detail">
|
162
|
+
<a name="M000025"></a>
|
163
|
+
|
164
|
+
<div class="method-heading">
|
165
|
+
<a href="#M000025" class="method-signature">
|
166
|
+
<span class="method-name">make_uuid_args</span><span class="method-args">(uuid)</span>
|
167
|
+
</a>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
<p><a class="source-toggle" href="#"
|
172
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
173
|
+
<div class="method-source-code" id="M000025-source">
|
174
|
+
<pre>
|
175
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 352</span>
|
176
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">uuid</span>)
|
177
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
178
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-u"</span>
|
179
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">uuid</span>
|
180
|
+
<span class="ruby-comment cmt"># args << "-v"</span>
|
181
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">args</span>
|
182
|
+
<span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000001" class="method-detail">
|
189
|
+
<a name="M000001"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="#M000001" class="method-signature">
|
193
|
+
<span class="method-name">setup</span><span class="method-args">()</span>
|
194
|
+
</a>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
<p><a class="source-toggle" href="#"
|
199
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
200
|
+
<div class="method-source-code" id="M000001-source">
|
201
|
+
<pre>
|
202
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 16</span>
|
203
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
204
|
+
<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">INFO</span>
|
205
|
+
<span class="ruby-ivar">@mu_ip</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_IP'</span>]
|
206
|
+
<span class="ruby-ivar">@mu_admin_user</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_USER'</span>]
|
207
|
+
<span class="ruby-ivar">@mu_admin_pass</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_PASS'</span>]
|
208
|
+
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">$dir</span>)
|
209
|
+
<span class="ruby-identifier">$cookie</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># reset for htto_helper</span>
|
210
|
+
<span class="ruby-comment cmt"># puts "pwd = #{Dir.pwd}"</span>
|
211
|
+
<span class="ruby-keyword kw">end</span>
|
212
|
+
</pre>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
<div id="method-M000002" class="method-detail">
|
218
|
+
<a name="M000002"></a>
|
219
|
+
|
220
|
+
<div class="method-heading">
|
221
|
+
<a href="#M000002" class="method-signature">
|
222
|
+
<span class="method-name">teardown</span><span class="method-args">()</span>
|
223
|
+
</a>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
<div class="method-description">
|
227
|
+
<p><a class="source-toggle" href="#"
|
228
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
229
|
+
<div class="method-source-code" id="M000002-source">
|
230
|
+
<pre>
|
231
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 26</span>
|
232
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">teardown</span>
|
233
|
+
|
234
|
+
<span class="ruby-keyword kw">end</span>
|
235
|
+
</pre>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<div id="method-M000005" class="method-detail">
|
241
|
+
<a name="M000005"></a>
|
242
|
+
|
243
|
+
<div class="method-heading">
|
244
|
+
<a href="#M000005" class="method-signature">
|
245
|
+
<span class="method-name">test_cli_history</span><span class="method-args">()</span>
|
246
|
+
</a>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method-description">
|
250
|
+
<p>
|
251
|
+
————— cmd_cli
|
252
|
+
—————-
|
253
|
+
</p>
|
254
|
+
<p><a class="source-toggle" href="#"
|
255
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
256
|
+
<div class="method-source-code" id="M000005-source">
|
257
|
+
<pre>
|
258
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 74</span>
|
259
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cli_history</span>
|
260
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_cli</span>.<span class="ruby-identifier">new</span>
|
261
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_history</span> []
|
262
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">result</span>
|
263
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">result</span><span class="ruby-operator">==</span><span class="ruby-keyword kw">true</span>, <span class="ruby-value str">"expected 'true'"</span>
|
264
|
+
<span class="ruby-keyword kw">end</span>
|
265
|
+
</pre>
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
<div id="method-M000006" class="method-detail">
|
271
|
+
<a name="M000006"></a>
|
272
|
+
|
273
|
+
<div class="method-heading">
|
274
|
+
<a href="#M000006" class="method-signature">
|
275
|
+
<span class="method-name">test_cli_question</span><span class="method-args">()</span>
|
276
|
+
</a>
|
277
|
+
</div>
|
278
|
+
|
279
|
+
<div class="method-description">
|
280
|
+
<p><a class="source-toggle" href="#"
|
281
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
282
|
+
<div class="method-source-code" id="M000006-source">
|
283
|
+
<pre>
|
284
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 81</span>
|
285
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cli_question</span>
|
286
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_cli</span>.<span class="ruby-identifier">new</span>
|
287
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_question</span> []
|
288
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">result</span>
|
289
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">result</span><span class="ruby-operator">==</span><span class="ruby-keyword kw">true</span>, <span class="ruby-value str">"expected 'true'"</span>
|
290
|
+
<span class="ruby-keyword kw">end</span>
|
291
|
+
</pre>
|
292
|
+
</div>
|
293
|
+
</div>
|
294
|
+
</div>
|
295
|
+
|
296
|
+
<div id="method-M000004" class="method-detail">
|
297
|
+
<a name="M000004"></a>
|
298
|
+
|
299
|
+
<div class="method-heading">
|
300
|
+
<a href="#M000004" class="method-signature">
|
301
|
+
<span class="method-name">test_cmd_appid_run_dir</span><span class="method-args">()</span>
|
302
|
+
</a>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
<div class="method-description">
|
306
|
+
<p>
|
307
|
+
use ip range setting and a brief pattern
|
308
|
+
</p>
|
309
|
+
<p><a class="source-toggle" href="#"
|
310
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
311
|
+
<div class="method-source-code" id="M000004-source">
|
312
|
+
<pre>
|
313
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 52</span>
|
314
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_appid_run_dir</span>
|
315
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"app_id_status.json"</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">"app_id_status.json"</span>)
|
316
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_appid</span>.<span class="ruby-identifier">new</span>
|
317
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
318
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-d"</span>
|
319
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{Dir.pwd}/test/data"</span>
|
320
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-i"</span>
|
321
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"b1-10000,b2"</span>
|
322
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-p"</span>
|
323
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"1-100:10"</span>
|
324
|
+
<span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_dir</span> <span class="ruby-identifier">args</span>
|
325
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
326
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">"app_id_status.json"</span>), <span class="ruby-value str">"app_id_status.json file was not created"</span>)
|
327
|
+
<span class="ruby-identifier">j</span> = <span class="ruby-constant">JSON</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value str">"app_id_status.json"</span>)
|
328
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">"status"</span>]
|
329
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"duration"</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">>=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">"expected summary duration > 10, but got #{status["statistics"]["summary"]["duration"]}"</span>)
|
330
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"instances"</span>][<span class="ruby-value str">"executed"</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">></span> <span class="ruby-value">10</span>, <span class="ruby-node">"expected instances executed > 0, but got #{status["statistics"]["summary"]["instances"]["executed"]}"</span>)
|
331
|
+
<span class="ruby-keyword kw">end</span>
|
332
|
+
</pre>
|
333
|
+
</div>
|
334
|
+
</div>
|
335
|
+
</div>
|
336
|
+
|
337
|
+
<div id="method-M000003" class="method-detail">
|
338
|
+
<a name="M000003"></a>
|
339
|
+
|
340
|
+
<div class="method-heading">
|
341
|
+
<a href="#M000003" class="method-signature">
|
342
|
+
<span class="method-name">test_cmd_appid_run_file</span><span class="method-args">()</span>
|
343
|
+
</a>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
<div class="method-description">
|
347
|
+
<p>
|
348
|
+
use ip range setting and a brief pattern
|
349
|
+
</p>
|
350
|
+
<p><a class="source-toggle" href="#"
|
351
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
352
|
+
<div class="method-source-code" id="M000003-source">
|
353
|
+
<pre>
|
354
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 33</span>
|
355
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_appid_run_file</span>
|
356
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"app_id_status.json"</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">"app_id_status.json"</span>)
|
357
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_appid</span>.<span class="ruby-identifier">new</span>
|
358
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
359
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-s"</span>
|
360
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{Dir.pwd}/test/data/data_cgi.msl"</span>
|
361
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-i"</span>
|
362
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"b1-10000,b2"</span>
|
363
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-p"</span>
|
364
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"1-100:10"</span>
|
365
|
+
<span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_file</span> <span class="ruby-identifier">args</span>
|
366
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">"app_id_status.json"</span>), <span class="ruby-value str">"app_id_status.json file was not created"</span>)
|
367
|
+
<span class="ruby-identifier">j</span> = <span class="ruby-constant">JSON</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value str">"app_id_status.json"</span>)
|
368
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">"status"</span>]
|
369
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"duration"</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">>=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">"expected summary duration > 10, but got #{status["statistics"]["summary"]["duration"]}"</span>)
|
370
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"instances"</span>][<span class="ruby-value str">"executed"</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">></span> <span class="ruby-value">10</span>, <span class="ruby-node">"expected instances executed > 0, but got #{status["statistics"]["summary"]["instances"]["executed"]}"</span>)
|
371
|
+
<span class="ruby-keyword kw">end</span>
|
372
|
+
</pre>
|
373
|
+
</div>
|
374
|
+
</div>
|
375
|
+
</div>
|
376
|
+
|
377
|
+
<div id="method-M000007" class="method-detail">
|
378
|
+
<a name="M000007"></a>
|
379
|
+
|
380
|
+
<div class="method-heading">
|
381
|
+
<a href="#M000007" class="method-signature">
|
382
|
+
<span class="method-name">test_cmd_ddt_get_all_sessions</span><span class="method-args">()</span>
|
383
|
+
</a>
|
384
|
+
</div>
|
385
|
+
|
386
|
+
<div class="method-description">
|
387
|
+
<p>
|
388
|
+
————— cmd_ddt
|
389
|
+
—————
|
390
|
+
</p>
|
391
|
+
<p><a class="source-toggle" href="#"
|
392
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
393
|
+
<div class="method-source-code" id="M000007-source">
|
394
|
+
<pre>
|
395
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 90</span>
|
396
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_all_sessions</span>
|
397
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_ddt</span>.<span class="ruby-identifier">new</span>
|
398
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
|
399
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
|
400
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
|
401
|
+
<span class="ruby-identifier">sessions</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_all_sessions</span> [])
|
402
|
+
<span class="ruby-identifier">sess</span> = <span class="ruby-identifier">sessions</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//session"</span>)
|
403
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">sess</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span>, <span class="ruby-node">"expected 2 sessions, got #{sess.length}"</span>)
|
404
|
+
<span class="ruby-keyword kw">ensure</span>
|
405
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
|
406
|
+
<span class="ruby-keyword kw">end</span>
|
407
|
+
</pre>
|
408
|
+
</div>
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
|
412
|
+
<div id="method-M000010" class="method-detail">
|
413
|
+
<a name="M000010"></a>
|
414
|
+
|
415
|
+
<div class="method-heading">
|
416
|
+
<a href="#M000010" class="method-signature">
|
417
|
+
<span class="method-name">test_cmd_ddt_get_set_channels</span><span class="method-args">()</span>
|
418
|
+
</a>
|
419
|
+
</div>
|
420
|
+
|
421
|
+
<div class="method-description">
|
422
|
+
<p><a class="source-toggle" href="#"
|
423
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
424
|
+
<div class="method-source-code" id="M000010-source">
|
425
|
+
<pre>
|
426
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 151</span>
|
427
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_set_channels</span>
|
428
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"expects SSH channel defined on a host named dell-eth1"</span>
|
429
|
+
<span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">"379a4cf8-8fe7-4d2d-8f6b-b8c6b71557b4"</span> <span class="ruby-comment cmt"># ftp_with_channel</span>
|
430
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_ddt</span>.<span class="ruby-identifier">new</span>
|
431
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> [ <span class="ruby-value str">"-v"</span> ]
|
432
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
|
433
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
434
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/ftp_with_channel.xml"</span>))
|
435
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_load_scenario</span> [ <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">scenario_uuid</span> ]
|
436
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_setup_test</span> []
|
437
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_channels</span> []
|
438
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">response</span>)
|
439
|
+
<span class="ruby-identifier">channels</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//channel"</span>)
|
440
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">channels</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">==</span><span class="ruby-value">1</span>, <span class="ruby-node">"expected 1 scenario channel, found #{channels.length}"</span>
|
441
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_set_channels</span> [ <span class="ruby-value str">"-r"</span>, <span class="ruby-value str">"channel"</span>, <span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"dell-eth1"</span> ]
|
442
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">resp</span> <span class="ruby-operator">|</span>
|
443
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">resp</span>)
|
444
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//message"</span>).<span class="ruby-identifier">text</span>
|
445
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"Bind channel successfully"</span>) , <span class="ruby-node">"expected 'Bind host successfully' but got #{message}"</span>
|
446
|
+
<span class="ruby-keyword kw">end</span>
|
447
|
+
<span class="ruby-keyword kw">ensure</span>
|
448
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
|
449
|
+
<span class="ruby-keyword kw">end</span>
|
450
|
+
</pre>
|
451
|
+
</div>
|
452
|
+
</div>
|
453
|
+
</div>
|
454
|
+
|
455
|
+
<div id="method-M000009" class="method-detail">
|
456
|
+
<a name="M000009"></a>
|
457
|
+
|
458
|
+
<div class="method-heading">
|
459
|
+
<a href="#M000009" class="method-signature">
|
460
|
+
<span class="method-name">test_cmd_ddt_get_set_hosts</span><span class="method-args">()</span>
|
461
|
+
</a>
|
462
|
+
</div>
|
463
|
+
|
464
|
+
<div class="method-description">
|
465
|
+
<p><a class="source-toggle" href="#"
|
466
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
467
|
+
<div class="method-source-code" id="M000009-source">
|
468
|
+
<pre>
|
469
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 127</span>
|
470
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_set_hosts</span>
|
471
|
+
<span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">"ef6fe3eb-4e9f-44b5-a99e-c431d82e4eeb"</span>
|
472
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_ddt</span>.<span class="ruby-identifier">new</span>
|
473
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> [ <span class="ruby-value str">"-v"</span> ]
|
474
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
|
475
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
476
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/data_cgi.xml"</span>))
|
477
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_load_scenario</span> [ <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">scenario_uuid</span> ]
|
478
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_setup_test</span> []
|
479
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_hosts</span> []
|
480
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">response</span>)
|
481
|
+
<span class="ruby-identifier">hosts</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//host"</span>)
|
482
|
+
<span class="ruby-identifier">role</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//host/role"</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">text</span>
|
483
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">==</span><span class="ruby-value">2</span>, <span class="ruby-node">"expected 2 scenario hosts, found #{hosts.length}"</span>
|
484
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_set_hosts</span> [ <span class="ruby-value str">"-r"</span>, <span class="ruby-identifier">role</span>, <span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"a3"</span> ]
|
485
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">resp</span> <span class="ruby-operator">|</span>
|
486
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">resp</span>)
|
487
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//message"</span>).<span class="ruby-identifier">text</span>
|
488
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"Bind host successfully"</span>) , <span class="ruby-node">"expected 'Bind host successfully' but got #{message}"</span>
|
489
|
+
<span class="ruby-keyword kw">end</span>
|
490
|
+
<span class="ruby-keyword kw">ensure</span>
|
491
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
|
492
|
+
<span class="ruby-keyword kw">end</span>
|
493
|
+
</pre>
|
494
|
+
</div>
|
495
|
+
</div>
|
496
|
+
</div>
|
497
|
+
|
498
|
+
<div id="method-M000008" class="method-detail">
|
499
|
+
<a name="M000008"></a>
|
500
|
+
|
501
|
+
<div class="method-heading">
|
502
|
+
<a href="#M000008" class="method-signature">
|
503
|
+
<span class="method-name">test_cmd_ddt_get_set_options</span><span class="method-args">()</span>
|
504
|
+
</a>
|
505
|
+
</div>
|
506
|
+
|
507
|
+
<div class="method-description">
|
508
|
+
<p><a class="source-toggle" href="#"
|
509
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
510
|
+
<div class="method-source-code" id="M000008-source">
|
511
|
+
<pre>
|
512
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 102</span>
|
513
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_set_options</span>
|
514
|
+
<span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">"ef6fe3eb-4e9f-44b5-a99e-c431d82e4eeb"</span>
|
515
|
+
<span class="ruby-comment cmt">#test_set_uuid = "49cd406e-a8ca-4360-a115-e7ac33e8034f"</span>
|
516
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_ddt</span>.<span class="ruby-identifier">new</span>
|
517
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
|
518
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
|
519
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
520
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/data_cgi.xml"</span>))
|
521
|
+
<span class="ruby-comment cmt"># http_helper.post_xml("templates/import", File.read("#{Dir.pwd}/test/data/test_data_cgi_error.xml"))</span>
|
522
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_load_scenario</span> [ <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">scenario_uuid</span> ]
|
523
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_setup_test</span> []
|
524
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_options</span> []
|
525
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">response</span>)
|
526
|
+
<span class="ruby-identifier">options</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//option/name"</span>)
|
527
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">==</span><span class="ruby-value">8</span>, <span class="ruby-node">"expected 8 scenario options, found #{options.length}"</span>
|
528
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_set_options</span> [ <span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"scenario_user_options.url"</span>, <span class="ruby-value str">"-p"</span>, <span class="ruby-value str">"hullo"</span> ]
|
529
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">resp</span> <span class="ruby-operator">|</span>
|
530
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">resp</span>)
|
531
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//message"</span>).<span class="ruby-identifier">text</span>
|
532
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"Option set"</span>) , <span class="ruby-node">"expected 'Option set' but got #{message}"</span>
|
533
|
+
<span class="ruby-keyword kw">end</span>
|
534
|
+
<span class="ruby-keyword kw">ensure</span>
|
535
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
|
536
|
+
<span class="ruby-keyword kw">end</span>
|
537
|
+
</pre>
|
538
|
+
</div>
|
539
|
+
</div>
|
540
|
+
</div>
|
541
|
+
|
542
|
+
<div id="method-M000024" class="method-detail">
|
543
|
+
<a name="M000024"></a>
|
544
|
+
|
545
|
+
<div class="method-heading">
|
546
|
+
<a href="#M000024" class="method-signature">
|
547
|
+
<span class="method-name">test_cmd_muapi_analysis</span><span class="method-args">()</span>
|
548
|
+
</a>
|
549
|
+
</div>
|
550
|
+
|
551
|
+
<div class="method-description">
|
552
|
+
<p>
|
553
|
+
assumes hosts a1.v4 -> dell-eth1.v4
|
554
|
+
</p>
|
555
|
+
<p><a class="source-toggle" href="#"
|
556
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
557
|
+
<div class="method-source-code" id="M000024-source">
|
558
|
+
<pre>
|
559
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 315</span>
|
560
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_analysis</span>
|
561
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
562
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"assumes hosts a1.v4 -> dell-eth1.v4"</span>
|
563
|
+
<span class="ruby-identifier">uuid</span> = <span class="ruby-value str">"f07f3cb9-b1a0-4840-a7fd-e733c89f303c"</span>
|
564
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
565
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/proto_arp.xml"</span>))
|
566
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_muapi</span>.<span class="ruby-identifier">new</span>
|
567
|
+
|
568
|
+
<span class="ruby-identifier">run_uuid</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">uuid</span>) <span class="ruby-comment cmt"># use the run_uuid for subsequent calls</span>
|
569
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
570
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
571
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"RUNNING"</span>, <span class="ruby-node">"after RUN, expected status=RUNNING, got #{status}"</span>)
|
572
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_pause</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
573
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
574
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
575
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"SUSPENDED"</span>, <span class="ruby-node">"after PAUSE, expected status=SUSPENDED, got #{status}"</span>)
|
576
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_resume</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
577
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
578
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
579
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"RUNNING"</span>, <span class="ruby-node">"after RESUME, expected status=RUNNING, got #{status}"</span>)
|
580
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
581
|
+
<span class="ruby-identifier">list</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_list_by_status</span> [<span class="ruby-value str">"-s"</span>, <span class="ruby-value str">"running"</span>]
|
582
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">list</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">run_uuid</span>), <span class="ruby-node">"expected run_uuid #{run_uuid}in the list_by_status for running, but got #{list}"</span>)
|
583
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_stop</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
584
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
585
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
586
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"ABORTED"</span>, <span class="ruby-node">"after STOP, expected status=ABORTED, got #{status}"</span>)
|
587
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_name</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>) <span class="ruby-comment cmt"># returns a Nokogiri::XML::Attr</span>
|
588
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"proto/arp"</span>), <span class="ruby-node">"expected name = proto/arp but got #{name.value}"</span>)
|
589
|
+
<span class="ruby-keyword kw">ensure</span>
|
590
|
+
<span class="ruby-keyword kw">begin</span>
|
591
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_stop</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
592
|
+
<span class="ruby-keyword kw">rescue</span>
|
593
|
+
<span class="ruby-comment cmt"># do nothing. probably already stopped</span>
|
594
|
+
<span class="ruby-keyword kw">end</span>
|
595
|
+
<span class="ruby-keyword kw">end</span>
|
596
|
+
</pre>
|
597
|
+
</div>
|
598
|
+
</div>
|
599
|
+
</div>
|
600
|
+
|
601
|
+
<div id="method-M000026" class="method-detail">
|
602
|
+
<a name="M000026"></a>
|
603
|
+
|
604
|
+
<div class="method-heading">
|
605
|
+
<a href="#M000026" class="method-signature">
|
606
|
+
<span class="method-name">test_cmd_muapi_archive</span><span class="method-args">()</span>
|
607
|
+
</a>
|
608
|
+
</div>
|
609
|
+
|
610
|
+
<div class="method-description">
|
611
|
+
<p>
|
612
|
+
assumes hosts a1.v4 -> dell-eth1.v4
|
613
|
+
</p>
|
614
|
+
<p><a class="source-toggle" href="#"
|
615
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
616
|
+
<div class="method-source-code" id="M000026-source">
|
617
|
+
<pre>
|
618
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 361</span>
|
619
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_archive</span>
|
620
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
621
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"assumes hosts a1.v4 -> dell-eth1.v4"</span>
|
622
|
+
<span class="ruby-identifier">uuid</span> = <span class="ruby-value str">"f07f3cb9-b1a0-4840-a7fd-e733c89f303c"</span>
|
623
|
+
|
624
|
+
<span class="ruby-comment cmt"># load it</span>
|
625
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
626
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/proto_arp.xml"</span>))
|
627
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_muapi</span>.<span class="ruby-identifier">new</span>
|
628
|
+
|
629
|
+
<span class="ruby-comment cmt"># run it</span>
|
630
|
+
<span class="ruby-identifier">run_uuid</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">uuid</span>) <span class="ruby-comment cmt"># use the run_uuid for subsequent calls</span>
|
631
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
632
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
633
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"RUNNING"</span>, <span class="ruby-node">"after RUN, expected status=RUNNING, got #{status}"</span>)
|
634
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"RUNNING"</span>
|
635
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
|
636
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
637
|
+
<span class="ruby-keyword kw">end</span>
|
638
|
+
|
639
|
+
<span class="ruby-comment cmt"># archive it</span>
|
640
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">"-c"</span>, <span class="ruby-value str">"run"</span>, <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">run_uuid</span> ]
|
641
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
|
642
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">"-s"</span>, <span class="ruby-value str">"status"</span>, <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">run_uuid</span> ]
|
643
|
+
|
644
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
645
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">"-s"</span>, <span class="ruby-value str">"status"</span>, <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">run_uuid</span> ]
|
646
|
+
<span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
|
647
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
|
648
|
+
<span class="ruby-keyword kw">end</span>
|
649
|
+
|
650
|
+
<span class="ruby-comment cmt"># now get it</span>
|
651
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">"-c"</span>, <span class="ruby-value str">"get"</span>, <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">run_uuid</span> ]
|
652
|
+
<span class="ruby-identifier">file_name</span> = <span class="ruby-identifier">run_uuid</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">".zip"</span>
|
653
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">file_name</span>), <span class="ruby-node">"did not find the expected file #{file_name}"</span>)
|
654
|
+
<span class="ruby-keyword kw">end</span>
|
655
|
+
</pre>
|
656
|
+
</div>
|
657
|
+
</div>
|
658
|
+
</div>
|
659
|
+
|
660
|
+
<div id="method-M000023" class="method-detail">
|
661
|
+
<a name="M000023"></a>
|
662
|
+
|
663
|
+
<div class="method-heading">
|
664
|
+
<a href="#M000023" class="method-signature">
|
665
|
+
<span class="method-name">test_cmd_muapi_capture</span><span class="method-args">()</span>
|
666
|
+
</a>
|
667
|
+
</div>
|
668
|
+
|
669
|
+
<div class="method-description">
|
670
|
+
<p><a class="source-toggle" href="#"
|
671
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
672
|
+
<div class="method-source-code" id="M000023-source">
|
673
|
+
<pre>
|
674
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 284</span>
|
675
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_capture</span>
|
676
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_muapi</span>.<span class="ruby-identifier">new</span>
|
677
|
+
<span class="ruby-identifier">run_args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
678
|
+
<span class="ruby-identifier">run_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-c"</span>
|
679
|
+
<span class="ruby-identifier">run_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"run"</span>
|
680
|
+
<span class="ruby-identifier">run_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-p"</span>
|
681
|
+
<span class="ruby-identifier">run_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"a1"</span>
|
682
|
+
<span class="ruby-identifier">job_id</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_capture</span> <span class="ruby-identifier">run_args</span>
|
683
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
684
|
+
<span class="ruby-identifier">status_args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
685
|
+
<span class="ruby-identifier">status_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-c"</span>
|
686
|
+
<span class="ruby-identifier">status_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"status"</span>
|
687
|
+
<span class="ruby-identifier">status_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-p"</span>
|
688
|
+
<span class="ruby-identifier">status_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"a1"</span>
|
689
|
+
<span class="ruby-identifier">status_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-u"</span>
|
690
|
+
<span class="ruby-identifier">status_args</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">job_id</span>
|
691
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_capture</span> <span class="ruby-identifier">status_args</span>
|
692
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
693
|
+
<span class="ruby-identifier">get_args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
694
|
+
<span class="ruby-identifier">get_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-c"</span>
|
695
|
+
<span class="ruby-identifier">get_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"get"</span>
|
696
|
+
<span class="ruby-identifier">get_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-p"</span>
|
697
|
+
<span class="ruby-identifier">get_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"a1"</span>
|
698
|
+
<span class="ruby-identifier">get_args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-u"</span>
|
699
|
+
<span class="ruby-identifier">get_args</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">job_id</span>
|
700
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_capture</span> <span class="ruby-identifier">get_args</span>
|
701
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
702
|
+
<span class="ruby-identifier">assert</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-node">"#{job_id}.pcap"</span>), <span class="ruby-node">"expected to find #{job_id}.pcap but didn't"</span>)
|
703
|
+
<span class="ruby-keyword kw">end</span>
|
704
|
+
</pre>
|
705
|
+
</div>
|
706
|
+
</div>
|
707
|
+
</div>
|
708
|
+
|
709
|
+
<div id="method-M000027" class="method-detail">
|
710
|
+
<a name="M000027"></a>
|
711
|
+
|
712
|
+
<div class="method-heading">
|
713
|
+
<a href="#M000027" class="method-signature">
|
714
|
+
<span class="method-name">test_cmd_muapi_delete</span><span class="method-args">()</span>
|
715
|
+
</a>
|
716
|
+
</div>
|
717
|
+
|
718
|
+
<div class="method-description">
|
719
|
+
<p>
|
720
|
+
assumes hosts a1.v4 -> dell-eth1.v4
|
721
|
+
</p>
|
722
|
+
<p><a class="source-toggle" href="#"
|
723
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
724
|
+
<div class="method-source-code" id="M000027-source">
|
725
|
+
<pre>
|
726
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 399</span>
|
727
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_delete</span>
|
728
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
729
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"assumes hosts a1.v4 -> dell-eth1.v4"</span>
|
730
|
+
<span class="ruby-identifier">uuid</span> = <span class="ruby-value str">"f07f3cb9-b1a0-4840-a7fd-e733c89f303c"</span>
|
731
|
+
|
732
|
+
<span class="ruby-comment cmt"># load it</span>
|
733
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
734
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/proto_arp.xml"</span>))
|
735
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_muapi</span>.<span class="ruby-identifier">new</span>
|
736
|
+
|
737
|
+
<span class="ruby-comment cmt"># run it</span>
|
738
|
+
<span class="ruby-identifier">run_uuid</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">uuid</span>) <span class="ruby-comment cmt"># use the run_uuid for subsequent calls</span>
|
739
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
740
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
741
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"RUNNING"</span>, <span class="ruby-node">"after RUN, expected status=RUNNING, got #{status}"</span>)
|
742
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"RUNNING"</span>
|
743
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
|
744
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
745
|
+
<span class="ruby-keyword kw">end</span>
|
746
|
+
|
747
|
+
<span class="ruby-comment cmt"># now delete it</span>
|
748
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [ <span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">run_uuid</span> ]
|
749
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">status</span>
|
750
|
+
|
751
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">run_uuid</span>)
|
752
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-node">"expected status=nil, got #{status}"</span>)
|
753
|
+
<span class="ruby-keyword kw">end</span>
|
754
|
+
</pre>
|
755
|
+
</div>
|
756
|
+
</div>
|
757
|
+
</div>
|
758
|
+
|
759
|
+
<div id="method-M000022" class="method-detail">
|
760
|
+
<a name="M000022"></a>
|
761
|
+
|
762
|
+
<div class="method-heading">
|
763
|
+
<a href="#M000022" class="method-signature">
|
764
|
+
<span class="method-name">test_cmd_muapi_export_by_type_and_name</span><span class="method-args">()</span>
|
765
|
+
</a>
|
766
|
+
</div>
|
767
|
+
|
768
|
+
<div class="method-description">
|
769
|
+
<p><a class="source-toggle" href="#"
|
770
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
771
|
+
<div class="method-source-code" id="M000022-source">
|
772
|
+
<pre>
|
773
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 275</span>
|
774
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_export_by_type_and_name</span>
|
775
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_muapi</span>.<span class="ruby-identifier">new</span>
|
776
|
+
<span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">"379a4cf8-8fe7-4d2d-8f6b-b8c6b71557b4"</span> <span class="ruby-comment cmt"># ftp_with_channel</span>
|
777
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
778
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/ftp_with_channel.xml"</span>))
|
779
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_export_by_type_and_name</span>([<span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"ftp_with_channel"</span>, <span class="ruby-value str">"-t"</span>, <span class="ruby-value str">"scenario"</span>]).<span class="ruby-identifier">to_s</span>
|
780
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">scenario_uuid</span>), <span class="ruby-node">"expected #{scenario_uuid} but did not find it"</span>
|
781
|
+
<span class="ruby-keyword kw">end</span>
|
782
|
+
</pre>
|
783
|
+
</div>
|
784
|
+
</div>
|
785
|
+
</div>
|
786
|
+
|
787
|
+
<div id="method-M000021" class="method-detail">
|
788
|
+
<a name="M000021"></a>
|
789
|
+
|
790
|
+
<div class="method-heading">
|
791
|
+
<a href="#M000021" class="method-signature">
|
792
|
+
<span class="method-name">test_cmd_muapi_export_by_uuid</span><span class="method-args">()</span>
|
793
|
+
</a>
|
794
|
+
</div>
|
795
|
+
|
796
|
+
<div class="method-description">
|
797
|
+
<p><a class="source-toggle" href="#"
|
798
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
799
|
+
<div class="method-source-code" id="M000021-source">
|
800
|
+
<pre>
|
801
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 266</span>
|
802
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_export_by_uuid</span>
|
803
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_muapi</span>.<span class="ruby-identifier">new</span>
|
804
|
+
<span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">"379a4cf8-8fe7-4d2d-8f6b-b8c6b71557b4"</span> <span class="ruby-comment cmt"># ftp_with_channel</span>
|
805
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
806
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/ftp_with_channel.xml"</span>))
|
807
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_export_by_uuid</span>([<span class="ruby-value str">"-u"</span>, <span class="ruby-identifier">scenario_uuid</span>]).<span class="ruby-identifier">to_s</span>
|
808
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">scenario_uuid</span>), <span class="ruby-node">"expected #{scenario_uuid} but did not find it"</span>
|
809
|
+
<span class="ruby-keyword kw">end</span>
|
810
|
+
</pre>
|
811
|
+
</div>
|
812
|
+
</div>
|
813
|
+
</div>
|
814
|
+
|
815
|
+
<div id="method-M000020" class="method-detail">
|
816
|
+
<a name="M000020"></a>
|
817
|
+
|
818
|
+
<div class="method-heading">
|
819
|
+
<a href="#M000020" class="method-signature">
|
820
|
+
<span class="method-name">test_cmd_muapi_types</span><span class="method-args">()</span>
|
821
|
+
</a>
|
822
|
+
</div>
|
823
|
+
|
824
|
+
<div class="method-description">
|
825
|
+
<p>
|
826
|
+
————— cmd_muapi ————
|
827
|
+
</p>
|
828
|
+
<p><a class="source-toggle" href="#"
|
829
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
830
|
+
<div class="method-source-code" id="M000020-source">
|
831
|
+
<pre>
|
832
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 260</span>
|
833
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_types</span>
|
834
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_muapi</span>.<span class="ruby-identifier">new</span>
|
835
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_types</span> []
|
836
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"scenario"</span>), <span class="ruby-node">"expected scenario got #{response}"</span>)
|
837
|
+
<span class="ruby-keyword kw">end</span>
|
838
|
+
</pre>
|
839
|
+
</div>
|
840
|
+
</div>
|
841
|
+
</div>
|
842
|
+
|
843
|
+
<div id="method-M000035" class="method-detail">
|
844
|
+
<a name="M000035"></a>
|
845
|
+
|
846
|
+
<div class="method-heading">
|
847
|
+
<a href="#M000035" class="method-signature">
|
848
|
+
<span class="method-name">test_cmd_netconfig_add_modify_delete_route</span><span class="method-args">()</span>
|
849
|
+
</a>
|
850
|
+
</div>
|
851
|
+
|
852
|
+
<div class="method-description">
|
853
|
+
<p><a class="source-toggle" href="#"
|
854
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
855
|
+
<div class="method-source-code" id="M000035-source">
|
856
|
+
<pre>
|
857
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 495</span>
|
858
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_add_modify_delete_route</span>
|
859
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"assumes a1 on 192.168.30.x subnet and a router at 192.168.30.247"</span>
|
860
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
861
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_netconfig</span>.<span class="ruby-identifier">new</span>
|
862
|
+
<span class="ruby-identifier">system</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"system"</span>]
|
863
|
+
<span class="ruby-comment cmt"># delete route if if already existsname"] ==</span>
|
864
|
+
<span class="ruby-keyword kw">begin</span>
|
865
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"routes/192.168.100.0-192.168.30.247-a1"</span>]
|
866
|
+
<span class="ruby-keyword kw">rescue</span>
|
867
|
+
<span class="ruby-comment cmt"># do nothing. route may not exists</span>
|
868
|
+
<span class="ruby-keyword kw">end</span>
|
869
|
+
<span class="ruby-comment cmt"># turn dhcp on</span>
|
870
|
+
<span class="ruby-identifier">dhcp</span> = {<span class="ruby-value str">"name"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"a1"</span>,<span class="ruby-value str">"v4_dhcp"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"Enabled"</span>}
|
871
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">"-j"</span>, <span class="ruby-identifier">dhcp</span>, <span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/a1"</span>]
|
872
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">3</span>
|
873
|
+
<span class="ruby-identifier">g</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/a1"</span>]
|
874
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">g</span>[<span class="ruby-value str">"v4_addrs"</span>][<span class="ruby-value str">"begin"</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"192.168.30"</span>),<span class="ruby-value str">"A1 DHCP failed"</span>)
|
875
|
+
<span class="ruby-identifier">new_route</span> = {<span class="ruby-value str">"interface"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"a1"</span>, <span class="ruby-value str">"dst"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"192.168.100.0"</span>, <span class="ruby-value str">"gateway"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"192.168.30.247"</span>, <span class="ruby-value str">"dst_pfx_len"</span>=<span class="ruby-operator">></span><span class="ruby-value">24</span>}
|
876
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_create</span> [<span class="ruby-value str">"-j"</span>, <span class="ruby-identifier">new_route</span>, <span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"routes"</span>]
|
877
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"192.168.100.0-192.168.30.247-a1 created."</span>), <span class="ruby-identifier">response</span>) <span class="ruby-comment cmt"># not sure what this will be</span>
|
878
|
+
<span class="ruby-identifier">update_mask</span> = {<span class="ruby-value str">"dst_pfx_len"</span>=<span class="ruby-operator">></span><span class="ruby-value">24</span>}
|
879
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">"-j"</span>, <span class="ruby-identifier">update_mask</span>, <span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"routes/192.168.100.0-192.168.30.247-a1"</span>]
|
880
|
+
<span class="ruby-keyword kw">ensure</span>
|
881
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"routes/192.168.100.0-192.168.30.247-a1"</span>]
|
882
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"deleted"</span>),<span class="ruby-identifier">response</span>)
|
883
|
+
<span class="ruby-keyword kw">end</span>
|
884
|
+
</pre>
|
885
|
+
</div>
|
886
|
+
</div>
|
887
|
+
</div>
|
888
|
+
|
889
|
+
<div id="method-M000034" class="method-detail">
|
890
|
+
<a name="M000034"></a>
|
891
|
+
|
892
|
+
<div class="method-heading">
|
893
|
+
<a href="#M000034" class="method-signature">
|
894
|
+
<span class="method-name">test_cmd_netconfig_create_delete_host</span><span class="method-args">()</span>
|
895
|
+
</a>
|
896
|
+
</div>
|
897
|
+
|
898
|
+
<div class="method-description">
|
899
|
+
<p><a class="source-toggle" href="#"
|
900
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
901
|
+
<div class="method-source-code" id="M000034-source">
|
902
|
+
<pre>
|
903
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 486</span>
|
904
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_create_delete_host</span>
|
905
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
906
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_netconfig</span>.<span class="ruby-identifier">new</span>
|
907
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_create</span> [<span class="ruby-value str">"-j"</span>, <span class="ruby-value str">'{"name"=>"deleteme","v4_addr"=>"192.168.30.9"}'</span>, <span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"hosts"</span>]
|
908
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"created"</span>), <span class="ruby-value str">"Failed to create host:"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">to_s</span>)
|
909
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"hosts/deleteme"</span>]
|
910
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"deleted"</span>), <span class="ruby-value str">"Failed to delete host:"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">to_s</span>)
|
911
|
+
<span class="ruby-keyword kw">end</span>
|
912
|
+
</pre>
|
913
|
+
</div>
|
914
|
+
</div>
|
915
|
+
</div>
|
916
|
+
|
917
|
+
<div id="method-M000031" class="method-detail">
|
918
|
+
<a name="M000031"></a>
|
919
|
+
|
920
|
+
<div class="method-heading">
|
921
|
+
<a href="#M000031" class="method-signature">
|
922
|
+
<span class="method-name">test_cmd_netconfig_get_interfaces_a1</span><span class="method-args">()</span>
|
923
|
+
</a>
|
924
|
+
</div>
|
925
|
+
|
926
|
+
<div class="method-description">
|
927
|
+
<p>
|
928
|
+
————— cmd_netfconfig ——-
|
929
|
+
</p>
|
930
|
+
<p><a class="source-toggle" href="#"
|
931
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
932
|
+
<div class="method-source-code" id="M000031-source">
|
933
|
+
<pre>
|
934
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 449</span>
|
935
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_get_interfaces_a1</span>
|
936
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_netconfig</span>.<span class="ruby-identifier">new</span>
|
937
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/a1"</span>]
|
938
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>[<span class="ruby-value str">"display_name"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"A1"</span>, <span class="ruby-node">"expected A1 got #{response["display_name"]}"</span>)
|
939
|
+
<span class="ruby-keyword kw">end</span>
|
940
|
+
</pre>
|
941
|
+
</div>
|
942
|
+
</div>
|
943
|
+
</div>
|
944
|
+
|
945
|
+
<div id="method-M000032" class="method-detail">
|
946
|
+
<a name="M000032"></a>
|
947
|
+
|
948
|
+
<div class="method-heading">
|
949
|
+
<a href="#M000032" class="method-signature">
|
950
|
+
<span class="method-name">test_cmd_netconfig_modify_interfaces_a1</span><span class="method-args">()</span>
|
951
|
+
</a>
|
952
|
+
</div>
|
953
|
+
|
954
|
+
<div class="method-description">
|
955
|
+
<p><a class="source-toggle" href="#"
|
956
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
957
|
+
<div class="method-source-code" id="M000032-source">
|
958
|
+
<pre>
|
959
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 455</span>
|
960
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_modify_interfaces_a1</span>
|
961
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
962
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_netconfig</span>.<span class="ruby-identifier">new</span>
|
963
|
+
<span class="ruby-identifier">saved</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/a1"</span>]
|
964
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">saved</span>[<span class="ruby-value str">"display_name"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"A1"</span>, <span class="ruby-node">"expected A1 got #{saved["display_name"]}"</span>)
|
965
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/a1"</span>, <span class="ruby-value str">"-j"</span>, <span class="ruby-value str">'{"v4_dhcp"=>false}'</span>]
|
966
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
|
967
|
+
<span class="ruby-identifier">modified</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/a1"</span>]
|
968
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">modified</span>[<span class="ruby-value str">"v4_dhcp"</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-value str">"expected dhcp false but it wasn't"</span>)
|
969
|
+
<span class="ruby-keyword kw">ensure</span>
|
970
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/a1"</span>, <span class="ruby-value str">"-j"</span>, <span class="ruby-value str">'{"v4_dhcp"=>true}'</span>]
|
971
|
+
<span class="ruby-keyword kw">end</span>
|
972
|
+
</pre>
|
973
|
+
</div>
|
974
|
+
</div>
|
975
|
+
</div>
|
976
|
+
|
977
|
+
<div id="method-M000036" class="method-detail">
|
978
|
+
<a name="M000036"></a>
|
979
|
+
|
980
|
+
<div class="method-heading">
|
981
|
+
<a href="#M000036" class="method-signature">
|
982
|
+
<span class="method-name">test_cmd_netconfig_resolve_hosts</span><span class="method-args">()</span>
|
983
|
+
</a>
|
984
|
+
</div>
|
985
|
+
|
986
|
+
<div class="method-description">
|
987
|
+
<p><a class="source-toggle" href="#"
|
988
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
989
|
+
<div class="method-source-code" id="M000036-source">
|
990
|
+
<pre>
|
991
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 522</span>
|
992
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_resolve_hosts</span>
|
993
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"assumes the Mu can resolve a host named mrtwig"</span>
|
994
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
995
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_netconfig</span>.<span class="ruby-identifier">new</span>
|
996
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"hosts/mrtwig"</span>] <span class="ruby-comment cmt"># delete it if it exists</span>
|
997
|
+
<span class="ruby-comment cmt"># assert response.include?("deleted"), "expected to find 'deleted' but got #{response}"</span>
|
998
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_resolve_hosts</span> [<span class="ruby-value str">"-n"</span>, <span class="ruby-value str">"mrtwig"</span>]
|
999
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"hosts/mrtwig"</span>]
|
1000
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">response</span>[<span class="ruby-value str">"name"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"mrtwig"</span>, <span class="ruby-node">"expected to find mrtwig but found #{response["name"]}"</span>
|
1001
|
+
<span class="ruby-keyword kw">end</span>
|
1002
|
+
</pre>
|
1003
|
+
</div>
|
1004
|
+
</div>
|
1005
|
+
</div>
|
1006
|
+
|
1007
|
+
<div id="method-M000037" class="method-detail">
|
1008
|
+
<a name="M000037"></a>
|
1009
|
+
|
1010
|
+
<div class="method-heading">
|
1011
|
+
<a href="#M000037" class="method-signature">
|
1012
|
+
<span class="method-name">test_cmd_netconfig_save</span><span class="method-args">()</span>
|
1013
|
+
</a>
|
1014
|
+
</div>
|
1015
|
+
|
1016
|
+
<div class="method-description">
|
1017
|
+
<p><a class="source-toggle" href="#"
|
1018
|
+
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
1019
|
+
<div class="method-source-code" id="M000037-source">
|
1020
|
+
<pre>
|
1021
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 533</span>
|
1022
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_save</span>
|
1023
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
1024
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_netconfig</span>.<span class="ruby-identifier">new</span>
|
1025
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"save.json"</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">"save.json"</span>)
|
1026
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_save</span> [<span class="ruby-value str">"-f"</span>, <span class="ruby-value str">"save.json"</span>]
|
1027
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">"save.json"</span>), <span class="ruby-value str">"wxpected for find file 'save.json but did not"</span>)
|
1028
|
+
<span class="ruby-keyword kw">ensure</span>
|
1029
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"save.json"</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">"save.json"</span>)
|
1030
|
+
<span class="ruby-keyword kw">end</span>
|
1031
|
+
</pre>
|
1032
|
+
</div>
|
1033
|
+
</div>
|
1034
|
+
</div>
|
1035
|
+
|
1036
|
+
<div id="method-M000033" class="method-detail">
|
1037
|
+
<a name="M000033"></a>
|
1038
|
+
|
1039
|
+
<div class="method-heading">
|
1040
|
+
<a href="#M000033" class="method-signature">
|
1041
|
+
<span class="method-name">test_cmd_netconfig_vlans</span><span class="method-args">()</span>
|
1042
|
+
</a>
|
1043
|
+
</div>
|
1044
|
+
|
1045
|
+
<div class="method-description">
|
1046
|
+
<p><a class="source-toggle" href="#"
|
1047
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
1048
|
+
<div class="method-source-code" id="M000033-source">
|
1049
|
+
<pre>
|
1050
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 468</span>
|
1051
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_vlans</span>
|
1052
|
+
<span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
|
1053
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_netconfig</span>.<span class="ruby-identifier">new</span>
|
1054
|
+
<span class="ruby-keyword kw">begin</span>
|
1055
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/b1.222"</span>]
|
1056
|
+
<span class="ruby-keyword kw">rescue</span>
|
1057
|
+
<span class="ruby-comment cmt"># ignore. the vlan probably did not exist</span>
|
1058
|
+
<span class="ruby-keyword kw">end</span>
|
1059
|
+
<span class="ruby-identifier">vlan_222</span> = {<span class="ruby-value str">"v4_addrs"</span>=<span class="ruby-operator">></span>[<span class="ruby-value str">"2.2.2.2"</span>],<span class="ruby-value str">"v4_mask"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"26"</span>,<span class="ruby-value str">"v6_addrs"</span>=<span class="ruby-operator">></span>[<span class="ruby-value str">"2222:0:0:0:0:0:0:2"</span>],<span class="ruby-value str">"v6_mask"</span>=<span class="ruby-operator">></span><span class="ruby-value str">"64"</span>}
|
1060
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_create</span> [<span class="ruby-value str">"-j"</span>, <span class="ruby-value str">'{"name"=>"b1","vlan"=>"222"}'</span>, <span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces"</span> ]
|
1061
|
+
<span class="ruby-identifier">sleep</span> <span class="ruby-value">3</span>
|
1062
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [ <span class="ruby-value str">"-j"</span>, <span class="ruby-identifier">vlan_222</span>, <span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/b1.222"</span>]
|
1063
|
+
<span class="ruby-identifier">b1</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/b1.222"</span>]
|
1064
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">b1</span>[<span class="ruby-value str">"v4_addrs"</span>][<span class="ruby-value str">"begin"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"2.2.2.2"</span>,<span class="ruby-node">"vlan v4_addrs incorrect: #{b1["v4_addrs"]["begin"]}"</span>)
|
1065
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">"-e"</span>, <span class="ruby-value str">"interfaces/b1.222"</span>]
|
1066
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"deleted"</span>), <span class="ruby-value str">"Failed to delete host:"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">response</span>)
|
1067
|
+
<span class="ruby-keyword kw">end</span>
|
1068
|
+
</pre>
|
1069
|
+
</div>
|
1070
|
+
</div>
|
1071
|
+
</div>
|
1072
|
+
|
1073
|
+
<div id="method-M000040" class="method-detail">
|
1074
|
+
<a name="M000040"></a>
|
1075
|
+
|
1076
|
+
<div class="method-heading">
|
1077
|
+
<a href="#M000040" class="method-signature">
|
1078
|
+
<span class="method-name">test_cmd_runscale_run_dir</span><span class="method-args">()</span>
|
1079
|
+
</a>
|
1080
|
+
</div>
|
1081
|
+
|
1082
|
+
<div class="method-description">
|
1083
|
+
<p>
|
1084
|
+
use ip range setting and a brief pattern
|
1085
|
+
</p>
|
1086
|
+
<p><a class="source-toggle" href="#"
|
1087
|
+
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
|
1088
|
+
<div class="method-source-code" id="M000040-source">
|
1089
|
+
<pre>
|
1090
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 573</span>
|
1091
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runscale_run_dir</span>
|
1092
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"app_id_status.json"</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">"app_id_status.json"</span>)
|
1093
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_runscale</span>.<span class="ruby-identifier">new</span>
|
1094
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
1095
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-d"</span>
|
1096
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{Dir.pwd}/test/data"</span>
|
1097
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-i"</span>
|
1098
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"b1-10000,b2"</span>
|
1099
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-p"</span>
|
1100
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"1-100:10"</span>
|
1101
|
+
<span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_dir</span> <span class="ruby-identifier">args</span>
|
1102
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">"app_id_status.json"</span>), <span class="ruby-value str">"app_id_status.json file was not created"</span>)
|
1103
|
+
<span class="ruby-identifier">j</span> = <span class="ruby-constant">JSON</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value str">"app_id_status.json"</span>)
|
1104
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">"status"</span>]
|
1105
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"duration"</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">>=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">"expected summary duration > 10, but got #{status["statistics"]["summary"]["duration"]}"</span>)
|
1106
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"instances"</span>][<span class="ruby-value str">"executed"</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">></span> <span class="ruby-value">10</span>, <span class="ruby-node">"expected instances executed > 0, but got #{status["statistics"]["summary"]["instances"]["executed"]}"</span>)
|
1107
|
+
<span class="ruby-keyword kw">end</span>
|
1108
|
+
</pre>
|
1109
|
+
</div>
|
1110
|
+
</div>
|
1111
|
+
</div>
|
1112
|
+
|
1113
|
+
<div id="method-M000039" class="method-detail">
|
1114
|
+
<a name="M000039"></a>
|
1115
|
+
|
1116
|
+
<div class="method-heading">
|
1117
|
+
<a href="#M000039" class="method-signature">
|
1118
|
+
<span class="method-name">test_cmd_runscale_run_file</span><span class="method-args">()</span>
|
1119
|
+
</a>
|
1120
|
+
</div>
|
1121
|
+
|
1122
|
+
<div class="method-description">
|
1123
|
+
<p>
|
1124
|
+
use ip range setting and a brief pattern
|
1125
|
+
</p>
|
1126
|
+
<p><a class="source-toggle" href="#"
|
1127
|
+
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
1128
|
+
<div class="method-source-code" id="M000039-source">
|
1129
|
+
<pre>
|
1130
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 554</span>
|
1131
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runscale_run_file</span>
|
1132
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"app_id_status.json"</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">"app_id_status.json"</span>)
|
1133
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_runscale</span>.<span class="ruby-identifier">new</span>
|
1134
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
1135
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-s"</span>
|
1136
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{Dir.pwd}/test/data/data_cgi.msl"</span>
|
1137
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-i"</span>
|
1138
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"b1-10000,b2"</span>
|
1139
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-p"</span>
|
1140
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"1-100:10"</span>
|
1141
|
+
<span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_file</span> <span class="ruby-identifier">args</span>
|
1142
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">"app_id_status.json"</span>), <span class="ruby-value str">"app_id_status.json file was not created"</span>)
|
1143
|
+
<span class="ruby-identifier">j</span> = <span class="ruby-constant">JSON</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value str">"app_id_status.json"</span>)
|
1144
|
+
<span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">"status"</span>]
|
1145
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"duration"</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">>=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">"expected summary duration > 10, but got #{status["statistics"]["summary"]["duration"]}"</span>)
|
1146
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">"statistics"</span>][<span class="ruby-value str">"summary"</span>][<span class="ruby-value str">"instances"</span>][<span class="ruby-value str">"executed"</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">></span> <span class="ruby-value">10</span>, <span class="ruby-node">"expected instances executed > 0, but got #{status["statistics"]["summary"]["instances"]["executed"]}"</span>)
|
1147
|
+
<span class="ruby-keyword kw">end</span>
|
1148
|
+
</pre>
|
1149
|
+
</div>
|
1150
|
+
</div>
|
1151
|
+
</div>
|
1152
|
+
|
1153
|
+
<div id="method-M000041" class="method-detail">
|
1154
|
+
<a name="M000041"></a>
|
1155
|
+
|
1156
|
+
<div class="method-heading">
|
1157
|
+
<a href="#M000041" class="method-signature">
|
1158
|
+
<span class="method-name">test_cmd_runscenario</span><span class="method-args">()</span>
|
1159
|
+
</a>
|
1160
|
+
</div>
|
1161
|
+
|
1162
|
+
<div class="method-description">
|
1163
|
+
<p>
|
1164
|
+
————— cmd_runscenario ———-
|
1165
|
+
</p>
|
1166
|
+
<p><a class="source-toggle" href="#"
|
1167
|
+
onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
|
1168
|
+
<div class="method-source-code" id="M000041-source">
|
1169
|
+
<pre>
|
1170
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 594</span>
|
1171
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runscenario</span>
|
1172
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_runscenario</span>.<span class="ruby-identifier">new</span>
|
1173
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
1174
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-s"</span>
|
1175
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{Dir.pwd}/test/data/data_cgi.xml"</span>
|
1176
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-i"</span>
|
1177
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"b1,b2"</span>
|
1178
|
+
<span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">args</span>
|
1179
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>, <span class="ruby-node">"expected 0 errors but got #{app.errors}"</span>)
|
1180
|
+
<span class="ruby-keyword kw">end</span>
|
1181
|
+
</pre>
|
1182
|
+
</div>
|
1183
|
+
</div>
|
1184
|
+
</div>
|
1185
|
+
|
1186
|
+
<div id="method-M000042" class="method-detail">
|
1187
|
+
<a name="M000042"></a>
|
1188
|
+
|
1189
|
+
<div class="method-heading">
|
1190
|
+
<a href="#M000042" class="method-signature">
|
1191
|
+
<span class="method-name">test_cmd_runverify</span><span class="method-args">()</span>
|
1192
|
+
</a>
|
1193
|
+
</div>
|
1194
|
+
|
1195
|
+
<div class="method-description">
|
1196
|
+
<p>
|
1197
|
+
————— cmd_runverify
|
1198
|
+
————
|
1199
|
+
</p>
|
1200
|
+
<p><a class="source-toggle" href="#"
|
1201
|
+
onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
|
1202
|
+
<div class="method-source-code" id="M000042-source">
|
1203
|
+
<pre>
|
1204
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 608</span>
|
1205
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runverify</span>
|
1206
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_runverify</span>.<span class="ruby-identifier">new</span>
|
1207
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
1208
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-s"</span>
|
1209
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{Dir.pwd}/test/data/data_cgi.xml"</span>
|
1210
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-t"</span>
|
1211
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{Dir.pwd}/test/data/test_data_cgi_error.xml"</span>
|
1212
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-i"</span>
|
1213
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"b1,b2"</span>
|
1214
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-v"</span>
|
1215
|
+
<span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">args</span>
|
1216
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>, <span class="ruby-value str">"expected errors but got none"</span>)
|
1217
|
+
<span class="ruby-keyword kw">end</span>
|
1218
|
+
</pre>
|
1219
|
+
</div>
|
1220
|
+
</div>
|
1221
|
+
</div>
|
1222
|
+
|
1223
|
+
<div id="method-M000048" class="method-detail">
|
1224
|
+
<a name="M000048"></a>
|
1225
|
+
|
1226
|
+
<div class="method-heading">
|
1227
|
+
<a href="#M000048" class="method-signature">
|
1228
|
+
<span class="method-name">test_cmd_system_status</span><span class="method-args">()</span>
|
1229
|
+
</a>
|
1230
|
+
</div>
|
1231
|
+
|
1232
|
+
<div class="method-description">
|
1233
|
+
<p>
|
1234
|
+
do NOT write a test for cmd_system:restart please!
|
1235
|
+
</p>
|
1236
|
+
<p><a class="source-toggle" href="#"
|
1237
|
+
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
|
1238
|
+
<div class="method-source-code" id="M000048-source">
|
1239
|
+
<pre>
|
1240
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 668</span>
|
1241
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_system_status</span>
|
1242
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_system</span>.<span class="ruby-identifier">new</span>
|
1243
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> []
|
1244
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">result</span>)
|
1245
|
+
<span class="ruby-identifier">ports</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//ports"</span>)
|
1246
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">ports</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">>=</span> <span class="ruby-value">5</span>, <span class="ruby-node">"expected to find at least 5 ports, but got #{ports.length}"</span>)
|
1247
|
+
<span class="ruby-keyword kw">end</span>
|
1248
|
+
</pre>
|
1249
|
+
</div>
|
1250
|
+
</div>
|
1251
|
+
</div>
|
1252
|
+
|
1253
|
+
<div id="method-M000049" class="method-detail">
|
1254
|
+
<a name="M000049"></a>
|
1255
|
+
|
1256
|
+
<div class="method-heading">
|
1257
|
+
<a href="#M000049" class="method-signature">
|
1258
|
+
<span class="method-name">test_cmd_system_status2</span><span class="method-args">()</span>
|
1259
|
+
</a>
|
1260
|
+
</div>
|
1261
|
+
|
1262
|
+
<div class="method-description">
|
1263
|
+
<p><a class="source-toggle" href="#"
|
1264
|
+
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
1265
|
+
<div class="method-source-code" id="M000049-source">
|
1266
|
+
<pre>
|
1267
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 676</span>
|
1268
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_system_status2</span>
|
1269
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_system</span>.<span class="ruby-identifier">new</span>
|
1270
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status2</span> []
|
1271
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"raid"</span>), <span class="ruby-node">"expected to find 'raid' in results, but got #{result}"</span>)
|
1272
|
+
<span class="ruby-keyword kw">end</span>
|
1273
|
+
</pre>
|
1274
|
+
</div>
|
1275
|
+
</div>
|
1276
|
+
</div>
|
1277
|
+
|
1278
|
+
<div id="method-M000013" class="method-detail">
|
1279
|
+
<a name="M000013"></a>
|
1280
|
+
|
1281
|
+
<div class="method-heading">
|
1282
|
+
<a href="#M000013" class="method-signature">
|
1283
|
+
<span class="method-name">test_ddt_close_all_sessions</span><span class="method-args">()</span>
|
1284
|
+
</a>
|
1285
|
+
</div>
|
1286
|
+
|
1287
|
+
<div class="method-description">
|
1288
|
+
<p><a class="source-toggle" href="#"
|
1289
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
1290
|
+
<div class="method-source-code" id="M000013-source">
|
1291
|
+
<pre>
|
1292
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 194</span>
|
1293
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_close_all_sessions</span>
|
1294
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Ddt</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>)
|
1295
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
|
1296
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
|
1297
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
|
1298
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">close_all_sessions</span>
|
1299
|
+
<span class="ruby-identifier">sessions</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">get_all_sessions</span>)
|
1300
|
+
<span class="ruby-identifier">sess</span> = <span class="ruby-identifier">sessions</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//session"</span>)
|
1301
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">sess</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>, <span class="ruby-node">"expected 0 sessions, got #{sess.length}"</span>)
|
1302
|
+
<span class="ruby-keyword kw">end</span>
|
1303
|
+
</pre>
|
1304
|
+
</div>
|
1305
|
+
</div>
|
1306
|
+
</div>
|
1307
|
+
|
1308
|
+
<div id="method-M000012" class="method-detail">
|
1309
|
+
<a name="M000012"></a>
|
1310
|
+
|
1311
|
+
<div class="method-heading">
|
1312
|
+
<a href="#M000012" class="method-signature">
|
1313
|
+
<span class="method-name">test_ddt_get_all_sessions</span><span class="method-args">()</span>
|
1314
|
+
</a>
|
1315
|
+
</div>
|
1316
|
+
|
1317
|
+
<div class="method-description">
|
1318
|
+
<p><a class="source-toggle" href="#"
|
1319
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
1320
|
+
<div class="method-source-code" id="M000012-source">
|
1321
|
+
<pre>
|
1322
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 183</span>
|
1323
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_get_all_sessions</span>
|
1324
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Ddt</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>)
|
1325
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
|
1326
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
|
1327
|
+
<span class="ruby-identifier">sessions</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">get_all_sessions</span>)
|
1328
|
+
<span class="ruby-identifier">sess</span> = <span class="ruby-identifier">sessions</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//session"</span>)
|
1329
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">sess</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span>, <span class="ruby-node">"expected 2 sessions, got #{sess.length}"</span>)
|
1330
|
+
<span class="ruby-keyword kw">ensure</span>
|
1331
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">close_all_sessions</span>
|
1332
|
+
<span class="ruby-keyword kw">end</span>
|
1333
|
+
</pre>
|
1334
|
+
</div>
|
1335
|
+
</div>
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
<div id="method-M000011" class="method-detail">
|
1339
|
+
<a name="M000011"></a>
|
1340
|
+
|
1341
|
+
<div class="method-heading">
|
1342
|
+
<a href="#M000011" class="method-signature">
|
1343
|
+
<span class="method-name">test_ddt_new</span><span class="method-args">()</span>
|
1344
|
+
</a>
|
1345
|
+
</div>
|
1346
|
+
|
1347
|
+
<div class="method-description">
|
1348
|
+
<p>
|
1349
|
+
————— ddt
|
1350
|
+
——————
|
1351
|
+
</p>
|
1352
|
+
<p><a class="source-toggle" href="#"
|
1353
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
1354
|
+
<div class="method-source-code" id="M000011-source">
|
1355
|
+
<pre>
|
1356
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 177</span>
|
1357
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_new</span>
|
1358
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Ddt</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>)
|
1359
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@mu_ip</span>, <span class="ruby-value str">"failed to set mu_ip"</span>)
|
1360
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">docroot</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"/api/v5/ddt/"</span>, <span class="ruby-value str">"failed to set docroot"</span>)
|
1361
|
+
<span class="ruby-keyword kw">end</span>
|
1362
|
+
</pre>
|
1363
|
+
</div>
|
1364
|
+
</div>
|
1365
|
+
</div>
|
1366
|
+
|
1367
|
+
<div id="method-M000014" class="method-detail">
|
1368
|
+
<a name="M000014"></a>
|
1369
|
+
|
1370
|
+
<div class="method-heading">
|
1371
|
+
<a href="#M000014" class="method-signature">
|
1372
|
+
<span class="method-name">test_ddt_set_hosts</span><span class="method-args">()</span>
|
1373
|
+
</a>
|
1374
|
+
</div>
|
1375
|
+
|
1376
|
+
<div class="method-description">
|
1377
|
+
<p><a class="source-toggle" href="#"
|
1378
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
1379
|
+
<div class="method-source-code" id="M000014-source">
|
1380
|
+
<pre>
|
1381
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 205</span>
|
1382
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_set_hosts</span>
|
1383
|
+
<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>
|
1384
|
+
<span class="ruby-identifier">data_cgi_uuid</span> = <span class="ruby-value str">"ef6fe3eb-4e9f-44b5-a99e-c431d82e4eeb"</span>
|
1385
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Ddt</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>)
|
1386
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
|
1387
|
+
<span class="ruby-identifier">http_helper</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">HttpHelper</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>, <span class="ruby-value str">"/api/v3/"</span>)
|
1388
|
+
<span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">"templates/import"</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{Dir.pwd}/test/data/data_cgi.xml"</span>))
|
1389
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">load_scenario</span>(<span class="ruby-identifier">data_cgi_uuid</span>)
|
1390
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">setup_test</span>
|
1391
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">set_hosts</span>( [<span class="ruby-value str">"192.168.40.217"</span>,<span class="ruby-value str">"192.168.40.9"</span>], [<span class="ruby-value str">"a1"</span>, <span class="ruby-value str">"dell-eth1"</span>] )
|
1392
|
+
<span class="ruby-identifier">response</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">resp</span> <span class="ruby-operator">|</span>
|
1393
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">resp</span>)
|
1394
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">"//message"</span>).<span class="ruby-identifier">text</span>
|
1395
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"Bind host successfully"</span>) , <span class="ruby-node">"expected 'Bind host successfully' but got #{message}"</span>
|
1396
|
+
<span class="ruby-keyword kw">end</span>
|
1397
|
+
<span class="ruby-keyword kw">ensure</span>
|
1398
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">close_all_sessions</span>
|
1399
|
+
<span class="ruby-keyword kw">end</span>
|
1400
|
+
</pre>
|
1401
|
+
</div>
|
1402
|
+
</div>
|
1403
|
+
</div>
|
1404
|
+
|
1405
|
+
<div id="method-M000017" class="method-detail">
|
1406
|
+
<a name="M000017"></a>
|
1407
|
+
|
1408
|
+
<div class="method-heading">
|
1409
|
+
<a href="#M000017" class="method-signature">
|
1410
|
+
<span class="method-name">test_homepage_all</span><span class="method-args">()</span>
|
1411
|
+
</a>
|
1412
|
+
</div>
|
1413
|
+
|
1414
|
+
<div class="method-description">
|
1415
|
+
<p><a class="source-toggle" href="#"
|
1416
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
1417
|
+
<div class="method-source-code" id="M000017-source">
|
1418
|
+
<pre>
|
1419
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 238</span>
|
1420
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_all</span>
|
1421
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_homepage</span>.<span class="ruby-identifier">new</span>
|
1422
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">JSON</span> <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_all</span> []
|
1423
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-operator">!</span><span class="ruby-identifier">result</span>[<span class="ruby-value str">"status"</span>].<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">"expected to find a status field but didn't"</span>
|
1424
|
+
<span class="ruby-keyword kw">end</span>
|
1425
|
+
</pre>
|
1426
|
+
</div>
|
1427
|
+
</div>
|
1428
|
+
</div>
|
1429
|
+
|
1430
|
+
<div id="method-M000018" class="method-detail">
|
1431
|
+
<a name="M000018"></a>
|
1432
|
+
|
1433
|
+
<div class="method-heading">
|
1434
|
+
<a href="#M000018" class="method-signature">
|
1435
|
+
<span class="method-name">test_homepage_latest_test</span><span class="method-args">()</span>
|
1436
|
+
</a>
|
1437
|
+
</div>
|
1438
|
+
|
1439
|
+
<div class="method-description">
|
1440
|
+
<p><a class="source-toggle" href="#"
|
1441
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
1442
|
+
<div class="method-source-code" id="M000018-source">
|
1443
|
+
<pre>
|
1444
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 244</span>
|
1445
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_latest_test</span>
|
1446
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_homepage</span>.<span class="ruby-identifier">new</span>
|
1447
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">JSON</span> <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_latest_test</span> []
|
1448
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-operator">!</span><span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">"expected to get something back but didn't"</span>
|
1449
|
+
<span class="ruby-keyword kw">end</span>
|
1450
|
+
</pre>
|
1451
|
+
</div>
|
1452
|
+
</div>
|
1453
|
+
</div>
|
1454
|
+
|
1455
|
+
<div id="method-M000019" class="method-detail">
|
1456
|
+
<a name="M000019"></a>
|
1457
|
+
|
1458
|
+
<div class="method-heading">
|
1459
|
+
<a href="#M000019" class="method-signature">
|
1460
|
+
<span class="method-name">test_homepage_new</span><span class="method-args">()</span>
|
1461
|
+
</a>
|
1462
|
+
</div>
|
1463
|
+
|
1464
|
+
<div class="method-description">
|
1465
|
+
<p>
|
1466
|
+
————— homepage ————-
|
1467
|
+
</p>
|
1468
|
+
<p><a class="source-toggle" href="#"
|
1469
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
1470
|
+
<div class="method-source-code" id="M000019-source">
|
1471
|
+
<pre>
|
1472
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 252</span>
|
1473
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_new</span>
|
1474
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Homepage</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>)
|
1475
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@mu_ip</span>, <span class="ruby-value str">"failed to set mu_ip"</span>)
|
1476
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">docroot</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"/api/v5/homepage/"</span>, <span class="ruby-value str">"failed to set docroot"</span>)
|
1477
|
+
<span class="ruby-keyword kw">end</span>
|
1478
|
+
</pre>
|
1479
|
+
</div>
|
1480
|
+
</div>
|
1481
|
+
</div>
|
1482
|
+
|
1483
|
+
<div id="method-M000016" class="method-detail">
|
1484
|
+
<a name="M000016"></a>
|
1485
|
+
|
1486
|
+
<div class="method-heading">
|
1487
|
+
<a href="#M000016" class="method-signature">
|
1488
|
+
<span class="method-name">test_homepage_recent</span><span class="method-args">()</span>
|
1489
|
+
</a>
|
1490
|
+
</div>
|
1491
|
+
|
1492
|
+
<div class="method-description">
|
1493
|
+
<p><a class="source-toggle" href="#"
|
1494
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
1495
|
+
<div class="method-source-code" id="M000016-source">
|
1496
|
+
<pre>
|
1497
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 232</span>
|
1498
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_recent</span>
|
1499
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_homepage</span>.<span class="ruby-identifier">new</span>
|
1500
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">JSON</span> <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_recent</span> []
|
1501
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-operator">!</span><span class="ruby-identifier">result</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">"summary"</span>].<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">"expected to find a summary field but didn't"</span>
|
1502
|
+
<span class="ruby-keyword kw">end</span>
|
1503
|
+
</pre>
|
1504
|
+
</div>
|
1505
|
+
</div>
|
1506
|
+
</div>
|
1507
|
+
|
1508
|
+
<div id="method-M000015" class="method-detail">
|
1509
|
+
<a name="M000015"></a>
|
1510
|
+
|
1511
|
+
<div class="method-heading">
|
1512
|
+
<a href="#M000015" class="method-signature">
|
1513
|
+
<span class="method-name">test_homepage_status</span><span class="method-args">()</span>
|
1514
|
+
</a>
|
1515
|
+
</div>
|
1516
|
+
|
1517
|
+
<div class="method-description">
|
1518
|
+
<p>
|
1519
|
+
————— cmd_homepage
|
1520
|
+
————-
|
1521
|
+
</p>
|
1522
|
+
<p><a class="source-toggle" href="#"
|
1523
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
1524
|
+
<div class="method-source-code" id="M000015-source">
|
1525
|
+
<pre>
|
1526
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 226</span>
|
1527
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_status</span>
|
1528
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span><span class="ruby-operator">::</span><span class="ruby-constant">Cmd_homepage</span>.<span class="ruby-identifier">new</span>
|
1529
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">JSON</span> <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> []
|
1530
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">"title"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"Licenses"</span>, <span class="ruby-value str">"expected 'Licenses'"</span>
|
1531
|
+
<span class="ruby-keyword kw">end</span>
|
1532
|
+
</pre>
|
1533
|
+
</div>
|
1534
|
+
</div>
|
1535
|
+
</div>
|
1536
|
+
|
1537
|
+
<div id="method-M000029" class="method-detail">
|
1538
|
+
<a name="M000029"></a>
|
1539
|
+
|
1540
|
+
<div class="method-heading">
|
1541
|
+
<a href="#M000029" class="method-signature">
|
1542
|
+
<span class="method-name">test_muapi_list_by_status</span><span class="method-args">()</span>
|
1543
|
+
</a>
|
1544
|
+
</div>
|
1545
|
+
|
1546
|
+
<div class="method-description">
|
1547
|
+
<p><a class="source-toggle" href="#"
|
1548
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
1549
|
+
<div class="method-source-code" id="M000029-source">
|
1550
|
+
<pre>
|
1551
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 435</span>
|
1552
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_muapi_list_by_status</span>
|
1553
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Muapi</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>)
|
1554
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">list_by_status</span>(<span class="ruby-value str">"finished"</span>)
|
1555
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-operator">!</span><span class="ruby-identifier">response</span>.<span class="ruby-identifier">empty?</span>, <span class="ruby-value str">"got empty response"</span>)
|
1556
|
+
<span class="ruby-keyword kw">end</span>
|
1557
|
+
</pre>
|
1558
|
+
</div>
|
1559
|
+
</div>
|
1560
|
+
</div>
|
1561
|
+
|
1562
|
+
<div id="method-M000028" class="method-detail">
|
1563
|
+
<a name="M000028"></a>
|
1564
|
+
|
1565
|
+
<div class="method-heading">
|
1566
|
+
<a href="#M000028" class="method-signature">
|
1567
|
+
<span class="method-name">test_muapi_new</span><span class="method-args">()</span>
|
1568
|
+
</a>
|
1569
|
+
</div>
|
1570
|
+
|
1571
|
+
<div class="method-description">
|
1572
|
+
<p>
|
1573
|
+
————— muapi
|
1574
|
+
—————-
|
1575
|
+
</p>
|
1576
|
+
<p><a class="source-toggle" href="#"
|
1577
|
+
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
1578
|
+
<div class="method-source-code" id="M000028-source">
|
1579
|
+
<pre>
|
1580
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 429</span>
|
1581
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_muapi_new</span>
|
1582
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Muapi</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>)
|
1583
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@mu_ip</span>, <span class="ruby-value str">"failed to set mu_ip"</span>)
|
1584
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">docroot</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"/api/v3/"</span>, <span class="ruby-value str">"failed to set docroot"</span>)
|
1585
|
+
<span class="ruby-keyword kw">end</span>
|
1586
|
+
</pre>
|
1587
|
+
</div>
|
1588
|
+
</div>
|
1589
|
+
</div>
|
1590
|
+
|
1591
|
+
<div id="method-M000030" class="method-detail">
|
1592
|
+
<a name="M000030"></a>
|
1593
|
+
|
1594
|
+
<div class="method-heading">
|
1595
|
+
<a href="#M000030" class="method-signature">
|
1596
|
+
<span class="method-name">test_muapi_types</span><span class="method-args">()</span>
|
1597
|
+
</a>
|
1598
|
+
</div>
|
1599
|
+
|
1600
|
+
<div class="method-description">
|
1601
|
+
<p><a class="source-toggle" href="#"
|
1602
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
1603
|
+
<div class="method-source-code" id="M000030-source">
|
1604
|
+
<pre>
|
1605
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 441</span>
|
1606
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_muapi_types</span>
|
1607
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Muapi</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>)
|
1608
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">types</span>
|
1609
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"scenario"</span>), <span class="ruby-node">"expected scenario, got\n#{response}"</span>)
|
1610
|
+
<span class="ruby-keyword kw">end</span>
|
1611
|
+
</pre>
|
1612
|
+
</div>
|
1613
|
+
</div>
|
1614
|
+
</div>
|
1615
|
+
|
1616
|
+
<div id="method-M000038" class="method-detail">
|
1617
|
+
<a name="M000038"></a>
|
1618
|
+
|
1619
|
+
<div class="method-heading">
|
1620
|
+
<a href="#M000038" class="method-signature">
|
1621
|
+
<span class="method-name">test_netconfig_new</span><span class="method-args">()</span>
|
1622
|
+
</a>
|
1623
|
+
</div>
|
1624
|
+
|
1625
|
+
<div class="method-description">
|
1626
|
+
<p>
|
1627
|
+
————— netconfig ————
|
1628
|
+
</p>
|
1629
|
+
<p><a class="source-toggle" href="#"
|
1630
|
+
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
1631
|
+
<div class="method-source-code" id="M000038-source">
|
1632
|
+
<pre>
|
1633
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 545</span>
|
1634
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_netconfig_new</span>
|
1635
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Netconfig</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>)
|
1636
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@mu_ip</span>, <span class="ruby-value str">"failed to set mu_ip"</span>)
|
1637
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">docroot</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"/restlet/netconfig/"</span>, <span class="ruby-value str">"failed to set docroot"</span>)
|
1638
|
+
<span class="ruby-keyword kw">end</span>
|
1639
|
+
</pre>
|
1640
|
+
</div>
|
1641
|
+
</div>
|
1642
|
+
</div>
|
1643
|
+
|
1644
|
+
<div id="method-M000044" class="method-detail">
|
1645
|
+
<a name="M000044"></a>
|
1646
|
+
|
1647
|
+
<div class="method-heading">
|
1648
|
+
<a href="#M000044" class="method-signature">
|
1649
|
+
<span class="method-name">test_scale_about</span><span class="method-args">()</span>
|
1650
|
+
</a>
|
1651
|
+
</div>
|
1652
|
+
|
1653
|
+
<div class="method-description">
|
1654
|
+
<p><a class="source-toggle" href="#"
|
1655
|
+
onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
|
1656
|
+
<div class="method-source-code" id="M000044-source">
|
1657
|
+
<pre>
|
1658
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 632</span>
|
1659
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_about</span>
|
1660
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</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>)
|
1661
|
+
<span class="ruby-identifier">about</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">about</span>
|
1662
|
+
<span class="ruby-comment cmt"># puts JSON.pretty_generate about</span>
|
1663
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">about</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">"group"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"active"</span>, <span class="ruby-node">"expected 'active' group, got #{about[0]["group"]}"</span>)
|
1664
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">about</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">"type"</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"bot"</span>, <span class="ruby-node">"expected 'bot' type, got #{about[0]["type"]}"</span>)
|
1665
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-operator">!</span><span class="ruby-identifier">api</span>.<span class="ruby-identifier">uuid</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">"uuid is nil"</span>)
|
1666
|
+
<span class="ruby-keyword kw">end</span>
|
1667
|
+
</pre>
|
1668
|
+
</div>
|
1669
|
+
</div>
|
1670
|
+
</div>
|
1671
|
+
|
1672
|
+
<div id="method-M000045" class="method-detail">
|
1673
|
+
<a name="M000045"></a>
|
1674
|
+
|
1675
|
+
<div class="method-heading">
|
1676
|
+
<a href="#M000045" class="method-signature">
|
1677
|
+
<span class="method-name">test_scale_list</span><span class="method-args">()</span>
|
1678
|
+
</a>
|
1679
|
+
</div>
|
1680
|
+
|
1681
|
+
<div class="method-description">
|
1682
|
+
<p><a class="source-toggle" href="#"
|
1683
|
+
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
|
1684
|
+
<div class="method-source-code" id="M000045-source">
|
1685
|
+
<pre>
|
1686
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 641</span>
|
1687
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_list</span>
|
1688
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</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>)
|
1689
|
+
<span class="ruby-identifier">list</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">list</span>
|
1690
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> , <span class="ruby-node">"expected list of length 1, got #{list.length}"</span>)
|
1691
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-operator">!</span><span class="ruby-identifier">api</span>.<span class="ruby-identifier">uuid</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">"uuid is nil"</span>)
|
1692
|
+
<span class="ruby-keyword kw">end</span>
|
1693
|
+
</pre>
|
1694
|
+
</div>
|
1695
|
+
</div>
|
1696
|
+
</div>
|
1697
|
+
|
1698
|
+
<div id="method-M000043" class="method-detail">
|
1699
|
+
<a name="M000043"></a>
|
1700
|
+
|
1701
|
+
<div class="method-heading">
|
1702
|
+
<a href="#M000043" class="method-signature">
|
1703
|
+
<span class="method-name">test_scale_new</span><span class="method-args">()</span>
|
1704
|
+
</a>
|
1705
|
+
</div>
|
1706
|
+
|
1707
|
+
<div class="method-description">
|
1708
|
+
<p>
|
1709
|
+
————— scale
|
1710
|
+
—————-
|
1711
|
+
</p>
|
1712
|
+
<p><a class="source-toggle" href="#"
|
1713
|
+
onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
|
1714
|
+
<div class="method-source-code" id="M000043-source">
|
1715
|
+
<pre>
|
1716
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 625</span>
|
1717
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_new</span>
|
1718
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</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>)
|
1719
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@mu_ip</span>, <span class="ruby-value str">"failed to set mu_ip"</span>)
|
1720
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">docroot</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"/api/v5/scale/"</span>, <span class="ruby-value str">"failed to set docroot"</span>)
|
1721
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-operator">!</span><span class="ruby-identifier">api</span>.<span class="ruby-identifier">uuid</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">"uuid is nil"</span>)
|
1722
|
+
<span class="ruby-keyword kw">end</span>
|
1723
|
+
</pre>
|
1724
|
+
</div>
|
1725
|
+
</div>
|
1726
|
+
</div>
|
1727
|
+
|
1728
|
+
<div id="method-M000046" class="method-detail">
|
1729
|
+
<a name="M000046"></a>
|
1730
|
+
|
1731
|
+
<div class="method-heading">
|
1732
|
+
<a href="#M000046" class="method-signature">
|
1733
|
+
<span class="method-name">test_scale_session</span><span class="method-args">()</span>
|
1734
|
+
</a>
|
1735
|
+
</div>
|
1736
|
+
|
1737
|
+
<div class="method-description">
|
1738
|
+
<p><a class="source-toggle" href="#"
|
1739
|
+
onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
|
1740
|
+
<div class="method-source-code" id="M000046-source">
|
1741
|
+
<pre>
|
1742
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 648</span>
|
1743
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_session</span>
|
1744
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</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>)
|
1745
|
+
<span class="ruby-identifier">api</span>.<span class="ruby-identifier">session</span>
|
1746
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-operator">!</span><span class="ruby-identifier">api</span>.<span class="ruby-identifier">uuid</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">"uuid is nil"</span>)
|
1747
|
+
<span class="ruby-keyword kw">end</span>
|
1748
|
+
</pre>
|
1749
|
+
</div>
|
1750
|
+
</div>
|
1751
|
+
</div>
|
1752
|
+
|
1753
|
+
<div id="method-M000047" class="method-detail">
|
1754
|
+
<a name="M000047"></a>
|
1755
|
+
|
1756
|
+
<div class="method-heading">
|
1757
|
+
<a href="#M000047" class="method-signature">
|
1758
|
+
<span class="method-name">test_system_new</span><span class="method-args">()</span>
|
1759
|
+
</a>
|
1760
|
+
</div>
|
1761
|
+
|
1762
|
+
<div class="method-description">
|
1763
|
+
<p>
|
1764
|
+
do NOT write a test for system:restart please!
|
1765
|
+
</p>
|
1766
|
+
<p><a class="source-toggle" href="#"
|
1767
|
+
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
1768
|
+
<div class="method-source-code" id="M000047-source">
|
1769
|
+
<pre>
|
1770
|
+
<span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 658</span>
|
1771
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_system_new</span>
|
1772
|
+
<span class="ruby-identifier">api</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">System</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>)
|
1773
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@mu_ip</span>, <span class="ruby-value str">"failed to set mu_ip"</span>)
|
1774
|
+
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">api</span>.<span class="ruby-identifier">docroot</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"/api/v5/system/"</span>, <span class="ruby-value str">"failed to set docroot"</span>)
|
1775
|
+
<span class="ruby-keyword kw">end</span>
|
1776
|
+
</pre>
|
1777
|
+
</div>
|
1778
|
+
</div>
|
1779
|
+
</div>
|
1780
|
+
|
1781
|
+
|
1782
|
+
</div>
|
1783
|
+
|
1784
|
+
|
1785
|
+
</div>
|
1786
|
+
|
1787
|
+
|
1788
|
+
<div id="validator-badges">
|
1789
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
1790
|
+
</div>
|
1791
|
+
|
1792
|
+
</body>
|
1793
|
+
</html>
|