mu 5.7.8 → 5.7.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. data/lib/mu.rb +1 -1
  2. data/lib/mu/command.rb +18 -2
  3. data/lib/mu/command/cmd_musl.rb +165 -0
  4. data/lib/mu/command/cmd_runscale.rb +12 -8
  5. data/lib/mu/command/help.rb +1 -0
  6. data/lib/mu/har.rb +449 -0
  7. data/lib/mu/libxml.rb +21 -0
  8. data/lib/mu/maker.rb +288 -0
  9. data/lib/mu/xmlizable.rb +559 -0
  10. metadata +78 -267
  11. data/rdoc/Gemfile.html +0 -194
  12. data/rdoc/LICENSE_txt.html +0 -201
  13. data/rdoc/Mu.html +0 -478
  14. data/rdoc/Mu/Client.html +0 -461
  15. data/rdoc/Mu/Command.html +0 -338
  16. data/rdoc/Mu/Command/API.html +0 -844
  17. data/rdoc/Mu/Command/Cmd_appid.html +0 -1341
  18. data/rdoc/Mu/Command/Cmd_cli.html +0 -800
  19. data/rdoc/Mu/Command/Cmd_ddt.html +0 -1612
  20. data/rdoc/Mu/Command/Cmd_homepage.html +0 -762
  21. data/rdoc/Mu/Command/Cmd_muapi.html +0 -1363
  22. data/rdoc/Mu/Command/Cmd_netconfig.html +0 -1077
  23. data/rdoc/Mu/Command/Cmd_runscale.html +0 -1441
  24. data/rdoc/Mu/Command/Cmd_runscenario.html +0 -787
  25. data/rdoc/Mu/Command/Cmd_runverify.html +0 -893
  26. data/rdoc/Mu/Command/Cmd_scale.html +0 -1323
  27. data/rdoc/Mu/Command/Cmd_system.html +0 -677
  28. data/rdoc/Mu/Command/Curl.html +0 -751
  29. data/rdoc/Mu/Command/Help.html +0 -305
  30. data/rdoc/Mu/Curl.html +0 -243
  31. data/rdoc/Mu/Curl/Error.html +0 -304
  32. data/rdoc/Mu/Curl/Error/Authorize.html +0 -355
  33. data/rdoc/Mu/Curl/Error/Connect.html +0 -286
  34. data/rdoc/Mu/Curl/Error/DNS.html +0 -236
  35. data/rdoc/Mu/Curl/Error/Region.html +0 -307
  36. data/rdoc/Mu/Curl/Error/Status.html +0 -286
  37. data/rdoc/Mu/Curl/Error/Timeout.html +0 -286
  38. data/rdoc/Mu/Curl/Verify.html +0 -472
  39. data/rdoc/Mu/Curl/Verify/Request.html +0 -424
  40. data/rdoc/Mu/Curl/Verify/Response.html +0 -372
  41. data/rdoc/Mu/Curl/Verify/Result.html +0 -373
  42. data/rdoc/Mu/Ddt.html +0 -1347
  43. data/rdoc/Mu/Helper.html +0 -517
  44. data/rdoc/Mu/Homepage.html +0 -719
  45. data/rdoc/Mu/HttpHelper.html +0 -890
  46. data/rdoc/Mu/Muapi.html +0 -1226
  47. data/rdoc/Mu/Netconfig.html +0 -1178
  48. data/rdoc/Mu/Scale.html +0 -1359
  49. data/rdoc/Mu/System.html +0 -504
  50. data/rdoc/Object.html +0 -285
  51. data/rdoc/README_rdoc.html +0 -892
  52. data/rdoc/Rakefile.html +0 -257
  53. data/rdoc/TCTestMu.html +0 -2583
  54. data/rdoc/Test.html +0 -235
  55. data/rdoc/Test/Unit.html +0 -235
  56. data/rdoc/Test/Unit/TestCase.html +0 -236
  57. data/rdoc/Test/helper_rb.html +0 -62
  58. data/rdoc/Test/tc_test_mu_rb.html +0 -60
  59. data/rdoc/VERSION.html +0 -179
  60. data/rdoc/bin/mu.html +0 -54
  61. data/rdoc/classes/Mu.html +0 -132
  62. data/rdoc/classes/Mu/Client.html +0 -214
  63. data/rdoc/classes/Mu/Command.html +0 -129
  64. data/rdoc/classes/Mu/Command/API.html +0 -362
  65. data/rdoc/classes/Mu/Command/Cmd_appid.html +0 -238
  66. data/rdoc/classes/Mu/Command/Cmd_cli.html +0 -273
  67. data/rdoc/classes/Mu/Command/Cmd_ddt.html +0 -639
  68. data/rdoc/classes/Mu/Command/Cmd_homepage.html +0 -276
  69. data/rdoc/classes/Mu/Command/Cmd_muapi.html +0 -527
  70. data/rdoc/classes/Mu/Command/Cmd_netconfig.html +0 -399
  71. data/rdoc/classes/Mu/Command/Cmd_runscale.html +0 -220
  72. data/rdoc/classes/Mu/Command/Cmd_runscenario.html +0 -197
  73. data/rdoc/classes/Mu/Command/Cmd_runverify.html +0 -196
  74. data/rdoc/classes/Mu/Command/Cmd_scale.html +0 -511
  75. data/rdoc/classes/Mu/Command/Cmd_system.html +0 -236
  76. data/rdoc/classes/Mu/Command/Curl.html +0 -182
  77. data/rdoc/classes/Mu/Command/Help.html +0 -137
  78. data/rdoc/classes/Mu/Curl.html +0 -116
  79. data/rdoc/classes/Mu/Curl/Error.html +0 -148
  80. data/rdoc/classes/Mu/Curl/Error/Authorize.html +0 -165
  81. data/rdoc/classes/Mu/Curl/Error/Connect.html +0 -139
  82. data/rdoc/classes/Mu/Curl/Error/DNS.html +0 -113
  83. data/rdoc/classes/Mu/Curl/Error/Region.html +0 -150
  84. data/rdoc/classes/Mu/Curl/Error/Status.html +0 -139
  85. data/rdoc/classes/Mu/Curl/Error/Timeout.html +0 -139
  86. data/rdoc/classes/Mu/Curl/Verify.html +0 -207
  87. data/rdoc/classes/Mu/Curl/Verify/Request.html +0 -187
  88. data/rdoc/classes/Mu/Curl/Verify/Response.html +0 -172
  89. data/rdoc/classes/Mu/Curl/Verify/Result.html +0 -172
  90. data/rdoc/classes/Mu/Ddt.html +0 -610
  91. data/rdoc/classes/Mu/Helper.html +0 -308
  92. data/rdoc/classes/Mu/Homepage.html +0 -306
  93. data/rdoc/classes/Mu/HttpHelper.html +0 -393
  94. data/rdoc/classes/Mu/Muapi.html +0 -549
  95. data/rdoc/classes/Mu/Netconfig.html +0 -478
  96. data/rdoc/classes/Mu/Scale.html +0 -580
  97. data/rdoc/classes/Mu/System.html +0 -232
  98. data/rdoc/classes/Object.html +0 -139
  99. data/rdoc/classes/TCTestMu.html +0 -948
  100. data/rdoc/classes/Test.html +0 -107
  101. data/rdoc/classes/Test/Unit.html +0 -107
  102. data/rdoc/classes/Test/Unit/TestCase.html +0 -113
  103. data/rdoc/created.rid +0 -36
  104. data/rdoc/files/lib/mu/api/ddt_rb.html +0 -101
  105. data/rdoc/files/lib/mu/api/homepage_rb.html +0 -101
  106. data/rdoc/files/lib/mu/api/muapi_rb.html +0 -101
  107. data/rdoc/files/lib/mu/api/netconfig_rb.html +0 -101
  108. data/rdoc/files/lib/mu/api/scale_rb.html +0 -101
  109. data/rdoc/files/lib/mu/api/system_rb.html +0 -101
  110. data/rdoc/files/lib/mu/client_rb.html +0 -101
  111. data/rdoc/files/lib/mu/command/api_rb.html +0 -101
  112. data/rdoc/files/lib/mu/command/cmd_appid_rb.html +0 -119
  113. data/rdoc/files/lib/mu/command/cmd_cli_rb.html +0 -108
  114. data/rdoc/files/lib/mu/command/cmd_ddt_rb.html +0 -116
  115. data/rdoc/files/lib/mu/command/cmd_homepage_rb.html +0 -115
  116. data/rdoc/files/lib/mu/command/cmd_muapi_rb.html +0 -115
  117. data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +0 -116
  118. data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +0 -119
  119. data/rdoc/files/lib/mu/command/cmd_runscenario_rb.html +0 -115
  120. data/rdoc/files/lib/mu/command/cmd_runverify_rb.html +0 -118
  121. data/rdoc/files/lib/mu/command/cmd_scale_rb.html +0 -115
  122. data/rdoc/files/lib/mu/command/cmd_system_rb.html +0 -116
  123. data/rdoc/files/lib/mu/command/curl_rb.html +0 -101
  124. data/rdoc/files/lib/mu/command/help_rb.html +0 -101
  125. data/rdoc/files/lib/mu/command_rb.html +0 -107
  126. data/rdoc/files/lib/mu/curl/error_rb.html +0 -101
  127. data/rdoc/files/lib/mu/curl/verify_rb.html +0 -101
  128. data/rdoc/files/lib/mu/helper_rb.html +0 -101
  129. data/rdoc/files/lib/mu/http_helper_rb.html +0 -101
  130. data/rdoc/files/lib/mu_rb.html +0 -121
  131. data/rdoc/files/test/helper_rb.html +0 -112
  132. data/rdoc/files/test/tc_test_mu_rb.html +0 -111
  133. data/rdoc/fr_class_index.html +0 -34
  134. data/rdoc/fr_file_index.html +0 -31
  135. data/rdoc/fr_method_index.html +0 -112
  136. data/rdoc/images/brick.png +0 -0
  137. data/rdoc/images/brick_link.png +0 -0
  138. data/rdoc/images/bug.png +0 -0
  139. data/rdoc/images/bullet_black.png +0 -0
  140. data/rdoc/images/bullet_toggle_minus.png +0 -0
  141. data/rdoc/images/bullet_toggle_plus.png +0 -0
  142. data/rdoc/images/date.png +0 -0
  143. data/rdoc/images/find.png +0 -0
  144. data/rdoc/images/loadingAnimation.gif +0 -0
  145. data/rdoc/images/macFFBgHack.png +0 -0
  146. data/rdoc/images/package.png +0 -0
  147. data/rdoc/images/page_green.png +0 -0
  148. data/rdoc/images/page_white_text.png +0 -0
  149. data/rdoc/images/page_white_width.png +0 -0
  150. data/rdoc/images/plugin.png +0 -0
  151. data/rdoc/images/ruby.png +0 -0
  152. data/rdoc/images/tag_green.png +0 -0
  153. data/rdoc/images/wrench.png +0 -0
  154. data/rdoc/images/wrench_orange.png +0 -0
  155. data/rdoc/images/zoom.png +0 -0
  156. data/rdoc/index.html +0 -884
  157. data/rdoc/js/darkfish.js +0 -116
  158. data/rdoc/js/jquery.js +0 -32
  159. data/rdoc/js/quicksearch.js +0 -114
  160. data/rdoc/js/thickbox-compressed.js +0 -10
  161. data/rdoc/lib/mu/api/ddt_rb.html +0 -52
  162. data/rdoc/lib/mu/api/homepage_rb.html +0 -52
  163. data/rdoc/lib/mu/api/muapi_rb.html +0 -52
  164. data/rdoc/lib/mu/api/netconfig_rb.html +0 -52
  165. data/rdoc/lib/mu/api/scale_rb.html +0 -52
  166. data/rdoc/lib/mu/api/system_rb.html +0 -52
  167. data/rdoc/lib/mu/client_rb.html +0 -52
  168. data/rdoc/lib/mu/command/api_rb.html +0 -52
  169. data/rdoc/lib/mu/command/cmd_appid_rb.html +0 -62
  170. data/rdoc/lib/mu/command/cmd_cli_rb.html +0 -55
  171. data/rdoc/lib/mu/command/cmd_ddt_rb.html +0 -60
  172. data/rdoc/lib/mu/command/cmd_homepage_rb.html +0 -57
  173. data/rdoc/lib/mu/command/cmd_muapi_rb.html +0 -59
  174. data/rdoc/lib/mu/command/cmd_netconfig_rb.html +0 -58
  175. data/rdoc/lib/mu/command/cmd_runscale_rb.html +0 -62
  176. data/rdoc/lib/mu/command/cmd_runscenario_rb.html +0 -57
  177. data/rdoc/lib/mu/command/cmd_runverify_rb.html +0 -61
  178. data/rdoc/lib/mu/command/cmd_scale_rb.html +0 -58
  179. data/rdoc/lib/mu/command/cmd_system_rb.html +0 -59
  180. data/rdoc/lib/mu/command/curl_rb.html +0 -52
  181. data/rdoc/lib/mu/command/help_rb.html +0 -52
  182. data/rdoc/lib/mu/command_rb.html +0 -55
  183. data/rdoc/lib/mu/curl/error_rb.html +0 -52
  184. data/rdoc/lib/mu/curl/verify_rb.html +0 -52
  185. data/rdoc/lib/mu/helper_rb.html +0 -52
  186. data/rdoc/lib/mu/http_helper_rb.html +0 -52
  187. data/rdoc/lib/mu_rb.html +0 -80
  188. data/rdoc/rdoc-style.css +0 -208
  189. data/rdoc/rdoc.css +0 -706
  190. data/test/data/app_id_stats.csv +0 -1
  191. data/test/data/app_id_status.json +0 -156
  192. data/test/data/data_cgi.msl +0 -94
  193. data/test/data/data_cgi.xml +0 -322
  194. data/test/data/default_test.csv +0 -3
  195. data/test/data/ftp_with_channel.xml +0 -1643
  196. data/test/data/irc.xml +0 -3837
  197. data/test/data/scale.json +0 -25
  198. data/test/data/test_data_cgi_error.xml +0 -35
data/rdoc/Rakefile.html DELETED
@@ -1,257 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
-
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
- <head>
7
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
-
9
- <title>File: Rakefile [RDoc Documentation]</title>
10
-
11
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
12
-
13
- <script src="./js/jquery.js" type="text/javascript"
14
- charset="utf-8"></script>
15
- <script src="./js/thickbox-compressed.js" type="text/javascript"
16
- charset="utf-8"></script>
17
- <script src="./js/quicksearch.js" type="text/javascript"
18
- charset="utf-8"></script>
19
- <script src="./js/darkfish.js" type="text/javascript"
20
- charset="utf-8"></script>
21
- </head>
22
-
23
- <body class="file">
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
27
- <h3 class="section-header">
28
- <a href="./index.html">Home</a>
29
- <a href="./index.html#classes">Classes</a>
30
- <a href="./index.html#methods">Methods</a>
31
- </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="project-metadata">
36
-
37
-
38
- <div id="fileindex-section" class="section project-section">
39
- <h3 class="section-header">Files</h3>
40
- <ul>
41
-
42
- <li class="file"><a href="./Gemfile.html">Gemfile</a></li>
43
-
44
- <li class="file"><a href="./LICENSE_txt.html">LICENSE.txt</a></li>
45
-
46
- <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
47
-
48
- <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
49
-
50
- <li class="file"><a href="./VERSION.html">VERSION</a></li>
51
-
52
- </ul>
53
- </div>
54
-
55
-
56
- <div id="classindex-section" class="section project-section">
57
- <h3 class="section-header">Class Index
58
- <span class="search-toggle"><img src="./images/find.png"
59
- height="16" width="16" alt="[+]"
60
- title="show/hide quicksearch" /></span></h3>
61
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
62
- <fieldset>
63
- <legend>Quicksearch</legend>
64
- <input type="text" name="quicksearch" value=""
65
- class="quicksearch-field" />
66
- </fieldset>
67
- </form>
68
-
69
- <ul class="link-list">
70
-
71
- <li><a href="./Mu.html">Mu</a></li>
72
-
73
- <li><a href="./Mu/Client.html">Mu::Client</a></li>
74
-
75
- <li><a href="./Mu/Command.html">Mu::Command</a></li>
76
-
77
- <li><a href="./Mu/Command/API.html">Mu::Command::API</a></li>
78
-
79
- <li><a href="./Mu/Command/API.html">Mu::Command::API</a></li>
80
-
81
- <li><a href="./Mu/Command/Cmd_appid.html">Mu::Command::Cmd_appid</a></li>
82
-
83
- <li><a href="./Mu/Command/Cmd_cli.html">Mu::Command::Cmd_cli</a></li>
84
-
85
- <li><a href="./Mu/Command/Cmd_ddt.html">Mu::Command::Cmd_ddt</a></li>
86
-
87
- <li><a href="./Mu/Command/Cmd_homepage.html">Mu::Command::Cmd_homepage</a></li>
88
-
89
- <li><a href="./Mu/Command/Cmd_muapi.html">Mu::Command::Cmd_muapi</a></li>
90
-
91
- <li><a href="./Mu/Command/Cmd_netconfig.html">Mu::Command::Cmd_netconfig</a></li>
92
-
93
- <li><a href="./Mu/Command/Cmd_runscale.html">Mu::Command::Cmd_runscale</a></li>
94
-
95
- <li><a href="./Mu/Command/Cmd_runscenario.html">Mu::Command::Cmd_runscenario</a></li>
96
-
97
- <li><a href="./Mu/Command/Cmd_runverify.html">Mu::Command::Cmd_runverify</a></li>
98
-
99
- <li><a href="./Mu/Command/Cmd_scale.html">Mu::Command::Cmd_scale</a></li>
100
-
101
- <li><a href="./Mu/Command/Cmd_system.html">Mu::Command::Cmd_system</a></li>
102
-
103
- <li><a href="./Mu/Command/Curl.html">Mu::Command::Curl</a></li>
104
-
105
- <li><a href="./Mu/Command/Help.html">Mu::Command::Help</a></li>
106
-
107
- <li><a href="./Mu/Curl.html">Mu::Curl</a></li>
108
-
109
- <li><a href="./Mu/Curl/Error.html">Mu::Curl::Error</a></li>
110
-
111
- <li><a href="./Mu/Curl/Error/Authorize.html">Mu::Curl::Error::Authorize</a></li>
112
-
113
- <li><a href="./Mu/Curl/Error/Connect.html">Mu::Curl::Error::Connect</a></li>
114
-
115
- <li><a href="./Mu/Curl/Error/DNS.html">Mu::Curl::Error::DNS</a></li>
116
-
117
- <li><a href="./Mu/Curl/Error/Region.html">Mu::Curl::Error::Region</a></li>
118
-
119
- <li><a href="./Mu/Curl/Error/Status.html">Mu::Curl::Error::Status</a></li>
120
-
121
- <li><a href="./Mu/Curl/Error/Timeout.html">Mu::Curl::Error::Timeout</a></li>
122
-
123
- <li><a href="./Mu/Curl/Verify.html">Mu::Curl::Verify</a></li>
124
-
125
- <li><a href="./Mu/Curl/Verify/Request.html">Mu::Curl::Verify::Request</a></li>
126
-
127
- <li><a href="./Mu/Curl/Verify/Response.html">Mu::Curl::Verify::Response</a></li>
128
-
129
- <li><a href="./Mu/Curl/Verify/Result.html">Mu::Curl::Verify::Result</a></li>
130
-
131
- <li><a href="./Mu/Ddt.html">Mu::Ddt</a></li>
132
-
133
- <li><a href="./Mu/Helper.html">Mu::Helper</a></li>
134
-
135
- <li><a href="./Mu/Homepage.html">Mu::Homepage</a></li>
136
-
137
- <li><a href="./Mu/HttpHelper.html">Mu::HttpHelper</a></li>
138
-
139
- <li><a href="./Mu/Muapi.html">Mu::Muapi</a></li>
140
-
141
- <li><a href="./Mu/Netconfig.html">Mu::Netconfig</a></li>
142
-
143
- <li><a href="./Mu/Scale.html">Mu::Scale</a></li>
144
-
145
- <li><a href="./Mu/System.html">Mu::System</a></li>
146
-
147
- <li><a href="./Test.html">Test</a></li>
148
-
149
- <li><a href="./Test/Unit.html">Test::Unit</a></li>
150
-
151
- <li><a href="./Test/Unit/TestCase.html">Test::Unit::TestCase</a></li>
152
-
153
- <li><a href="./Object.html">Object</a></li>
154
-
155
- <li><a href="./TCTestMu.html">TCTestMu</a></li>
156
-
157
- </ul>
158
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
159
- </div>
160
-
161
-
162
- </div>
163
- </div>
164
-
165
- <div id="documentation">
166
- <p>
167
- require &#8216;rubygems&#8217; require &#8216;bundler&#8217; begin
168
- </p>
169
- <pre>
170
- Bundler.setup(:default, :development)
171
- </pre>
172
- <p>
173
- rescue Bundler::BundlerError => e
174
- </p>
175
- <pre>
176
- $stderr.puts e.message
177
- $stderr.puts &quot;Run `bundle install` to install missing gems&quot;
178
- exit e.status_code
179
- </pre>
180
- <p>
181
- end require &#8216;rake&#8217;
182
- </p>
183
- <p>
184
- require &#8216;jeweler&#8217; Jeweler::Tasks.new do |gem|
185
- </p>
186
- <pre>
187
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
188
- gem.name = &quot;mu&quot;
189
- gem.homepage = &quot;https://github.com/tlichtenberg/mu&quot;
190
- gem.license = &quot;MIT&quot;
191
- gem.summary = &quot;general purpose mu gem&quot;
192
- gem.description = &quot;general purpose mu gem&quot;
193
- gem.email = &quot;lichtenberg.tom@gmail.com&quot;
194
- gem.authors = [&quot;pcapr&quot;]
195
- gem.executables = ['mu']
196
- gem.has_rdoc = true
197
- gem.extra_rdoc_files = &quot;Mu_Gem.html, README.rdoc&quot;
198
- gem.files = ['lib/**/*.rb','test/data/*', 'rdoc/**/*'].to_a
199
- # Include your dependencies below. Runtime dependencies are required when using your gem,
200
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
201
- gem.add_dependency 'nokogiri', ' &gt;= 1.4.4'
202
- gem.add_dependency 'rest-client', ' &gt;= 1.6.1'
203
- gem.add_dependency 'mime-types', ' &gt;= 1.16'
204
- gem.add_dependency 'json_pure', ' &gt;= 1.4.6'
205
- gem.add_dependency 'hexy', ' &gt;= 0.1.1'
206
- </pre>
207
- <p>
208
- end Jeweler::RubygemsDotOrgTasks.new
209
- </p>
210
- <p>
211
- require &#8216;rake/testtask&#8217; Rake::TestTask.new(:test) do |test|
212
- </p>
213
- <pre>
214
- test.libs &lt;&lt; 'test'
215
- test.pattern = 'test/tc_test_*.rb'
216
- test.verbose = true
217
- </pre>
218
- <p>
219
- end
220
- </p>
221
- <p>
222
- require &#8216;rcov/rcovtask&#8217; Rcov::RcovTask.new do |test|
223
- </p>
224
- <pre>
225
- test.libs &lt;&lt; 'test'
226
- test.pattern = './test/tc_test_*.rb'
227
- test.verbose = true
228
- </pre>
229
- <p>
230
- end
231
- </p>
232
- <p>
233
- task :default => :test
234
- </p>
235
- <p>
236
- require &#8216;rake/rdoctask&#8217; Rake::RDocTask.new do |rdoc|
237
- </p>
238
- <pre>
239
- version = File.exist?('VERSION') ? File.read('VERSION') : &quot;&quot;
240
- rdoc.rdoc_dir = 'rdoc'
241
- rdoc.title = &quot;mu #{version}&quot;
242
- rdoc.options &lt;&lt; '--all'
243
- </pre>
244
- <p>
245
- end
246
- </p>
247
-
248
- </div>
249
-
250
- <div id="validator-badges">
251
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
252
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
253
- Rdoc Generator</a> 1.1.6</small>.</p>
254
- </div>
255
- </body>
256
- </html>
257
-
data/rdoc/TCTestMu.html DELETED
@@ -1,2583 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
-
8
- <title>Class: TCTestMu</title>
9
-
10
- <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
-
12
- <script src="./js/jquery.js" type="text/javascript"
13
- charset="utf-8"></script>
14
- <script src="./js/thickbox-compressed.js" type="text/javascript"
15
- charset="utf-8"></script>
16
- <script src="./js/quicksearch.js" type="text/javascript"
17
- charset="utf-8"></script>
18
- <script src="./js/darkfish.js" type="text/javascript"
19
- charset="utf-8"></script>
20
-
21
- </head>
22
- <body class="class">
23
-
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
27
- <h3 class="section-header">
28
- <a href="./index.html">Home</a>
29
- <a href="./index.html#classes">Classes</a>
30
- <a href="./index.html#methods">Methods</a>
31
- </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="file-metadata">
36
- <div id="file-list-section" class="section">
37
- <h3 class="section-header">In Files</h3>
38
- <div class="section-body">
39
- <ul>
40
-
41
- <li><a href="./test/tc_test_mu_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="test/tc_test_mu.rb">test/tc_test_mu.rb</a></li>
43
-
44
- </ul>
45
- </div>
46
- </div>
47
-
48
-
49
- </div>
50
-
51
- <div id="class-metadata">
52
-
53
- <!-- Parent Class -->
54
-
55
- <div id="parent-class-section" class="section">
56
- <h3 class="section-header">Parent</h3>
57
-
58
- <p class="link"><a href="Test/Unit/TestCase.html">Test::Unit::TestCase</a></p>
59
-
60
- </div>
61
-
62
-
63
- <!-- Namespace Contents -->
64
-
65
-
66
- <!-- Method Quickref -->
67
-
68
- <div id="method-list-section" class="section">
69
- <h3 class="section-header">Methods</h3>
70
- <ul class="link-list">
71
-
72
- <li><a href="#method-i-add_localhost_with_channel">#add_localhost_with_channel</a></li>
73
-
74
- <li><a href="#method-i-make_uuid_args">#make_uuid_args</a></li>
75
-
76
- <li><a href="#method-i-setup">#setup</a></li>
77
-
78
- <li><a href="#method-i-teardown">#teardown</a></li>
79
-
80
- <li><a href="#method-i-test_cli_history">#test_cli_history</a></li>
81
-
82
- <li><a href="#method-i-test_cli_question">#test_cli_question</a></li>
83
-
84
- <li><a href="#method-i-test_cmd_appid_run_dir">#test_cmd_appid_run_dir</a></li>
85
-
86
- <li><a href="#method-i-test_cmd_appid_run_file">#test_cmd_appid_run_file</a></li>
87
-
88
- <li><a href="#method-i-test_cmd_ddt_csv_import_export">#test_cmd_ddt_csv_import_export</a></li>
89
-
90
- <li><a href="#method-i-test_cmd_ddt_get_all_sessions">#test_cmd_ddt_get_all_sessions</a></li>
91
-
92
- <li><a href="#method-i-test_cmd_ddt_get_set_channels">#test_cmd_ddt_get_set_channels</a></li>
93
-
94
- <li><a href="#method-i-test_cmd_ddt_get_set_hosts">#test_cmd_ddt_get_set_hosts</a></li>
95
-
96
- <li><a href="#method-i-test_cmd_ddt_get_set_options">#test_cmd_ddt_get_set_options</a></li>
97
-
98
- <li><a href="#method-i-test_cmd_muapi_analysis">#test_cmd_muapi_analysis</a></li>
99
-
100
- <li><a href="#method-i-test_cmd_muapi_archive">#test_cmd_muapi_archive</a></li>
101
-
102
- <li><a href="#method-i-test_cmd_muapi_capture">#test_cmd_muapi_capture</a></li>
103
-
104
- <li><a href="#method-i-test_cmd_muapi_delete">#test_cmd_muapi_delete</a></li>
105
-
106
- <li><a href="#method-i-test_cmd_muapi_export_by_type_and_name">#test_cmd_muapi_export_by_type_and_name</a></li>
107
-
108
- <li><a href="#method-i-test_cmd_muapi_export_by_uuid">#test_cmd_muapi_export_by_uuid</a></li>
109
-
110
- <li><a href="#method-i-test_cmd_muapi_types">#test_cmd_muapi_types</a></li>
111
-
112
- <li><a href="#method-i-test_cmd_netconfig_add_modify_delete_route">#test_cmd_netconfig_add_modify_delete_route</a></li>
113
-
114
- <li><a href="#method-i-test_cmd_netconfig_create_delete_host">#test_cmd_netconfig_create_delete_host</a></li>
115
-
116
- <li><a href="#method-i-test_cmd_netconfig_get_interfaces_a1">#test_cmd_netconfig_get_interfaces_a1</a></li>
117
-
118
- <li><a href="#method-i-test_cmd_netconfig_modify_interfaces_a1">#test_cmd_netconfig_modify_interfaces_a1</a></li>
119
-
120
- <li><a href="#method-i-test_cmd_netconfig_resolve_hosts">#test_cmd_netconfig_resolve_hosts</a></li>
121
-
122
- <li><a href="#method-i-test_cmd_netconfig_save">#test_cmd_netconfig_save</a></li>
123
-
124
- <li><a href="#method-i-test_cmd_netconfig_vlans">#test_cmd_netconfig_vlans</a></li>
125
-
126
- <li><a href="#method-i-test_cmd_runscale_run_dir">#test_cmd_runscale_run_dir</a></li>
127
-
128
- <li><a href="#method-i-test_cmd_runscale_run_file">#test_cmd_runscale_run_file</a></li>
129
-
130
- <li><a href="#method-i-test_cmd_runscenario">#test_cmd_runscenario</a></li>
131
-
132
- <li><a href="#method-i-test_cmd_runverify">#test_cmd_runverify</a></li>
133
-
134
- <li><a href="#method-i-test_cmd_system_status">#test_cmd_system_status</a></li>
135
-
136
- <li><a href="#method-i-test_cmd_system_status2">#test_cmd_system_status2</a></li>
137
-
138
- <li><a href="#method-i-test_ddt_close_all_sessions">#test_ddt_close_all_sessions</a></li>
139
-
140
- <li><a href="#method-i-test_ddt_get_all_sessions">#test_ddt_get_all_sessions</a></li>
141
-
142
- <li><a href="#method-i-test_ddt_new">#test_ddt_new</a></li>
143
-
144
- <li><a href="#method-i-test_ddt_set_hosts">#test_ddt_set_hosts</a></li>
145
-
146
- <li><a href="#method-i-test_homepage_all">#test_homepage_all</a></li>
147
-
148
- <li><a href="#method-i-test_homepage_latest_test">#test_homepage_latest_test</a></li>
149
-
150
- <li><a href="#method-i-test_homepage_new">#test_homepage_new</a></li>
151
-
152
- <li><a href="#method-i-test_homepage_recent">#test_homepage_recent</a></li>
153
-
154
- <li><a href="#method-i-test_homepage_status">#test_homepage_status</a></li>
155
-
156
- <li><a href="#method-i-test_muapi_list_by_status">#test_muapi_list_by_status</a></li>
157
-
158
- <li><a href="#method-i-test_muapi_new">#test_muapi_new</a></li>
159
-
160
- <li><a href="#method-i-test_muapi_types">#test_muapi_types</a></li>
161
-
162
- <li><a href="#method-i-test_netconfig_new">#test_netconfig_new</a></li>
163
-
164
- <li><a href="#method-i-test_scale_about">#test_scale_about</a></li>
165
-
166
- <li><a href="#method-i-test_scale_list">#test_scale_list</a></li>
167
-
168
- <li><a href="#method-i-test_scale_new">#test_scale_new</a></li>
169
-
170
- <li><a href="#method-i-test_scale_session">#test_scale_session</a></li>
171
-
172
- <li><a href="#method-i-test_system_new">#test_system_new</a></li>
173
-
174
- </ul>
175
- </div>
176
-
177
-
178
- <!-- Included Modules -->
179
-
180
- </div>
181
-
182
- <div id="project-metadata">
183
-
184
-
185
- <div id="fileindex-section" class="section project-section">
186
- <h3 class="section-header">Files</h3>
187
- <ul>
188
-
189
- <li class="file"><a href="./Gemfile.html">Gemfile</a></li>
190
-
191
- <li class="file"><a href="./LICENSE_txt.html">LICENSE.txt</a></li>
192
-
193
- <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
194
-
195
- <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
196
-
197
- <li class="file"><a href="./VERSION.html">VERSION</a></li>
198
-
199
- </ul>
200
- </div>
201
-
202
-
203
- <div id="classindex-section" class="section project-section">
204
- <h3 class="section-header">Class Index
205
- <span class="search-toggle"><img src="./images/find.png"
206
- height="16" width="16" alt="[+]"
207
- title="show/hide quicksearch" /></span></h3>
208
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
209
- <fieldset>
210
- <legend>Quicksearch</legend>
211
- <input type="text" name="quicksearch" value=""
212
- class="quicksearch-field" />
213
- </fieldset>
214
- </form>
215
-
216
- <ul class="link-list">
217
-
218
- <li><a href="./Mu.html">Mu</a></li>
219
-
220
- <li><a href="./Mu/Client.html">Mu::Client</a></li>
221
-
222
- <li><a href="./Mu/Command.html">Mu::Command</a></li>
223
-
224
- <li><a href="./Mu/Command/API.html">Mu::Command::API</a></li>
225
-
226
- <li><a href="./Mu/Command/API.html">Mu::Command::API</a></li>
227
-
228
- <li><a href="./Mu/Command/Cmd_appid.html">Mu::Command::Cmd_appid</a></li>
229
-
230
- <li><a href="./Mu/Command/Cmd_cli.html">Mu::Command::Cmd_cli</a></li>
231
-
232
- <li><a href="./Mu/Command/Cmd_ddt.html">Mu::Command::Cmd_ddt</a></li>
233
-
234
- <li><a href="./Mu/Command/Cmd_homepage.html">Mu::Command::Cmd_homepage</a></li>
235
-
236
- <li><a href="./Mu/Command/Cmd_muapi.html">Mu::Command::Cmd_muapi</a></li>
237
-
238
- <li><a href="./Mu/Command/Cmd_netconfig.html">Mu::Command::Cmd_netconfig</a></li>
239
-
240
- <li><a href="./Mu/Command/Cmd_runscale.html">Mu::Command::Cmd_runscale</a></li>
241
-
242
- <li><a href="./Mu/Command/Cmd_runscenario.html">Mu::Command::Cmd_runscenario</a></li>
243
-
244
- <li><a href="./Mu/Command/Cmd_runverify.html">Mu::Command::Cmd_runverify</a></li>
245
-
246
- <li><a href="./Mu/Command/Cmd_scale.html">Mu::Command::Cmd_scale</a></li>
247
-
248
- <li><a href="./Mu/Command/Cmd_system.html">Mu::Command::Cmd_system</a></li>
249
-
250
- <li><a href="./Mu/Command/Curl.html">Mu::Command::Curl</a></li>
251
-
252
- <li><a href="./Mu/Command/Help.html">Mu::Command::Help</a></li>
253
-
254
- <li><a href="./Mu/Curl.html">Mu::Curl</a></li>
255
-
256
- <li><a href="./Mu/Curl/Error.html">Mu::Curl::Error</a></li>
257
-
258
- <li><a href="./Mu/Curl/Error/Authorize.html">Mu::Curl::Error::Authorize</a></li>
259
-
260
- <li><a href="./Mu/Curl/Error/Connect.html">Mu::Curl::Error::Connect</a></li>
261
-
262
- <li><a href="./Mu/Curl/Error/DNS.html">Mu::Curl::Error::DNS</a></li>
263
-
264
- <li><a href="./Mu/Curl/Error/Region.html">Mu::Curl::Error::Region</a></li>
265
-
266
- <li><a href="./Mu/Curl/Error/Status.html">Mu::Curl::Error::Status</a></li>
267
-
268
- <li><a href="./Mu/Curl/Error/Timeout.html">Mu::Curl::Error::Timeout</a></li>
269
-
270
- <li><a href="./Mu/Curl/Verify.html">Mu::Curl::Verify</a></li>
271
-
272
- <li><a href="./Mu/Curl/Verify/Request.html">Mu::Curl::Verify::Request</a></li>
273
-
274
- <li><a href="./Mu/Curl/Verify/Response.html">Mu::Curl::Verify::Response</a></li>
275
-
276
- <li><a href="./Mu/Curl/Verify/Result.html">Mu::Curl::Verify::Result</a></li>
277
-
278
- <li><a href="./Mu/Ddt.html">Mu::Ddt</a></li>
279
-
280
- <li><a href="./Mu/Helper.html">Mu::Helper</a></li>
281
-
282
- <li><a href="./Mu/Homepage.html">Mu::Homepage</a></li>
283
-
284
- <li><a href="./Mu/HttpHelper.html">Mu::HttpHelper</a></li>
285
-
286
- <li><a href="./Mu/Muapi.html">Mu::Muapi</a></li>
287
-
288
- <li><a href="./Mu/Netconfig.html">Mu::Netconfig</a></li>
289
-
290
- <li><a href="./Mu/Scale.html">Mu::Scale</a></li>
291
-
292
- <li><a href="./Mu/System.html">Mu::System</a></li>
293
-
294
- <li><a href="./Test.html">Test</a></li>
295
-
296
- <li><a href="./Test/Unit.html">Test::Unit</a></li>
297
-
298
- <li><a href="./Test/Unit/TestCase.html">Test::Unit::TestCase</a></li>
299
-
300
- <li><a href="./Object.html">Object</a></li>
301
-
302
- <li><a href="./TCTestMu.html">TCTestMu</a></li>
303
-
304
- </ul>
305
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
306
- </div>
307
-
308
-
309
- </div>
310
- </div>
311
-
312
- <div id="documentation">
313
- <h1 class="class">TCTestMu</h1>
314
-
315
- <div id="description">
316
-
317
- </div>
318
-
319
- <!-- Constants -->
320
-
321
-
322
- <!-- Attributes -->
323
-
324
-
325
- <!-- Methods -->
326
-
327
- <div id="public-instance-method-details" class="method-section section">
328
- <h3 class="section-header">Public Instance Methods</h3>
329
-
330
-
331
- <div id="add-localhost-with-channel-method" class="method-detail ">
332
- <a name="method-i-add_localhost_with_channel"></a>
333
-
334
- <div class="method-heading">
335
-
336
- <span class="method-name">add_localhost_with_channel</span><span
337
- class="method-args">()</span>
338
- <span class="method-click-advice">click to toggle source</span>
339
-
340
- </div>
341
-
342
- <div class="method-description">
343
-
344
- <p>
345
- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- utility methods
346
- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
347
- </p>
348
-
349
-
350
-
351
- <div class="method-source-code"
352
- id="add-localhost-with-channel-source">
353
- <pre>
354
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 700</span>
355
- 700: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_localhost_with_channel</span>
356
- 701: <span class="ruby-identifier">local_host</span> = {
357
- 702: <span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;localhost&quot;</span>,
358
- 703: <span class="ruby-value str">&quot;ssh_channel&quot;</span>=<span class="ruby-operator">&gt;</span> {
359
- 704: <span class="ruby-value str">&quot;username&quot;</span>=<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;root&quot;</span>,
360
- 705: <span class="ruby-value str">&quot;prompt&quot;</span>=<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;]#&quot;</span>,
361
- 706: <span class="ruby-value str">&quot;commands&quot;</span>=<span class="ruby-operator">&gt;</span> [
362
- 707:
363
- 708: ],
364
- 709: <span class="ruby-value str">&quot;tcp_port&quot;</span>=<span class="ruby-operator">&gt;</span> <span class="ruby-value">22</span>,
365
- 710: <span class="ruby-value str">&quot;password&quot;</span>=<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;bogus&quot;</span>
366
- 711: },
367
- 712: <span class="ruby-value str">&quot;v4_addr&quot;</span>=<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@mu_ip</span>
368
- 713: }
369
- 714: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
370
- 715: <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>
371
- 716: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;hosts/localhost&quot;</span>] <span class="ruby-comment cmt"># may not exist</span>
372
- 717: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_create</span> [<span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-constant">JSON</span>(<span class="ruby-identifier">local_host</span>), <span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;hosts&quot;</span>]
373
- 718: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;created&quot;</span>), <span class="ruby-value str">&quot;Failed to create host:&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">to_s</span>)
374
- 719: <span class="ruby-keyword kw">end</span></pre>
375
- </div>
376
-
377
- </div>
378
-
379
-
380
-
381
-
382
- </div>
383
-
384
-
385
- <div id="make-uuid-args-method" class="method-detail ">
386
- <a name="method-i-make_uuid_args"></a>
387
-
388
- <div class="method-heading">
389
-
390
- <span class="method-name">make_uuid_args</span><span
391
- class="method-args">(uuid)</span>
392
- <span class="method-click-advice">click to toggle source</span>
393
-
394
- </div>
395
-
396
- <div class="method-description">
397
-
398
-
399
-
400
-
401
-
402
- <div class="method-source-code"
403
- id="make-uuid-args-source">
404
- <pre>
405
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 371</span>
406
- 371: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_uuid_args</span>(<span class="ruby-identifier">uuid</span>)
407
- 372: <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
408
- 373: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-u&quot;</span>
409
- 374: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">uuid</span>
410
- 375: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-v&quot;</span>
411
- 376: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">args</span>
412
- 377: <span class="ruby-keyword kw">end</span></pre>
413
- </div>
414
-
415
- </div>
416
-
417
-
418
-
419
-
420
- </div>
421
-
422
-
423
- <div id="setup-method" class="method-detail ">
424
- <a name="method-i-setup"></a>
425
-
426
- <div class="method-heading">
427
-
428
- <span class="method-name">setup</span><span
429
- class="method-args">()</span>
430
- <span class="method-click-advice">click to toggle source</span>
431
-
432
- </div>
433
-
434
- <div class="method-description">
435
-
436
-
437
-
438
-
439
-
440
- <div class="method-source-code"
441
- id="setup-source">
442
- <pre>
443
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 19</span>
444
- 19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
445
- 20: <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>
446
- 21: <span class="ruby-ivar">@mu_ip</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_IP'</span>]
447
- 22: <span class="ruby-ivar">@mu_admin_user</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_USER'</span>]
448
- 23: <span class="ruby-ivar">@mu_admin_pass</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_PASS'</span>]
449
- 24: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">$dir</span>)
450
- 25: <span class="ruby-identifier">$cookie</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># reset for htto_helper</span>
451
- 26: <span class="ruby-comment cmt"># puts &quot;pwd = #{Dir.pwd}&quot;</span>
452
- 27: <span class="ruby-keyword kw">end</span></pre>
453
- </div>
454
-
455
- </div>
456
-
457
-
458
-
459
-
460
- </div>
461
-
462
-
463
- <div id="teardown-method" class="method-detail ">
464
- <a name="method-i-teardown"></a>
465
-
466
- <div class="method-heading">
467
-
468
- <span class="method-name">teardown</span><span
469
- class="method-args">()</span>
470
- <span class="method-click-advice">click to toggle source</span>
471
-
472
- </div>
473
-
474
- <div class="method-description">
475
-
476
-
477
-
478
-
479
-
480
- <div class="method-source-code"
481
- id="teardown-source">
482
- <pre>
483
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 29</span>
484
- 29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">teardown</span>
485
- 30:
486
- 31: <span class="ruby-keyword kw">end</span></pre>
487
- </div>
488
-
489
- </div>
490
-
491
-
492
-
493
-
494
- </div>
495
-
496
-
497
- <div id="test-cli-history-method" class="method-detail ">
498
- <a name="method-i-test_cli_history"></a>
499
-
500
- <div class="method-heading">
501
-
502
- <span class="method-name">test_cli_history</span><span
503
- class="method-args">()</span>
504
- <span class="method-click-advice">click to toggle source</span>
505
-
506
- </div>
507
-
508
- <div class="method-description">
509
-
510
- <p>
511
- &#8212;&#8212;&#8212;&#8212;&#8212; cmd_cli
512
- &#8212;&#8212;&#8212;&#8212;&#8212;-
513
- </p>
514
-
515
-
516
-
517
- <div class="method-source-code"
518
- id="test-cli-history-source">
519
- <pre>
520
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 77</span>
521
- 77: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cli_history</span>
522
- 78: <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>
523
- 79: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_history</span> []
524
- 80: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">result</span>
525
- 81: <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">&quot;expected 'true'&quot;</span>
526
- 82: <span class="ruby-keyword kw">end</span></pre>
527
- </div>
528
-
529
- </div>
530
-
531
-
532
-
533
-
534
- </div>
535
-
536
-
537
- <div id="test-cli-question-method" class="method-detail ">
538
- <a name="method-i-test_cli_question"></a>
539
-
540
- <div class="method-heading">
541
-
542
- <span class="method-name">test_cli_question</span><span
543
- class="method-args">()</span>
544
- <span class="method-click-advice">click to toggle source</span>
545
-
546
- </div>
547
-
548
- <div class="method-description">
549
-
550
-
551
-
552
-
553
-
554
- <div class="method-source-code"
555
- id="test-cli-question-source">
556
- <pre>
557
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 84</span>
558
- 84: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cli_question</span>
559
- 85: <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>
560
- 86: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_question</span> []
561
- 87: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">result</span>
562
- 88: <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">&quot;expected 'true'&quot;</span>
563
- 89: <span class="ruby-keyword kw">end</span></pre>
564
- </div>
565
-
566
- </div>
567
-
568
-
569
-
570
-
571
- </div>
572
-
573
-
574
- <div id="test-cmd-appid-run-dir-method" class="method-detail ">
575
- <a name="method-i-test_cmd_appid_run_dir"></a>
576
-
577
- <div class="method-heading">
578
-
579
- <span class="method-name">test_cmd_appid_run_dir</span><span
580
- class="method-args">()</span>
581
- <span class="method-click-advice">click to toggle source</span>
582
-
583
- </div>
584
-
585
- <div class="method-description">
586
-
587
- <p>
588
- use ip range setting and a brief pattern
589
- </p>
590
-
591
-
592
-
593
- <div class="method-source-code"
594
- id="test-cmd-appid-run-dir-source">
595
- <pre>
596
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 55</span>
597
- 55: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_appid_run_dir</span>
598
- 56: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>)
599
- 57: <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>
600
- 58: <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
601
- 59: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-d&quot;</span>
602
- 60: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data&quot;</span>
603
- 61: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-i&quot;</span>
604
- 62: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;b1-10000,b2&quot;</span>
605
- 63: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-p&quot;</span>
606
- 64: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;1-100:10&quot;</span>
607
- 65: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_dir</span> <span class="ruby-identifier">args</span>
608
- 66: <span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
609
- 67: <span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>), <span class="ruby-value str">&quot;app_id_status.json file was not created&quot;</span>)
610
- 68: <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">&quot;app_id_status.json&quot;</span>)
611
- 69: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">&quot;status&quot;</span>]
612
- 70: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;duration&quot;</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">&quot;expected summary duration &gt; 10, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;duration&quot;]}&quot;</span>)
613
- 71: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;instances&quot;</span>][<span class="ruby-value str">&quot;executed&quot;</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>, <span class="ruby-node">&quot;expected instances executed &gt; 0, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;instances&quot;][&quot;executed&quot;]}&quot;</span>)
614
- 72: <span class="ruby-keyword kw">end</span></pre>
615
- </div>
616
-
617
- </div>
618
-
619
-
620
-
621
-
622
- </div>
623
-
624
-
625
- <div id="test-cmd-appid-run-file-method" class="method-detail ">
626
- <a name="method-i-test_cmd_appid_run_file"></a>
627
-
628
- <div class="method-heading">
629
-
630
- <span class="method-name">test_cmd_appid_run_file</span><span
631
- class="method-args">()</span>
632
- <span class="method-click-advice">click to toggle source</span>
633
-
634
- </div>
635
-
636
- <div class="method-description">
637
-
638
- <p>
639
- use ip range setting and a brief pattern
640
- </p>
641
-
642
-
643
-
644
- <div class="method-source-code"
645
- id="test-cmd-appid-run-file-source">
646
- <pre>
647
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 36</span>
648
- 36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_appid_run_file</span>
649
- 37: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>)
650
- 38: <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>
651
- 39: <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
652
- 40: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-s&quot;</span>
653
- 41: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data/data_cgi.msl&quot;</span>
654
- 42: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-i&quot;</span>
655
- 43: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;b1-10000,b2&quot;</span>
656
- 44: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-p&quot;</span>
657
- 45: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;1-100:10&quot;</span>
658
- 46: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_file</span> <span class="ruby-identifier">args</span>
659
- 47: <span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>), <span class="ruby-value str">&quot;app_id_status.json file was not created&quot;</span>)
660
- 48: <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">&quot;app_id_status.json&quot;</span>)
661
- 49: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">&quot;status&quot;</span>]
662
- 50: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;duration&quot;</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">&quot;expected summary duration &gt; 10, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;duration&quot;]}&quot;</span>)
663
- 51: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;instances&quot;</span>][<span class="ruby-value str">&quot;executed&quot;</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>, <span class="ruby-node">&quot;expected instances executed &gt; 0, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;instances&quot;][&quot;executed&quot;]}&quot;</span>)
664
- 52: <span class="ruby-keyword kw">end</span></pre>
665
- </div>
666
-
667
- </div>
668
-
669
-
670
-
671
-
672
- </div>
673
-
674
-
675
- <div id="test-cmd-ddt-csv-import-export-method" class="method-detail ">
676
- <a name="method-i-test_cmd_ddt_csv_import_export"></a>
677
-
678
- <div class="method-heading">
679
-
680
- <span class="method-name">test_cmd_ddt_csv_import_export</span><span
681
- class="method-args">()</span>
682
- <span class="method-click-advice">click to toggle source</span>
683
-
684
- </div>
685
-
686
- <div class="method-description">
687
-
688
-
689
-
690
-
691
-
692
- <div class="method-source-code"
693
- id="test-cmd-ddt-csv-import-export-source">
694
- <pre>
695
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 105</span>
696
- 105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_csv_import_export</span>
697
- 106: <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>
698
- 107: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
699
- 108: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
700
- 109: <span class="ruby-identifier">response</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_csv_import</span> [ <span class="ruby-value str">&quot;-t&quot;</span>, <span class="ruby-node">&quot;#{Dir.pwd}/test/data/default_test.csv&quot;</span>])
701
- 110: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//status&quot;</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">content</span>
702
- 111: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;true&quot;</span>, <span class="ruby-node">&quot;expected status=true, got #{status}&quot;</span>)
703
- 112: <span class="ruby-identifier">uuid</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//message&quot;</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">content</span>
704
- 113: <span class="ruby-identifier">response</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_csv_export</span> [<span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">uuid</span> ])
705
- 114: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//status&quot;</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">content</span>
706
- 115: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;true&quot;</span>, <span class="ruby-node">&quot;expected status=true, got #{status}&quot;</span>)
707
- 116: <span class="ruby-keyword kw">ensure</span>
708
- 117: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
709
- 118: <span class="ruby-keyword kw">end</span></pre>
710
- </div>
711
-
712
- </div>
713
-
714
-
715
-
716
-
717
- </div>
718
-
719
-
720
- <div id="test-cmd-ddt-get-all-sessions-method" class="method-detail ">
721
- <a name="method-i-test_cmd_ddt_get_all_sessions"></a>
722
-
723
- <div class="method-heading">
724
-
725
- <span class="method-name">test_cmd_ddt_get_all_sessions</span><span
726
- class="method-args">()</span>
727
- <span class="method-click-advice">click to toggle source</span>
728
-
729
- </div>
730
-
731
- <div class="method-description">
732
-
733
- <p>
734
- &#8212;&#8212;&#8212;&#8212;&#8212; cmd_ddt
735
- &#8212;&#8212;&#8212;&#8212;&#8212;
736
- </p>
737
-
738
-
739
-
740
- <div class="method-source-code"
741
- id="test-cmd-ddt-get-all-sessions-source">
742
- <pre>
743
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 93</span>
744
- 93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_all_sessions</span>
745
- 94: <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>
746
- 95: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
747
- 96: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
748
- 97: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
749
- 98: <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> [])
750
- 99: <span class="ruby-identifier">sess</span> = <span class="ruby-identifier">sessions</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//session&quot;</span>)
751
- 100: <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">&quot;expected 2 sessions, got #{sess.length}&quot;</span>)
752
- 101: <span class="ruby-keyword kw">ensure</span>
753
- 102: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
754
- 103: <span class="ruby-keyword kw">end</span></pre>
755
- </div>
756
-
757
- </div>
758
-
759
-
760
-
761
-
762
- </div>
763
-
764
-
765
- <div id="test-cmd-ddt-get-set-channels-method" class="method-detail ">
766
- <a name="method-i-test_cmd_ddt_get_set_channels"></a>
767
-
768
- <div class="method-heading">
769
-
770
- <span class="method-name">test_cmd_ddt_get_set_channels</span><span
771
- class="method-args">()</span>
772
- <span class="method-click-advice">click to toggle source</span>
773
-
774
- </div>
775
-
776
- <div class="method-description">
777
-
778
-
779
-
780
-
781
-
782
- <div class="method-source-code"
783
- id="test-cmd-ddt-get-set-channels-source">
784
- <pre>
785
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 169</span>
786
- 169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_set_channels</span>
787
- 170: <span class="ruby-identifier">add_localhost_with_channel</span>
788
- 171: <span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">&quot;379a4cf8-8fe7-4d2d-8f6b-b8c6b71557b4&quot;</span> <span class="ruby-comment cmt"># ftp_with_channel</span>
789
- 172: <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>
790
- 173: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> [ <span class="ruby-value str">&quot;-v&quot;</span> ]
791
- 174: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
792
- 175: <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">&quot;/api/v3/&quot;</span>)
793
- 176: <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/ftp_with_channel.xml&quot;</span>))
794
- 177: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_load_scenario</span> [ <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">scenario_uuid</span> ]
795
- 178: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_setup_test</span> []
796
- 179: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_channels</span> []
797
- 180: <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>)
798
- 181: <span class="ruby-identifier">channels</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//channel&quot;</span>)
799
- 182: <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">&quot;expected 1 scenario channel, found #{channels.length}&quot;</span>
800
- 183: <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">&quot;-r&quot;</span>, <span class="ruby-value str">&quot;channel&quot;</span>, <span class="ruby-value str">&quot;-n&quot;</span>, <span class="ruby-value str">&quot;localhost&quot;</span> ]
801
- 184: <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>
802
- 185: <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>)
803
- 186: <span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//message&quot;</span>).<span class="ruby-identifier">text</span>
804
- 187: <span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;Bind channel successfully&quot;</span>) , <span class="ruby-node">&quot;expected 'Bind host successfully' but got #{message}&quot;</span>
805
- 188: <span class="ruby-keyword kw">end</span>
806
- 189: <span class="ruby-keyword kw">ensure</span>
807
- 190: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
808
- 191: <span class="ruby-keyword kw">end</span></pre>
809
- </div>
810
-
811
- </div>
812
-
813
-
814
-
815
-
816
- </div>
817
-
818
-
819
- <div id="test-cmd-ddt-get-set-hosts-method" class="method-detail ">
820
- <a name="method-i-test_cmd_ddt_get_set_hosts"></a>
821
-
822
- <div class="method-heading">
823
-
824
- <span class="method-name">test_cmd_ddt_get_set_hosts</span><span
825
- class="method-args">()</span>
826
- <span class="method-click-advice">click to toggle source</span>
827
-
828
- </div>
829
-
830
- <div class="method-description">
831
-
832
-
833
-
834
-
835
-
836
- <div class="method-source-code"
837
- id="test-cmd-ddt-get-set-hosts-source">
838
- <pre>
839
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 145</span>
840
- 145: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_set_hosts</span>
841
- 146: <span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">&quot;ef6fe3eb-4e9f-44b5-a99e-c431d82e4eeb&quot;</span>
842
- 147: <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>
843
- 148: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> [ <span class="ruby-value str">&quot;-v&quot;</span> ]
844
- 149: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
845
- 150: <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">&quot;/api/v3/&quot;</span>)
846
- 151: <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/data_cgi.xml&quot;</span>))
847
- 152: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_load_scenario</span> [ <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">scenario_uuid</span> ]
848
- 153: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_setup_test</span> []
849
- 154: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_hosts</span> []
850
- 155: <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>)
851
- 156: <span class="ruby-identifier">hosts</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//host&quot;</span>)
852
- 157: <span class="ruby-identifier">role</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//host/role&quot;</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">text</span>
853
- 158: <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">&quot;expected 2 scenario hosts, found #{hosts.length}&quot;</span>
854
- 159: <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">&quot;-r&quot;</span>, <span class="ruby-identifier">role</span>, <span class="ruby-value str">&quot;-n&quot;</span>, <span class="ruby-value str">&quot;a2&quot;</span> ]
855
- 160: <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>
856
- 161: <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>)
857
- 162: <span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//message&quot;</span>).<span class="ruby-identifier">text</span>
858
- 163: <span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;Bind host successfully&quot;</span>) , <span class="ruby-node">&quot;expected 'Bind host successfully' but got #{message}&quot;</span>
859
- 164: <span class="ruby-keyword kw">end</span>
860
- 165: <span class="ruby-keyword kw">ensure</span>
861
- 166: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
862
- 167: <span class="ruby-keyword kw">end</span></pre>
863
- </div>
864
-
865
- </div>
866
-
867
-
868
-
869
-
870
- </div>
871
-
872
-
873
- <div id="test-cmd-ddt-get-set-options-method" class="method-detail ">
874
- <a name="method-i-test_cmd_ddt_get_set_options"></a>
875
-
876
- <div class="method-heading">
877
-
878
- <span class="method-name">test_cmd_ddt_get_set_options</span><span
879
- class="method-args">()</span>
880
- <span class="method-click-advice">click to toggle source</span>
881
-
882
- </div>
883
-
884
- <div class="method-description">
885
-
886
-
887
-
888
-
889
-
890
- <div class="method-source-code"
891
- id="test-cmd-ddt-get-set-options-source">
892
- <pre>
893
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 120</span>
894
- 120: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_ddt_get_set_options</span>
895
- 121: <span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">&quot;ef6fe3eb-4e9f-44b5-a99e-c431d82e4eeb&quot;</span>
896
- 122: <span class="ruby-comment cmt">#test_set_uuid = &quot;49cd406e-a8ca-4360-a115-e7ac33e8034f&quot;</span>
897
- 123: <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>
898
- 124: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
899
- 125: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_new_session</span> []
900
- 126: <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">&quot;/api/v3/&quot;</span>)
901
- 127: <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/data_cgi.xml&quot;</span>))
902
- 128: <span class="ruby-comment cmt"># http_helper.post_xml(&quot;templates/import&quot;, File.read(&quot;#{Dir.pwd}/test/data/test_data_cgi_error.xml&quot;))</span>
903
- 129: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_load_scenario</span> [ <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">scenario_uuid</span> ]
904
- 130: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_setup_test</span> []
905
- 131: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get_options</span> []
906
- 132: <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>)
907
- 133: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//option/name&quot;</span>)
908
- 134: <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">&quot;expected 8 scenario options, found #{options.length}&quot;</span>
909
- 135: <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">&quot;-n&quot;</span>, <span class="ruby-value str">&quot;scenario_user_options.url&quot;</span>, <span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;hullo&quot;</span> ]
910
- 136: <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>
911
- 137: <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>)
912
- 138: <span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//message&quot;</span>).<span class="ruby-identifier">text</span>
913
- 139: <span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;Option set&quot;</span>) , <span class="ruby-node">&quot;expected 'Option set' but got #{message}&quot;</span>
914
- 140: <span class="ruby-keyword kw">end</span>
915
- 141: <span class="ruby-keyword kw">ensure</span>
916
- 142: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_close_all_sessions</span> []
917
- 143: <span class="ruby-keyword kw">end</span></pre>
918
- </div>
919
-
920
- </div>
921
-
922
-
923
-
924
-
925
- </div>
926
-
927
-
928
- <div id="test-cmd-muapi-analysis-method" class="method-detail ">
929
- <a name="method-i-test_cmd_muapi_analysis"></a>
930
-
931
- <div class="method-heading">
932
-
933
- <span class="method-name">test_cmd_muapi_analysis</span><span
934
- class="method-args">()</span>
935
- <span class="method-click-advice">click to toggle source</span>
936
-
937
- </div>
938
-
939
- <div class="method-description">
940
-
941
-
942
-
943
-
944
-
945
- <div class="method-source-code"
946
- id="test-cmd-muapi-analysis-source">
947
- <pre>
948
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 332</span>
949
- 332: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_analysis</span>
950
- 333: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
951
- 334: <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">&quot;/api/v3/&quot;</span>)
952
- 335: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/irc.xml&quot;</span>))
953
- 336: <span class="ruby-identifier">uuid</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//uuid&quot;</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">content</span>
954
- 337: <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>
955
- 338:
956
- 339: <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>
957
- 340: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
958
- 341: <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>)
959
- 342: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;RUNNING&quot;</span>, <span class="ruby-node">&quot;after RUN, expected status=RUNNING, got #{status}&quot;</span>)
960
- 343: <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>)
961
- 344: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
962
- 345: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
963
- 346: <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>)
964
- 347: <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-value str">&quot;SUSPENDED&quot;</span>
965
- 348: <span class="ruby-keyword kw">end</span>
966
- 349: <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>)
967
- 350: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
968
- 351: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
969
- 352: <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>)
970
- 353: <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-value str">&quot;RUNNING&quot;</span>
971
- 354: <span class="ruby-keyword kw">end</span>
972
- 355: <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">&quot;-s&quot;</span>, <span class="ruby-value str">&quot;running&quot;</span>]
973
- 356: <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">&quot;expected run_uuid #{run_uuid}in the list_by_status for running, but got #{list}&quot;</span>)
974
- 357: <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>)
975
- 358: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
976
- 359: <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>)
977
- 360: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;ABORTED&quot;</span>, <span class="ruby-node">&quot;after STOP, expected status=ABORTED, got #{status}&quot;</span>)
978
- 361: <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>
979
- 362: <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">&quot;irc_scenario_mugem&quot;</span>), <span class="ruby-node">&quot;expected name = irc_scenario_mugem but got #{name.value}&quot;</span>)
980
- 363: <span class="ruby-keyword kw">ensure</span>
981
- 364: <span class="ruby-keyword kw">begin</span>
982
- 365: <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>)
983
- 366: <span class="ruby-keyword kw">rescue</span>
984
- 367: <span class="ruby-comment cmt"># do nothing. probably already stopped</span>
985
- 368: <span class="ruby-keyword kw">end</span>
986
- 369: <span class="ruby-keyword kw">end</span></pre>
987
- </div>
988
-
989
- </div>
990
-
991
-
992
-
993
-
994
- </div>
995
-
996
-
997
- <div id="test-cmd-muapi-archive-method" class="method-detail ">
998
- <a name="method-i-test_cmd_muapi_archive"></a>
999
-
1000
- <div class="method-heading">
1001
-
1002
- <span class="method-name">test_cmd_muapi_archive</span><span
1003
- class="method-args">()</span>
1004
- <span class="method-click-advice">click to toggle source</span>
1005
-
1006
- </div>
1007
-
1008
- <div class="method-description">
1009
-
1010
-
1011
-
1012
-
1013
-
1014
- <div class="method-source-code"
1015
- id="test-cmd-muapi-archive-source">
1016
- <pre>
1017
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 379</span>
1018
- 379: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_archive</span>
1019
- 380: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
1020
- 381: <span class="ruby-comment cmt"># load it</span>
1021
- 382: <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">&quot;/api/v3/&quot;</span>)
1022
- 383: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/irc.xml&quot;</span>))
1023
- 384: <span class="ruby-identifier">uuid</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//uuid&quot;</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">content</span>
1024
- 385: <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>
1025
- 386:
1026
- 387: <span class="ruby-comment cmt"># run it</span>
1027
- 388: <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>
1028
- 389: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
1029
- 390: <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>)
1030
- 391: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;RUNNING&quot;</span>, <span class="ruby-node">&quot;after RUN, expected status=RUNNING, got #{status}&quot;</span>)
1031
- 392: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;RUNNING&quot;</span>
1032
- 393: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
1033
- 394: <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>)
1034
- 395: <span class="ruby-keyword kw">end</span>
1035
- 396:
1036
- 397: <span class="ruby-comment cmt"># archive it</span>
1037
- 398: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">&quot;-c&quot;</span>, <span class="ruby-value str">&quot;run&quot;</span>, <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">run_uuid</span> ]
1038
- 399: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
1039
- 400: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">&quot;-s&quot;</span>, <span class="ruby-value str">&quot;status&quot;</span>, <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">run_uuid</span> ]
1040
- 401:
1041
- 402: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
1042
- 403: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">&quot;-s&quot;</span>, <span class="ruby-value str">&quot;status&quot;</span>, <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">run_uuid</span> ]
1043
- 404: <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>
1044
- 405: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
1045
- 406: <span class="ruby-keyword kw">end</span>
1046
- 407:
1047
- 408: <span class="ruby-comment cmt"># now get it</span>
1048
- 409: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_archive</span> [<span class="ruby-value str">&quot;-c&quot;</span>, <span class="ruby-value str">&quot;get&quot;</span>, <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">run_uuid</span> ]
1049
- 410: <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">&quot;.zip&quot;</span>
1050
- 411: <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">&quot;did not find the expected file #{file_name}&quot;</span>)
1051
- 412: <span class="ruby-keyword kw">end</span></pre>
1052
- </div>
1053
-
1054
- </div>
1055
-
1056
-
1057
-
1058
-
1059
- </div>
1060
-
1061
-
1062
- <div id="test-cmd-muapi-capture-method" class="method-detail ">
1063
- <a name="method-i-test_cmd_muapi_capture"></a>
1064
-
1065
- <div class="method-heading">
1066
-
1067
- <span class="method-name">test_cmd_muapi_capture</span><span
1068
- class="method-args">()</span>
1069
- <span class="method-click-advice">click to toggle source</span>
1070
-
1071
- </div>
1072
-
1073
- <div class="method-description">
1074
-
1075
-
1076
-
1077
-
1078
-
1079
- <div class="method-source-code"
1080
- id="test-cmd-muapi-capture-source">
1081
- <pre>
1082
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 302</span>
1083
- 302: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_capture</span>
1084
- 303: <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>
1085
- 304: <span class="ruby-identifier">run_args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
1086
- 305: <span class="ruby-identifier">run_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-c&quot;</span>
1087
- 306: <span class="ruby-identifier">run_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;run&quot;</span>
1088
- 307: <span class="ruby-identifier">run_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-p&quot;</span>
1089
- 308: <span class="ruby-identifier">run_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;a1&quot;</span>
1090
- 309: <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>
1091
- 310: <span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
1092
- 311: <span class="ruby-identifier">status_args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
1093
- 312: <span class="ruby-identifier">status_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-c&quot;</span>
1094
- 313: <span class="ruby-identifier">status_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;status&quot;</span>
1095
- 314: <span class="ruby-identifier">status_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-p&quot;</span>
1096
- 315: <span class="ruby-identifier">status_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;a1&quot;</span>
1097
- 316: <span class="ruby-identifier">status_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-u&quot;</span>
1098
- 317: <span class="ruby-identifier">status_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">job_id</span>
1099
- 318: <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>
1100
- 319: <span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
1101
- 320: <span class="ruby-identifier">get_args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
1102
- 321: <span class="ruby-identifier">get_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-c&quot;</span>
1103
- 322: <span class="ruby-identifier">get_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;get&quot;</span>
1104
- 323: <span class="ruby-identifier">get_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-p&quot;</span>
1105
- 324: <span class="ruby-identifier">get_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;a1&quot;</span>
1106
- 325: <span class="ruby-identifier">get_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-u&quot;</span>
1107
- 326: <span class="ruby-identifier">get_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">job_id</span>
1108
- 327: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_capture</span> <span class="ruby-identifier">get_args</span>
1109
- 328: <span class="ruby-identifier">sleep</span> <span class="ruby-value">2</span>
1110
- 329: <span class="ruby-identifier">assert</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-node">&quot;#{job_id}.pcap&quot;</span>), <span class="ruby-node">&quot;expected to find #{job_id}.pcap but didn't&quot;</span>)
1111
- 330: <span class="ruby-keyword kw">end</span></pre>
1112
- </div>
1113
-
1114
- </div>
1115
-
1116
-
1117
-
1118
-
1119
- </div>
1120
-
1121
-
1122
- <div id="test-cmd-muapi-delete-method" class="method-detail ">
1123
- <a name="method-i-test_cmd_muapi_delete"></a>
1124
-
1125
- <div class="method-heading">
1126
-
1127
- <span class="method-name">test_cmd_muapi_delete</span><span
1128
- class="method-args">()</span>
1129
- <span class="method-click-advice">click to toggle source</span>
1130
-
1131
- </div>
1132
-
1133
- <div class="method-description">
1134
-
1135
-
1136
-
1137
-
1138
-
1139
- <div class="method-source-code"
1140
- id="test-cmd-muapi-delete-source">
1141
- <pre>
1142
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 414</span>
1143
- 414: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_delete</span>
1144
- 415: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG&quot;</span>
1145
- 416: <span class="ruby-comment cmt"># load it</span>
1146
- 417: <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">&quot;/api/v3/&quot;</span>)
1147
- 418: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/irc.xml&quot;</span>))
1148
- 419: <span class="ruby-identifier">uuid</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//uuid&quot;</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">content</span>
1149
- 420: <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>
1150
- 421:
1151
- 422: <span class="ruby-comment cmt"># run it</span>
1152
- 423: <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>
1153
- 424: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
1154
- 425: <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>)
1155
- 426: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;RUNNING&quot;</span>, <span class="ruby-node">&quot;after RUN, expected status=RUNNING, got #{status}&quot;</span>)
1156
- 427: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;RUNNING&quot;</span>
1157
- 428: <span class="ruby-identifier">sleep</span> <span class="ruby-value">5</span>
1158
- 429: <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>)
1159
- 430: <span class="ruby-keyword kw">end</span>
1160
- 431:
1161
- 432: <span class="ruby-comment cmt"># now delete it</span>
1162
- 433: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [ <span class="ruby-value str">&quot;-u&quot;</span>, <span class="ruby-identifier">run_uuid</span> ]
1163
- 434: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">status</span>
1164
- 435:
1165
- 436: <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>)
1166
- 437: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>.<span class="ruby-identifier">nil?</span>, <span class="ruby-node">&quot;expected status=nil, got #{status}&quot;</span>)
1167
- 438: <span class="ruby-keyword kw">end</span></pre>
1168
- </div>
1169
-
1170
- </div>
1171
-
1172
-
1173
-
1174
-
1175
- </div>
1176
-
1177
-
1178
- <div id="test-cmd-muapi-export-by-type-and-name-method" class="method-detail ">
1179
- <a name="method-i-test_cmd_muapi_export_by_type_and_name"></a>
1180
-
1181
- <div class="method-heading">
1182
-
1183
- <span class="method-name">test_cmd_muapi_export_by_type_and_name</span><span
1184
- class="method-args">()</span>
1185
- <span class="method-click-advice">click to toggle source</span>
1186
-
1187
- </div>
1188
-
1189
- <div class="method-description">
1190
-
1191
-
1192
-
1193
-
1194
-
1195
- <div class="method-source-code"
1196
- id="test-cmd-muapi-export-by-type-and-name-source">
1197
- <pre>
1198
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 293</span>
1199
- 293: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_export_by_type_and_name</span>
1200
- 294: <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>
1201
- 295: <span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">&quot;379a4cf8-8fe7-4d2d-8f6b-b8c6b71557b4&quot;</span> <span class="ruby-comment cmt"># ftp_with_channel</span>
1202
- 296: <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">&quot;/api/v3/&quot;</span>)
1203
- 297: <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/ftp_with_channel.xml&quot;</span>))
1204
- 298: <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">&quot;-n&quot;</span>, <span class="ruby-value str">&quot;ftp_with_channel&quot;</span>, <span class="ruby-value str">&quot;-t&quot;</span>, <span class="ruby-value str">&quot;scenario&quot;</span>]).<span class="ruby-identifier">to_s</span>
1205
- 299: <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">&quot;expected #{scenario_uuid} but did not find it&quot;</span>
1206
- 300: <span class="ruby-keyword kw">end</span></pre>
1207
- </div>
1208
-
1209
- </div>
1210
-
1211
-
1212
-
1213
-
1214
- </div>
1215
-
1216
-
1217
- <div id="test-cmd-muapi-export-by-uuid-method" class="method-detail ">
1218
- <a name="method-i-test_cmd_muapi_export_by_uuid"></a>
1219
-
1220
- <div class="method-heading">
1221
-
1222
- <span class="method-name">test_cmd_muapi_export_by_uuid</span><span
1223
- class="method-args">()</span>
1224
- <span class="method-click-advice">click to toggle source</span>
1225
-
1226
- </div>
1227
-
1228
- <div class="method-description">
1229
-
1230
-
1231
-
1232
-
1233
-
1234
- <div class="method-source-code"
1235
- id="test-cmd-muapi-export-by-uuid-source">
1236
- <pre>
1237
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 284</span>
1238
- 284: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_export_by_uuid</span>
1239
- 285: <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>
1240
- 286: <span class="ruby-identifier">scenario_uuid</span> = <span class="ruby-value str">&quot;379a4cf8-8fe7-4d2d-8f6b-b8c6b71557b4&quot;</span> <span class="ruby-comment cmt"># ftp_with_channel</span>
1241
- 287: <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">&quot;/api/v3/&quot;</span>)
1242
- 288: <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/ftp_with_channel.xml&quot;</span>))
1243
- 289: <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">&quot;-u&quot;</span>, <span class="ruby-identifier">scenario_uuid</span>]).<span class="ruby-identifier">to_s</span>
1244
- 290: <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">&quot;expected #{scenario_uuid} but did not find it&quot;</span>
1245
- 291: <span class="ruby-keyword kw">end</span></pre>
1246
- </div>
1247
-
1248
- </div>
1249
-
1250
-
1251
-
1252
-
1253
- </div>
1254
-
1255
-
1256
- <div id="test-cmd-muapi-types-method" class="method-detail ">
1257
- <a name="method-i-test_cmd_muapi_types"></a>
1258
-
1259
- <div class="method-heading">
1260
-
1261
- <span class="method-name">test_cmd_muapi_types</span><span
1262
- class="method-args">()</span>
1263
- <span class="method-click-advice">click to toggle source</span>
1264
-
1265
- </div>
1266
-
1267
- <div class="method-description">
1268
-
1269
- <p>
1270
- &#8212;&#8212;&#8212;&#8212;&#8212; cmd_muapi &#8212;&#8212;&#8212;&#8212;
1271
- </p>
1272
-
1273
-
1274
-
1275
- <div class="method-source-code"
1276
- id="test-cmd-muapi-types-source">
1277
- <pre>
1278
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 278</span>
1279
- 278: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_muapi_types</span>
1280
- 279: <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>
1281
- 280: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_types</span> []
1282
- 281: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;scenario&quot;</span>), <span class="ruby-node">&quot;expected scenario got #{response}&quot;</span>)
1283
- 282: <span class="ruby-keyword kw">end</span></pre>
1284
- </div>
1285
-
1286
- </div>
1287
-
1288
-
1289
-
1290
-
1291
- </div>
1292
-
1293
-
1294
- <div id="test-cmd-netconfig-add-modify-delete-route-method" class="method-detail ">
1295
- <a name="method-i-test_cmd_netconfig_add_modify_delete_route"></a>
1296
-
1297
- <div class="method-heading">
1298
-
1299
- <span class="method-name">test_cmd_netconfig_add_modify_delete_route</span><span
1300
- class="method-args">()</span>
1301
- <span class="method-click-advice">click to toggle source</span>
1302
-
1303
- </div>
1304
-
1305
- <div class="method-description">
1306
-
1307
-
1308
-
1309
-
1310
-
1311
- <div class="method-source-code"
1312
- id="test-cmd-netconfig-add-modify-delete-route-source">
1313
- <pre>
1314
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 508</span>
1315
- 508: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_add_modify_delete_route</span>
1316
- 509: <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;assumes a1 on 192.168.30.x subnet and a router at 192.168.30.247&quot;</span>
1317
- 510: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
1318
- 511: <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>
1319
- 512: <span class="ruby-identifier">system</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;system&quot;</span>]
1320
- 513: <span class="ruby-comment cmt"># delete route if if already existsname&quot;] ==</span>
1321
- 514: <span class="ruby-keyword kw">begin</span>
1322
- 515: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;routes/192.168.100.0-192.168.30.247-a1&quot;</span>]
1323
- 516: <span class="ruby-keyword kw">rescue</span>
1324
- 517: <span class="ruby-comment cmt"># do nothing. route may not exists</span>
1325
- 518: <span class="ruby-keyword kw">end</span>
1326
- 519: <span class="ruby-comment cmt"># turn dhcp on</span>
1327
- 520: <span class="ruby-identifier">dhcp</span> = {<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;a1&quot;</span>,<span class="ruby-value str">&quot;v4_dhcp&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;Enabled&quot;</span>}
1328
- 521: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-identifier">dhcp</span>, <span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/a1&quot;</span>]
1329
- 522: <span class="ruby-identifier">sleep</span> <span class="ruby-value">3</span>
1330
- 523: <span class="ruby-identifier">g</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/a1&quot;</span>]
1331
- 524: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">g</span>[<span class="ruby-value str">&quot;v4_addrs&quot;</span>][<span class="ruby-value str">&quot;begin&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;192.168.30&quot;</span>),<span class="ruby-value str">&quot;A1 DHCP failed&quot;</span>)
1332
- 525: <span class="ruby-identifier">new_route</span> = {<span class="ruby-value str">&quot;interface&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;a1&quot;</span>, <span class="ruby-value str">&quot;dst&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;192.168.100.0&quot;</span>, <span class="ruby-value str">&quot;gateway&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;192.168.30.247&quot;</span>, <span class="ruby-value str">&quot;dst_pfx_len&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">24</span>}
1333
- 526: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_create</span> [<span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-identifier">new_route</span>, <span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;routes&quot;</span>]
1334
- 527: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;192.168.100.0-192.168.30.247-a1 created.&quot;</span>), <span class="ruby-identifier">response</span>) <span class="ruby-comment cmt"># not sure what this will be</span>
1335
- 528: <span class="ruby-identifier">update_mask</span> = {<span class="ruby-value str">&quot;dst_pfx_len&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value">24</span>}
1336
- 529: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-identifier">update_mask</span>, <span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;routes/192.168.100.0-192.168.30.247-a1&quot;</span>]
1337
- 530: <span class="ruby-keyword kw">ensure</span>
1338
- 531: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;routes/192.168.100.0-192.168.30.247-a1&quot;</span>]
1339
- 532: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;deleted&quot;</span>),<span class="ruby-identifier">response</span>)
1340
- 533: <span class="ruby-keyword kw">end</span></pre>
1341
- </div>
1342
-
1343
- </div>
1344
-
1345
-
1346
-
1347
-
1348
- </div>
1349
-
1350
-
1351
- <div id="test-cmd-netconfig-create-delete-host-method" class="method-detail ">
1352
- <a name="method-i-test_cmd_netconfig_create_delete_host"></a>
1353
-
1354
- <div class="method-heading">
1355
-
1356
- <span class="method-name">test_cmd_netconfig_create_delete_host</span><span
1357
- class="method-args">()</span>
1358
- <span class="method-click-advice">click to toggle source</span>
1359
-
1360
- </div>
1361
-
1362
- <div class="method-description">
1363
-
1364
-
1365
-
1366
-
1367
-
1368
- <div class="method-source-code"
1369
- id="test-cmd-netconfig-create-delete-host-source">
1370
- <pre>
1371
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 499</span>
1372
- 499: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_create_delete_host</span>
1373
- 500: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
1374
- 501: <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>
1375
- 502: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_create</span> [<span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-value str">'{&quot;name&quot;=&gt;&quot;deleteme&quot;,&quot;v4_addr&quot;=&gt;&quot;192.168.30.9&quot;}'</span>, <span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;hosts&quot;</span>]
1376
- 503: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;created&quot;</span>), <span class="ruby-value str">&quot;Failed to create host:&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">to_s</span>)
1377
- 504: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;hosts/deleteme&quot;</span>]
1378
- 505: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;deleted&quot;</span>), <span class="ruby-value str">&quot;Failed to delete host:&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">to_s</span>)
1379
- 506: <span class="ruby-keyword kw">end</span></pre>
1380
- </div>
1381
-
1382
- </div>
1383
-
1384
-
1385
-
1386
-
1387
- </div>
1388
-
1389
-
1390
- <div id="test-cmd-netconfig-get-interfaces-a--method" class="method-detail ">
1391
- <a name="method-i-test_cmd_netconfig_get_interfaces_a1"></a>
1392
-
1393
- <div class="method-heading">
1394
-
1395
- <span class="method-name">test_cmd_netconfig_get_interfaces_a1</span><span
1396
- class="method-args">()</span>
1397
- <span class="method-click-advice">click to toggle source</span>
1398
-
1399
- </div>
1400
-
1401
- <div class="method-description">
1402
-
1403
- <p>
1404
- &#8212;&#8212;&#8212;&#8212;&#8212; cmd_netfconfig &#8212;&#8212;-
1405
- </p>
1406
-
1407
-
1408
-
1409
- <div class="method-source-code"
1410
- id="test-cmd-netconfig-get-interfaces-a--source">
1411
- <pre>
1412
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 462</span>
1413
- 462: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_get_interfaces_a1</span>
1414
- 463: <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>
1415
- 464: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/a1&quot;</span>]
1416
- 465: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>[<span class="ruby-value str">&quot;display_name&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;A1&quot;</span>, <span class="ruby-node">&quot;expected A1 got #{response[&quot;display_name&quot;]}&quot;</span>)
1417
- 466: <span class="ruby-keyword kw">end</span></pre>
1418
- </div>
1419
-
1420
- </div>
1421
-
1422
-
1423
-
1424
-
1425
- </div>
1426
-
1427
-
1428
- <div id="test-cmd-netconfig-modify-interfaces-a--method" class="method-detail ">
1429
- <a name="method-i-test_cmd_netconfig_modify_interfaces_a1"></a>
1430
-
1431
- <div class="method-heading">
1432
-
1433
- <span class="method-name">test_cmd_netconfig_modify_interfaces_a1</span><span
1434
- class="method-args">()</span>
1435
- <span class="method-click-advice">click to toggle source</span>
1436
-
1437
- </div>
1438
-
1439
- <div class="method-description">
1440
-
1441
-
1442
-
1443
-
1444
-
1445
- <div class="method-source-code"
1446
- id="test-cmd-netconfig-modify-interfaces-a--source">
1447
- <pre>
1448
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 468</span>
1449
- 468: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_modify_interfaces_a1</span>
1450
- 469: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
1451
- 470: <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>
1452
- 471: <span class="ruby-identifier">saved</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/a1&quot;</span>]
1453
- 472: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">saved</span>[<span class="ruby-value str">&quot;display_name&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;A1&quot;</span>, <span class="ruby-node">&quot;expected A1 got #{saved[&quot;display_name&quot;]}&quot;</span>)
1454
- 473: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/a1&quot;</span>, <span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-value str">'{&quot;v4_dhcp&quot;=&gt;false}'</span>]
1455
- 474: <span class="ruby-identifier">sleep</span> <span class="ruby-value">3</span>
1456
- 475: <span class="ruby-identifier">modified</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/a1&quot;</span>]
1457
- 476: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">modified</span>[<span class="ruby-value str">&quot;v4_dhcp&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-value str">&quot;expected dhcp false but it wasn't&quot;</span>)
1458
- 477: <span class="ruby-keyword kw">ensure</span>
1459
- 478: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/a1&quot;</span>, <span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-value str">'{&quot;v4_dhcp&quot;=&gt;true}'</span>]
1460
- 479: <span class="ruby-keyword kw">end</span></pre>
1461
- </div>
1462
-
1463
- </div>
1464
-
1465
-
1466
-
1467
-
1468
- </div>
1469
-
1470
-
1471
- <div id="test-cmd-netconfig-resolve-hosts-method" class="method-detail ">
1472
- <a name="method-i-test_cmd_netconfig_resolve_hosts"></a>
1473
-
1474
- <div class="method-heading">
1475
-
1476
- <span class="method-name">test_cmd_netconfig_resolve_hosts</span><span
1477
- class="method-args">()</span>
1478
- <span class="method-click-advice">click to toggle source</span>
1479
-
1480
- </div>
1481
-
1482
- <div class="method-description">
1483
-
1484
-
1485
-
1486
-
1487
-
1488
- <div class="method-source-code"
1489
- id="test-cmd-netconfig-resolve-hosts-source">
1490
- <pre>
1491
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 535</span>
1492
- 535: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_resolve_hosts</span>
1493
- 536: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
1494
- 537: <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>
1495
- 538: <span class="ruby-identifier">add_localhost_with_channel</span>
1496
- 539: <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">&quot;-n&quot;</span>, <span class="ruby-value str">&quot;localhost&quot;</span>]
1497
- 540: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;hosts/localhost&quot;</span>]
1498
- 541: <span class="ruby-identifier">assert</span> <span class="ruby-identifier">response</span>[<span class="ruby-value str">&quot;name&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;localhost&quot;</span>, <span class="ruby-node">&quot;expected to find localhost but found #{response[&quot;name&quot;]}&quot;</span>
1499
- 542: <span class="ruby-keyword kw">end</span></pre>
1500
- </div>
1501
-
1502
- </div>
1503
-
1504
-
1505
-
1506
-
1507
- </div>
1508
-
1509
-
1510
- <div id="test-cmd-netconfig-save-method" class="method-detail ">
1511
- <a name="method-i-test_cmd_netconfig_save"></a>
1512
-
1513
- <div class="method-heading">
1514
-
1515
- <span class="method-name">test_cmd_netconfig_save</span><span
1516
- class="method-args">()</span>
1517
- <span class="method-click-advice">click to toggle source</span>
1518
-
1519
- </div>
1520
-
1521
- <div class="method-description">
1522
-
1523
-
1524
-
1525
-
1526
-
1527
- <div class="method-source-code"
1528
- id="test-cmd-netconfig-save-source">
1529
- <pre>
1530
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 544</span>
1531
- 544: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_save</span>
1532
- 545: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
1533
- 546: <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>
1534
- 547: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;save.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;save.json&quot;</span>)
1535
- 548: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_save</span> [<span class="ruby-value str">&quot;-f&quot;</span>, <span class="ruby-value str">&quot;save.json&quot;</span>]
1536
- 549: <span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;save.json&quot;</span>), <span class="ruby-value str">&quot;wxpected for find file 'save.json but did not&quot;</span>)
1537
- 550: <span class="ruby-keyword kw">ensure</span>
1538
- 551: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;save.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;save.json&quot;</span>)
1539
- 552: <span class="ruby-keyword kw">end</span></pre>
1540
- </div>
1541
-
1542
- </div>
1543
-
1544
-
1545
-
1546
-
1547
- </div>
1548
-
1549
-
1550
- <div id="test-cmd-netconfig-vlans-method" class="method-detail ">
1551
- <a name="method-i-test_cmd_netconfig_vlans"></a>
1552
-
1553
- <div class="method-heading">
1554
-
1555
- <span class="method-name">test_cmd_netconfig_vlans</span><span
1556
- class="method-args">()</span>
1557
- <span class="method-click-advice">click to toggle source</span>
1558
-
1559
- </div>
1560
-
1561
- <div class="method-description">
1562
-
1563
-
1564
-
1565
-
1566
-
1567
- <div class="method-source-code"
1568
- id="test-cmd-netconfig-vlans-source">
1569
- <pre>
1570
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 481</span>
1571
- 481: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_netconfig_vlans</span>
1572
- 482: <span class="ruby-comment cmt"># $log.level = Logger::DEBUG</span>
1573
- 483: <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>
1574
- 484: <span class="ruby-keyword kw">begin</span>
1575
- 485: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/b1.222&quot;</span>]
1576
- 486: <span class="ruby-keyword kw">rescue</span>
1577
- 487: <span class="ruby-comment cmt"># ignore. the vlan probably did not exist</span>
1578
- 488: <span class="ruby-keyword kw">end</span>
1579
- 489: <span class="ruby-identifier">vlan_222</span> = {<span class="ruby-value str">&quot;v4_addrs&quot;</span>=<span class="ruby-operator">&gt;</span>[<span class="ruby-value str">&quot;2.2.2.2&quot;</span>],<span class="ruby-value str">&quot;v4_mask&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;26&quot;</span>,<span class="ruby-value str">&quot;v6_addrs&quot;</span>=<span class="ruby-operator">&gt;</span>[<span class="ruby-value str">&quot;2222:0:0:0:0:0:0:2&quot;</span>],<span class="ruby-value str">&quot;v6_mask&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;64&quot;</span>}
1580
- 490: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_create</span> [<span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-value str">'{&quot;name&quot;=&gt;&quot;b1&quot;,&quot;vlan&quot;=&gt;&quot;222&quot;}'</span>, <span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces&quot;</span> ]
1581
- 491: <span class="ruby-identifier">sleep</span> <span class="ruby-value">3</span>
1582
- 492: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_modify</span> [ <span class="ruby-value str">&quot;-j&quot;</span>, <span class="ruby-identifier">vlan_222</span>, <span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/b1.222&quot;</span>]
1583
- 493: <span class="ruby-identifier">b1</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_get</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/b1.222&quot;</span>]
1584
- 494: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">b1</span>[<span class="ruby-value str">&quot;v4_addrs&quot;</span>][<span class="ruby-value str">&quot;begin&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;2.2.2.2&quot;</span>,<span class="ruby-node">&quot;vlan v4_addrs incorrect: #{b1[&quot;v4_addrs&quot;][&quot;begin&quot;]}&quot;</span>)
1585
- 495: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_delete</span> [<span class="ruby-value str">&quot;-e&quot;</span>, <span class="ruby-value str">&quot;interfaces/b1.222&quot;</span>]
1586
- 496: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;deleted&quot;</span>), <span class="ruby-value str">&quot;Failed to delete host:&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">response</span>)
1587
- 497: <span class="ruby-keyword kw">end</span></pre>
1588
- </div>
1589
-
1590
- </div>
1591
-
1592
-
1593
-
1594
-
1595
- </div>
1596
-
1597
-
1598
- <div id="test-cmd-runscale-run-dir-method" class="method-detail ">
1599
- <a name="method-i-test_cmd_runscale_run_dir"></a>
1600
-
1601
- <div class="method-heading">
1602
-
1603
- <span class="method-name">test_cmd_runscale_run_dir</span><span
1604
- class="method-args">()</span>
1605
- <span class="method-click-advice">click to toggle source</span>
1606
-
1607
- </div>
1608
-
1609
- <div class="method-description">
1610
-
1611
- <p>
1612
- use ip range setting and a brief pattern
1613
- </p>
1614
-
1615
-
1616
-
1617
- <div class="method-source-code"
1618
- id="test-cmd-runscale-run-dir-source">
1619
- <pre>
1620
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 588</span>
1621
- 588: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runscale_run_dir</span>
1622
- 589: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>)
1623
- 590: <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>
1624
- 591: <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
1625
- 592: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-d&quot;</span>
1626
- 593: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data&quot;</span>
1627
- 594: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-i&quot;</span>
1628
- 595: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;b1-10000,b2&quot;</span>
1629
- 596: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-p&quot;</span>
1630
- 597: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;1-100:10&quot;</span>
1631
- 598: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_dir</span> <span class="ruby-identifier">args</span>
1632
- 599: <span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>), <span class="ruby-value str">&quot;app_id_status.json file was not created&quot;</span>)
1633
- 600: <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">&quot;app_id_status.json&quot;</span>)
1634
- 601: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">&quot;status&quot;</span>]
1635
- 602: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;duration&quot;</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">&quot;expected summary duration &gt; 10, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;duration&quot;]}&quot;</span>)
1636
- 603: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;instances&quot;</span>][<span class="ruby-value str">&quot;executed&quot;</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>, <span class="ruby-node">&quot;expected instances executed &gt; 0, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;instances&quot;][&quot;executed&quot;]}&quot;</span>)
1637
- 604: <span class="ruby-keyword kw">end</span></pre>
1638
- </div>
1639
-
1640
- </div>
1641
-
1642
-
1643
-
1644
-
1645
- </div>
1646
-
1647
-
1648
- <div id="test-cmd-runscale-run-file-method" class="method-detail ">
1649
- <a name="method-i-test_cmd_runscale_run_file"></a>
1650
-
1651
- <div class="method-heading">
1652
-
1653
- <span class="method-name">test_cmd_runscale_run_file</span><span
1654
- class="method-args">()</span>
1655
- <span class="method-click-advice">click to toggle source</span>
1656
-
1657
- </div>
1658
-
1659
- <div class="method-description">
1660
-
1661
- <p>
1662
- use ip range setting and a brief pattern
1663
- </p>
1664
-
1665
-
1666
-
1667
- <div class="method-source-code"
1668
- id="test-cmd-runscale-run-file-source">
1669
- <pre>
1670
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 565</span>
1671
- 565: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runscale_run_file</span>
1672
- 566: <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>)
1673
- 567: <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>
1674
- 568: <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
1675
- 569: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-s&quot;</span>
1676
- 570: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data/data_cgi.msl&quot;</span>
1677
- 571: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-i&quot;</span>
1678
- 572: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;b1-10000,b2&quot;</span>
1679
- 573: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-p&quot;</span>
1680
- 574: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;1-100:20&quot;</span>
1681
- 575: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-a&quot;</span> <span class="ruby-comment cmt"># vector address pairing</span>
1682
- 576: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-c&quot;</span>
1683
- 577: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data/default_test.csv&quot;</span>
1684
- 578: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run_file</span> <span class="ruby-identifier">args</span>
1685
- 579: <span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-value str">&quot;app_id_status.json&quot;</span>), <span class="ruby-value str">&quot;app_id_status.json file was not created&quot;</span>)
1686
- 580: <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">&quot;app_id_status.json&quot;</span>)
1687
- 581: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">j</span>[<span class="ruby-value str">&quot;status&quot;</span>]
1688
- 582: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;duration&quot;</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">10.0</span>, <span class="ruby-node">&quot;expected summary duration &gt; 10, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;duration&quot;]}&quot;</span>)
1689
- 583: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">status</span>[<span class="ruby-value str">&quot;statistics&quot;</span>][<span class="ruby-value str">&quot;summary&quot;</span>][<span class="ruby-value str">&quot;instances&quot;</span>][<span class="ruby-value str">&quot;executed&quot;</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">10</span>, <span class="ruby-node">&quot;expected instances executed &gt; 0, but got #{status[&quot;statistics&quot;][&quot;summary&quot;][&quot;instances&quot;][&quot;executed&quot;]}&quot;</span>)
1690
- 584: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">peak_concurrency</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>, <span class="ruby-node">&quot;expected peak_concurrency = 1 due to vectorAddressPairing, but got #{app.peak_concurrency}&quot;</span>)
1691
- 585: <span class="ruby-keyword kw">end</span></pre>
1692
- </div>
1693
-
1694
- </div>
1695
-
1696
-
1697
-
1698
-
1699
- </div>
1700
-
1701
-
1702
- <div id="test-cmd-runscenario-method" class="method-detail ">
1703
- <a name="method-i-test_cmd_runscenario"></a>
1704
-
1705
- <div class="method-heading">
1706
-
1707
- <span class="method-name">test_cmd_runscenario</span><span
1708
- class="method-args">()</span>
1709
- <span class="method-click-advice">click to toggle source</span>
1710
-
1711
- </div>
1712
-
1713
- <div class="method-description">
1714
-
1715
- <p>
1716
- &#8212;&#8212;&#8212;&#8212;&#8212; cmd_runscenario &#8212;&#8212;&#8212;-
1717
- </p>
1718
-
1719
-
1720
-
1721
- <div class="method-source-code"
1722
- id="test-cmd-runscenario-source">
1723
- <pre>
1724
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 609</span>
1725
- 609: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runscenario</span>
1726
- 610: <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>
1727
- 611: <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
1728
- 612: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-s&quot;</span>
1729
- 613: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data/data_cgi.xml&quot;</span>
1730
- 614: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-i&quot;</span>
1731
- 615: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;b1,b2&quot;</span>
1732
- 616: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-v&quot;</span>
1733
- 617: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">args</span>
1734
- 618: <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">&quot;expected 0 errors but got #{app.errors}&quot;</span>)
1735
- 619: <span class="ruby-keyword kw">end</span></pre>
1736
- </div>
1737
-
1738
- </div>
1739
-
1740
-
1741
-
1742
-
1743
- </div>
1744
-
1745
-
1746
- <div id="test-cmd-runverify-method" class="method-detail ">
1747
- <a name="method-i-test_cmd_runverify"></a>
1748
-
1749
- <div class="method-heading">
1750
-
1751
- <span class="method-name">test_cmd_runverify</span><span
1752
- class="method-args">()</span>
1753
- <span class="method-click-advice">click to toggle source</span>
1754
-
1755
- </div>
1756
-
1757
- <div class="method-description">
1758
-
1759
- <p>
1760
- &#8212;&#8212;&#8212;&#8212;&#8212; cmd_runverify
1761
- &#8212;&#8212;&#8212;&#8212;
1762
- </p>
1763
-
1764
-
1765
-
1766
- <div class="method-source-code"
1767
- id="test-cmd-runverify-source">
1768
- <pre>
1769
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 624</span>
1770
- 624: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_runverify</span>
1771
- 625: <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>
1772
- 626: <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
1773
- 627: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-s&quot;</span>
1774
- 628: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data/data_cgi.xml&quot;</span>
1775
- 629: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-t&quot;</span>
1776
- 630: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{Dir.pwd}/test/data/default_test.csv&quot;</span>
1777
- 631: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-i&quot;</span>
1778
- 632: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;b1,b2&quot;</span>
1779
- 633: <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-v&quot;</span>
1780
- 634: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">args</span>
1781
- 635: <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">&quot;expected 0 errors but got #{app.errors.size}&quot;</span>)
1782
- 636: <span class="ruby-keyword kw">end</span></pre>
1783
- </div>
1784
-
1785
- </div>
1786
-
1787
-
1788
-
1789
-
1790
- </div>
1791
-
1792
-
1793
- <div id="test-cmd-system-status-method" class="method-detail ">
1794
- <a name="method-i-test_cmd_system_status"></a>
1795
-
1796
- <div class="method-heading">
1797
-
1798
- <span class="method-name">test_cmd_system_status</span><span
1799
- class="method-args">()</span>
1800
- <span class="method-click-advice">click to toggle source</span>
1801
-
1802
- </div>
1803
-
1804
- <div class="method-description">
1805
-
1806
- <p>
1807
- do NOT write a test for cmd_system:restart please!
1808
- </p>
1809
-
1810
-
1811
-
1812
- <div class="method-source-code"
1813
- id="test-cmd-system-status-source">
1814
- <pre>
1815
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 684</span>
1816
- 684: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_system_status</span>
1817
- 685: <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>
1818
- 686: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status</span> []
1819
- 687: <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>)
1820
- 688: <span class="ruby-identifier">ports</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//ports&quot;</span>)
1821
- 689: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">ports</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">5</span>, <span class="ruby-node">&quot;expected to find at least 5 ports, but got #{ports.length}&quot;</span>)
1822
- 690: <span class="ruby-keyword kw">end</span></pre>
1823
- </div>
1824
-
1825
- </div>
1826
-
1827
-
1828
-
1829
-
1830
- </div>
1831
-
1832
-
1833
- <div id="test-cmd-system-status--method" class="method-detail ">
1834
- <a name="method-i-test_cmd_system_status2"></a>
1835
-
1836
- <div class="method-heading">
1837
-
1838
- <span class="method-name">test_cmd_system_status2</span><span
1839
- class="method-args">()</span>
1840
- <span class="method-click-advice">click to toggle source</span>
1841
-
1842
- </div>
1843
-
1844
- <div class="method-description">
1845
-
1846
-
1847
-
1848
-
1849
-
1850
- <div class="method-source-code"
1851
- id="test-cmd-system-status--source">
1852
- <pre>
1853
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 692</span>
1854
- 692: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cmd_system_status2</span>
1855
- 693: <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>
1856
- 694: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">cmd_status2</span> []
1857
- 695: <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">&quot;raid&quot;</span>), <span class="ruby-node">&quot;expected to find 'raid' in results, but got #{result}&quot;</span>)
1858
- 696: <span class="ruby-keyword kw">end</span></pre>
1859
- </div>
1860
-
1861
- </div>
1862
-
1863
-
1864
-
1865
-
1866
- </div>
1867
-
1868
-
1869
- <div id="test-ddt-close-all-sessions-method" class="method-detail ">
1870
- <a name="method-i-test_ddt_close_all_sessions"></a>
1871
-
1872
- <div class="method-heading">
1873
-
1874
- <span class="method-name">test_ddt_close_all_sessions</span><span
1875
- class="method-args">()</span>
1876
- <span class="method-click-advice">click to toggle source</span>
1877
-
1878
- </div>
1879
-
1880
- <div class="method-description">
1881
-
1882
-
1883
-
1884
-
1885
-
1886
- <div class="method-source-code"
1887
- id="test-ddt-close-all-sessions-source">
1888
- <pre>
1889
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 212</span>
1890
- 212: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_close_all_sessions</span>
1891
- 213: <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>)
1892
- 214: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
1893
- 215: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
1894
- 216: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
1895
- 217: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">close_all_sessions</span>
1896
- 218: <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>)
1897
- 219: <span class="ruby-identifier">sess</span> = <span class="ruby-identifier">sessions</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//session&quot;</span>)
1898
- 220: <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">&quot;expected 0 sessions, got #{sess.length}&quot;</span>)
1899
- 221: <span class="ruby-keyword kw">end</span></pre>
1900
- </div>
1901
-
1902
- </div>
1903
-
1904
-
1905
-
1906
-
1907
- </div>
1908
-
1909
-
1910
- <div id="test-ddt-get-all-sessions-method" class="method-detail ">
1911
- <a name="method-i-test_ddt_get_all_sessions"></a>
1912
-
1913
- <div class="method-heading">
1914
-
1915
- <span class="method-name">test_ddt_get_all_sessions</span><span
1916
- class="method-args">()</span>
1917
- <span class="method-click-advice">click to toggle source</span>
1918
-
1919
- </div>
1920
-
1921
- <div class="method-description">
1922
-
1923
-
1924
-
1925
-
1926
-
1927
- <div class="method-source-code"
1928
- id="test-ddt-get-all-sessions-source">
1929
- <pre>
1930
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 201</span>
1931
- 201: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_get_all_sessions</span>
1932
- 202: <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>)
1933
- 203: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
1934
- 204: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
1935
- 205: <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>)
1936
- 206: <span class="ruby-identifier">sess</span> = <span class="ruby-identifier">sessions</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//session&quot;</span>)
1937
- 207: <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">&quot;expected 2 sessions, got #{sess.length}&quot;</span>)
1938
- 208: <span class="ruby-keyword kw">ensure</span>
1939
- 209: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">close_all_sessions</span>
1940
- 210: <span class="ruby-keyword kw">end</span></pre>
1941
- </div>
1942
-
1943
- </div>
1944
-
1945
-
1946
-
1947
-
1948
- </div>
1949
-
1950
-
1951
- <div id="test-ddt-new-method" class="method-detail ">
1952
- <a name="method-i-test_ddt_new"></a>
1953
-
1954
- <div class="method-heading">
1955
-
1956
- <span class="method-name">test_ddt_new</span><span
1957
- class="method-args">()</span>
1958
- <span class="method-click-advice">click to toggle source</span>
1959
-
1960
- </div>
1961
-
1962
- <div class="method-description">
1963
-
1964
- <p>
1965
- &#8212;&#8212;&#8212;&#8212;&#8212; ddt
1966
- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
1967
- </p>
1968
-
1969
-
1970
-
1971
- <div class="method-source-code"
1972
- id="test-ddt-new-source">
1973
- <pre>
1974
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 195</span>
1975
- 195: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_new</span>
1976
- 196: <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>)
1977
- 197: <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">&quot;failed to set mu_ip&quot;</span>)
1978
- 198: <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">&quot;/api/v5/ddt/&quot;</span>, <span class="ruby-value str">&quot;failed to set docroot&quot;</span>)
1979
- 199: <span class="ruby-keyword kw">end</span></pre>
1980
- </div>
1981
-
1982
- </div>
1983
-
1984
-
1985
-
1986
-
1987
- </div>
1988
-
1989
-
1990
- <div id="test-ddt-set-hosts-method" class="method-detail ">
1991
- <a name="method-i-test_ddt_set_hosts"></a>
1992
-
1993
- <div class="method-heading">
1994
-
1995
- <span class="method-name">test_ddt_set_hosts</span><span
1996
- class="method-args">()</span>
1997
- <span class="method-click-advice">click to toggle source</span>
1998
-
1999
- </div>
2000
-
2001
- <div class="method-description">
2002
-
2003
-
2004
-
2005
-
2006
-
2007
- <div class="method-source-code"
2008
- id="test-ddt-set-hosts-source">
2009
- <pre>
2010
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 223</span>
2011
- 223: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_ddt_set_hosts</span>
2012
- 224: <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>
2013
- 225: <span class="ruby-identifier">data_cgi_uuid</span> = <span class="ruby-value str">&quot;ef6fe3eb-4e9f-44b5-a99e-c431d82e4eeb&quot;</span>
2014
- 226: <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>)
2015
- 227: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">new_session</span>
2016
- 228: <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">&quot;/api/v3/&quot;</span>)
2017
- 229: <span class="ruby-identifier">http_helper</span>.<span class="ruby-identifier">post_xml</span>(<span class="ruby-value str">&quot;templates/import&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">&quot;#{Dir.pwd}/test/data/data_cgi.xml&quot;</span>))
2018
- 230: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">load_scenario</span>(<span class="ruby-identifier">data_cgi_uuid</span>)
2019
- 231: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">setup_test</span>
2020
- 232: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">set_hosts</span>( [<span class="ruby-value str">&quot;192.168.40.217&quot;</span>,<span class="ruby-value str">&quot;192.168.40.9&quot;</span>], [<span class="ruby-value str">&quot;a1&quot;</span>, <span class="ruby-value str">&quot;a2&quot;</span>] )
2021
- 233: <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>
2022
- 234: <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>)
2023
- 235: <span class="ruby-identifier">message</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xpath</span>(<span class="ruby-value str">&quot;//message&quot;</span>).<span class="ruby-identifier">text</span>
2024
- 236: <span class="ruby-identifier">assert</span> <span class="ruby-identifier">message</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;Bind host successfully&quot;</span>) , <span class="ruby-node">&quot;expected 'Bind host successfully' but got #{message}&quot;</span>
2025
- 237: <span class="ruby-keyword kw">end</span>
2026
- 238: <span class="ruby-keyword kw">ensure</span>
2027
- 239: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">close_all_sessions</span>
2028
- 240: <span class="ruby-keyword kw">end</span></pre>
2029
- </div>
2030
-
2031
- </div>
2032
-
2033
-
2034
-
2035
-
2036
- </div>
2037
-
2038
-
2039
- <div id="test-homepage-all-method" class="method-detail ">
2040
- <a name="method-i-test_homepage_all"></a>
2041
-
2042
- <div class="method-heading">
2043
-
2044
- <span class="method-name">test_homepage_all</span><span
2045
- class="method-args">()</span>
2046
- <span class="method-click-advice">click to toggle source</span>
2047
-
2048
- </div>
2049
-
2050
- <div class="method-description">
2051
-
2052
-
2053
-
2054
-
2055
-
2056
- <div class="method-source-code"
2057
- id="test-homepage-all-source">
2058
- <pre>
2059
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 256</span>
2060
- 256: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_all</span>
2061
- 257: <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>
2062
- 258: <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> []
2063
- 259: <span class="ruby-identifier">assert</span> <span class="ruby-operator">!</span><span class="ruby-identifier">result</span>[<span class="ruby-value str">&quot;status&quot;</span>].<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">&quot;expected to find a status field but didn't&quot;</span>
2064
- 260: <span class="ruby-keyword kw">end</span></pre>
2065
- </div>
2066
-
2067
- </div>
2068
-
2069
-
2070
-
2071
-
2072
- </div>
2073
-
2074
-
2075
- <div id="test-homepage-latest-test-method" class="method-detail ">
2076
- <a name="method-i-test_homepage_latest_test"></a>
2077
-
2078
- <div class="method-heading">
2079
-
2080
- <span class="method-name">test_homepage_latest_test</span><span
2081
- class="method-args">()</span>
2082
- <span class="method-click-advice">click to toggle source</span>
2083
-
2084
- </div>
2085
-
2086
- <div class="method-description">
2087
-
2088
-
2089
-
2090
-
2091
-
2092
- <div class="method-source-code"
2093
- id="test-homepage-latest-test-source">
2094
- <pre>
2095
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 262</span>
2096
- 262: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_latest_test</span>
2097
- 263: <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>
2098
- 264: <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> []
2099
- 265: <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">&quot;expected to get something back but didn't&quot;</span>
2100
- 266: <span class="ruby-keyword kw">end</span></pre>
2101
- </div>
2102
-
2103
- </div>
2104
-
2105
-
2106
-
2107
-
2108
- </div>
2109
-
2110
-
2111
- <div id="test-homepage-new-method" class="method-detail ">
2112
- <a name="method-i-test_homepage_new"></a>
2113
-
2114
- <div class="method-heading">
2115
-
2116
- <span class="method-name">test_homepage_new</span><span
2117
- class="method-args">()</span>
2118
- <span class="method-click-advice">click to toggle source</span>
2119
-
2120
- </div>
2121
-
2122
- <div class="method-description">
2123
-
2124
- <p>
2125
- &#8212;&#8212;&#8212;&#8212;&#8212; homepage &#8212;&#8212;&#8212;&#8212;-
2126
- </p>
2127
-
2128
-
2129
-
2130
- <div class="method-source-code"
2131
- id="test-homepage-new-source">
2132
- <pre>
2133
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 270</span>
2134
- 270: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_new</span>
2135
- 271: <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>)
2136
- 272: <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">&quot;failed to set mu_ip&quot;</span>)
2137
- 273: <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">&quot;/api/v5/homepage/&quot;</span>, <span class="ruby-value str">&quot;failed to set docroot&quot;</span>)
2138
- 274: <span class="ruby-keyword kw">end</span></pre>
2139
- </div>
2140
-
2141
- </div>
2142
-
2143
-
2144
-
2145
-
2146
- </div>
2147
-
2148
-
2149
- <div id="test-homepage-recent-method" class="method-detail ">
2150
- <a name="method-i-test_homepage_recent"></a>
2151
-
2152
- <div class="method-heading">
2153
-
2154
- <span class="method-name">test_homepage_recent</span><span
2155
- class="method-args">()</span>
2156
- <span class="method-click-advice">click to toggle source</span>
2157
-
2158
- </div>
2159
-
2160
- <div class="method-description">
2161
-
2162
-
2163
-
2164
-
2165
-
2166
- <div class="method-source-code"
2167
- id="test-homepage-recent-source">
2168
- <pre>
2169
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 250</span>
2170
- 250: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_recent</span>
2171
- 251: <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>
2172
- 252: <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> []
2173
- 253: <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">&quot;summary&quot;</span>].<span class="ruby-identifier">nil?</span>, <span class="ruby-value str">&quot;expected to find a summary field but didn't&quot;</span>
2174
- 254: <span class="ruby-keyword kw">end</span></pre>
2175
- </div>
2176
-
2177
- </div>
2178
-
2179
-
2180
-
2181
-
2182
- </div>
2183
-
2184
-
2185
- <div id="test-homepage-status-method" class="method-detail ">
2186
- <a name="method-i-test_homepage_status"></a>
2187
-
2188
- <div class="method-heading">
2189
-
2190
- <span class="method-name">test_homepage_status</span><span
2191
- class="method-args">()</span>
2192
- <span class="method-click-advice">click to toggle source</span>
2193
-
2194
- </div>
2195
-
2196
- <div class="method-description">
2197
-
2198
- <p>
2199
- &#8212;&#8212;&#8212;&#8212;&#8212; cmd_homepage
2200
- &#8212;&#8212;&#8212;&#8212;-
2201
- </p>
2202
-
2203
-
2204
-
2205
- <div class="method-source-code"
2206
- id="test-homepage-status-source">
2207
- <pre>
2208
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 244</span>
2209
- 244: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_homepage_status</span>
2210
- 245: <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>
2211
- 246: <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> []
2212
- 247: <span class="ruby-identifier">assert</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;title&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;Licenses&quot;</span>, <span class="ruby-value str">&quot;expected 'Licenses'&quot;</span>
2213
- 248: <span class="ruby-keyword kw">end</span></pre>
2214
- </div>
2215
-
2216
- </div>
2217
-
2218
-
2219
-
2220
-
2221
- </div>
2222
-
2223
-
2224
- <div id="test-muapi-list-by-status-method" class="method-detail ">
2225
- <a name="method-i-test_muapi_list_by_status"></a>
2226
-
2227
- <div class="method-heading">
2228
-
2229
- <span class="method-name">test_muapi_list_by_status</span><span
2230
- class="method-args">()</span>
2231
- <span class="method-click-advice">click to toggle source</span>
2232
-
2233
- </div>
2234
-
2235
- <div class="method-description">
2236
-
2237
-
2238
-
2239
-
2240
-
2241
- <div class="method-source-code"
2242
- id="test-muapi-list-by-status-source">
2243
- <pre>
2244
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 448</span>
2245
- 448: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_muapi_list_by_status</span>
2246
- 449: <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>)
2247
- 450: <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">&quot;finished&quot;</span>)
2248
- 451: <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">&quot;got empty response&quot;</span>)
2249
- 452: <span class="ruby-keyword kw">end</span></pre>
2250
- </div>
2251
-
2252
- </div>
2253
-
2254
-
2255
-
2256
-
2257
- </div>
2258
-
2259
-
2260
- <div id="test-muapi-new-method" class="method-detail ">
2261
- <a name="method-i-test_muapi_new"></a>
2262
-
2263
- <div class="method-heading">
2264
-
2265
- <span class="method-name">test_muapi_new</span><span
2266
- class="method-args">()</span>
2267
- <span class="method-click-advice">click to toggle source</span>
2268
-
2269
- </div>
2270
-
2271
- <div class="method-description">
2272
-
2273
- <p>
2274
- &#8212;&#8212;&#8212;&#8212;&#8212; muapi
2275
- &#8212;&#8212;&#8212;&#8212;&#8212;-
2276
- </p>
2277
-
2278
-
2279
-
2280
- <div class="method-source-code"
2281
- id="test-muapi-new-source">
2282
- <pre>
2283
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 442</span>
2284
- 442: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_muapi_new</span>
2285
- 443: <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>)
2286
- 444: <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">&quot;failed to set mu_ip&quot;</span>)
2287
- 445: <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">&quot;/api/v3/&quot;</span>, <span class="ruby-value str">&quot;failed to set docroot&quot;</span>)
2288
- 446: <span class="ruby-keyword kw">end</span></pre>
2289
- </div>
2290
-
2291
- </div>
2292
-
2293
-
2294
-
2295
-
2296
- </div>
2297
-
2298
-
2299
- <div id="test-muapi-types-method" class="method-detail ">
2300
- <a name="method-i-test_muapi_types"></a>
2301
-
2302
- <div class="method-heading">
2303
-
2304
- <span class="method-name">test_muapi_types</span><span
2305
- class="method-args">()</span>
2306
- <span class="method-click-advice">click to toggle source</span>
2307
-
2308
- </div>
2309
-
2310
- <div class="method-description">
2311
-
2312
-
2313
-
2314
-
2315
-
2316
- <div class="method-source-code"
2317
- id="test-muapi-types-source">
2318
- <pre>
2319
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 454</span>
2320
- 454: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_muapi_types</span>
2321
- 455: <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>)
2322
- 456: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">types</span>
2323
- 457: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;scenario&quot;</span>), <span class="ruby-node">&quot;expected scenario, got\n#{response}&quot;</span>)
2324
- 458: <span class="ruby-keyword kw">end</span></pre>
2325
- </div>
2326
-
2327
- </div>
2328
-
2329
-
2330
-
2331
-
2332
- </div>
2333
-
2334
-
2335
- <div id="test-netconfig-new-method" class="method-detail ">
2336
- <a name="method-i-test_netconfig_new"></a>
2337
-
2338
- <div class="method-heading">
2339
-
2340
- <span class="method-name">test_netconfig_new</span><span
2341
- class="method-args">()</span>
2342
- <span class="method-click-advice">click to toggle source</span>
2343
-
2344
- </div>
2345
-
2346
- <div class="method-description">
2347
-
2348
- <p>
2349
- &#8212;&#8212;&#8212;&#8212;&#8212; netconfig &#8212;&#8212;&#8212;&#8212;
2350
- </p>
2351
-
2352
-
2353
-
2354
- <div class="method-source-code"
2355
- id="test-netconfig-new-source">
2356
- <pre>
2357
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 556</span>
2358
- 556: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_netconfig_new</span>
2359
- 557: <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>)
2360
- 558: <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">&quot;failed to set mu_ip&quot;</span>)
2361
- 559: <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">&quot;/restlet/netconfig/&quot;</span>, <span class="ruby-value str">&quot;failed to set docroot&quot;</span>)
2362
- 560: <span class="ruby-keyword kw">end</span></pre>
2363
- </div>
2364
-
2365
- </div>
2366
-
2367
-
2368
-
2369
-
2370
- </div>
2371
-
2372
-
2373
- <div id="test-scale-about-method" class="method-detail ">
2374
- <a name="method-i-test_scale_about"></a>
2375
-
2376
- <div class="method-heading">
2377
-
2378
- <span class="method-name">test_scale_about</span><span
2379
- class="method-args">()</span>
2380
- <span class="method-click-advice">click to toggle source</span>
2381
-
2382
- </div>
2383
-
2384
- <div class="method-description">
2385
-
2386
-
2387
-
2388
-
2389
-
2390
- <div class="method-source-code"
2391
- id="test-scale-about-source">
2392
- <pre>
2393
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 648</span>
2394
- 648: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_about</span>
2395
- 649: <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>)
2396
- 650: <span class="ruby-identifier">about</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">about</span>
2397
- 651: <span class="ruby-comment cmt"># puts JSON.pretty_generate about</span>
2398
- 652: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">about</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;group&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;active&quot;</span>, <span class="ruby-node">&quot;expected 'active' group, got #{about[0][&quot;group&quot;]}&quot;</span>)
2399
- 653: <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">about</span>[<span class="ruby-value">0</span>][<span class="ruby-value str">&quot;type&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;bot&quot;</span>, <span class="ruby-node">&quot;expected 'bot' type, got #{about[0][&quot;type&quot;]}&quot;</span>)
2400
- 654: <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">&quot;uuid is nil&quot;</span>)
2401
- 655: <span class="ruby-keyword kw">end</span></pre>
2402
- </div>
2403
-
2404
- </div>
2405
-
2406
-
2407
-
2408
-
2409
- </div>
2410
-
2411
-
2412
- <div id="test-scale-list-method" class="method-detail ">
2413
- <a name="method-i-test_scale_list"></a>
2414
-
2415
- <div class="method-heading">
2416
-
2417
- <span class="method-name">test_scale_list</span><span
2418
- class="method-args">()</span>
2419
- <span class="method-click-advice">click to toggle source</span>
2420
-
2421
- </div>
2422
-
2423
- <div class="method-description">
2424
-
2425
-
2426
-
2427
-
2428
-
2429
- <div class="method-source-code"
2430
- id="test-scale-list-source">
2431
- <pre>
2432
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 657</span>
2433
- 657: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_list</span>
2434
- 658: <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>)
2435
- 659: <span class="ruby-identifier">list</span> = <span class="ruby-identifier">api</span>.<span class="ruby-identifier">list</span>
2436
- 660: <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">&quot;expected list of length 1, got #{list.length}&quot;</span>)
2437
- 661: <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">&quot;uuid is nil&quot;</span>)
2438
- 662: <span class="ruby-keyword kw">end</span></pre>
2439
- </div>
2440
-
2441
- </div>
2442
-
2443
-
2444
-
2445
-
2446
- </div>
2447
-
2448
-
2449
- <div id="test-scale-new-method" class="method-detail ">
2450
- <a name="method-i-test_scale_new"></a>
2451
-
2452
- <div class="method-heading">
2453
-
2454
- <span class="method-name">test_scale_new</span><span
2455
- class="method-args">()</span>
2456
- <span class="method-click-advice">click to toggle source</span>
2457
-
2458
- </div>
2459
-
2460
- <div class="method-description">
2461
-
2462
- <p>
2463
- &#8212;&#8212;&#8212;&#8212;&#8212; scale
2464
- &#8212;&#8212;&#8212;&#8212;&#8212;-
2465
- </p>
2466
-
2467
-
2468
-
2469
- <div class="method-source-code"
2470
- id="test-scale-new-source">
2471
- <pre>
2472
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 641</span>
2473
- 641: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_new</span>
2474
- 642: <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>)
2475
- 643: <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">&quot;failed to set mu_ip&quot;</span>)
2476
- 644: <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">&quot;/api/v5/scale/&quot;</span>, <span class="ruby-value str">&quot;failed to set docroot&quot;</span>)
2477
- 645: <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">&quot;uuid is nil&quot;</span>)
2478
- 646: <span class="ruby-keyword kw">end</span></pre>
2479
- </div>
2480
-
2481
- </div>
2482
-
2483
-
2484
-
2485
-
2486
- </div>
2487
-
2488
-
2489
- <div id="test-scale-session-method" class="method-detail ">
2490
- <a name="method-i-test_scale_session"></a>
2491
-
2492
- <div class="method-heading">
2493
-
2494
- <span class="method-name">test_scale_session</span><span
2495
- class="method-args">()</span>
2496
- <span class="method-click-advice">click to toggle source</span>
2497
-
2498
- </div>
2499
-
2500
- <div class="method-description">
2501
-
2502
-
2503
-
2504
-
2505
-
2506
- <div class="method-source-code"
2507
- id="test-scale-session-source">
2508
- <pre>
2509
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 664</span>
2510
- 664: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_scale_session</span>
2511
- 665: <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>)
2512
- 666: <span class="ruby-identifier">api</span>.<span class="ruby-identifier">session</span>
2513
- 667: <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">&quot;uuid is nil&quot;</span>)
2514
- 668: <span class="ruby-keyword kw">end</span></pre>
2515
- </div>
2516
-
2517
- </div>
2518
-
2519
-
2520
-
2521
-
2522
- </div>
2523
-
2524
-
2525
- <div id="test-system-new-method" class="method-detail ">
2526
- <a name="method-i-test_system_new"></a>
2527
-
2528
- <div class="method-heading">
2529
-
2530
- <span class="method-name">test_system_new</span><span
2531
- class="method-args">()</span>
2532
- <span class="method-click-advice">click to toggle source</span>
2533
-
2534
- </div>
2535
-
2536
- <div class="method-description">
2537
-
2538
- <p>
2539
- do NOT write a test for system:restart please!
2540
- </p>
2541
-
2542
-
2543
-
2544
- <div class="method-source-code"
2545
- id="test-system-new-source">
2546
- <pre>
2547
- <span class="ruby-comment cmt"># File test/tc_test_mu.rb, line 674</span>
2548
- 674: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_system_new</span>
2549
- 675: <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>)
2550
- 676: <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">&quot;failed to set mu_ip&quot;</span>)
2551
- 677: <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">&quot;/api/v5/system/&quot;</span>, <span class="ruby-value str">&quot;failed to set docroot&quot;</span>)
2552
- 678: <span class="ruby-keyword kw">end</span></pre>
2553
- </div>
2554
-
2555
- </div>
2556
-
2557
-
2558
-
2559
-
2560
- </div>
2561
-
2562
-
2563
- </div>
2564
-
2565
-
2566
- </div>
2567
-
2568
-
2569
- <div id="rdoc-debugging-section-dump" class="debugging-section">
2570
-
2571
- <p>Disabled; run with --debug to generate this.</p>
2572
-
2573
- </div>
2574
-
2575
- <div id="validator-badges">
2576
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
2577
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
2578
- Rdoc Generator</a> 1.1.6</small>.</p>
2579
- </div>
2580
-
2581
- </body>
2582
- </html>
2583
-