@@ -30,133 +30,43 @@ public ComputeNodeTests(Xunit.Abstractions.ITestOutputHelper output)
30
30
31
31
[ Fact ]
32
32
[ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
33
- public void TestGetComputeNodeById ( )
34
- {
35
- BatchController controller = BatchController . NewInstance ;
36
- controller . RunPsTest ( string . Format ( "Test-GetComputeNodeById '{0}'" , poolId ) ) ;
37
- }
38
-
39
- [ Fact ]
40
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
41
- public void TestListComputeNodesByFilter ( )
42
- {
43
- BatchController controller = BatchController . NewInstance ;
44
- BatchAccountContext context = null ;
45
- string state = "idle" ;
46
- int matches = 0 ;
47
- controller . RunPsTestWorkflow (
48
- ( ) => { return new string [ ] { string . Format ( "Test-ListComputeNodesByFilter '{0}' '{1}' '{2}'" , poolId , state , matches ) } ; } ,
49
- ( ) =>
50
- {
51
- context = new ScenarioTestContext ( ) ;
52
- matches = ScenarioTestHelpers . GetPoolCurrentDedicated ( controller , context , poolId ) ;
53
- } ,
54
- null ,
55
- TestUtilities . GetCallingClass ( ) ,
56
- TestUtilities . GetCurrentMethodName ( ) ) ;
57
- }
58
-
59
- [ Fact ]
60
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
61
- public void TestGetAndListComputeNodesWithSelect ( )
62
- {
63
- BatchController controller = BatchController . NewInstance ;
64
- BatchAccountContext context = null ;
65
- string computeNodeId = null ;
66
- controller . RunPsTestWorkflow (
67
- ( ) => { return new string [ ] { string . Format ( "Test-GetAndListComputeNodesWithSelect '{0}' '{1}'" , poolId , computeNodeId ) } ; } ,
68
- ( ) =>
69
- {
70
- context = new ScenarioTestContext ( ) ;
71
- computeNodeId = ScenarioTestHelpers . GetComputeNodeId ( controller , context , poolId ) ;
72
- } ,
73
- null ,
74
- TestUtilities . GetCallingClass ( ) ,
75
- TestUtilities . GetCurrentMethodName ( ) ) ;
76
- }
77
-
78
- [ Fact ]
79
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
80
- public void TestListComputeNodesWithMaxCount ( )
81
- {
82
- BatchController controller = BatchController . NewInstance ;
83
- int maxCount = 1 ;
84
- controller . RunPsTest ( string . Format ( "Test-ListComputeNodesWithMaxCount '{0}' '{1}'" , poolId , maxCount ) ) ;
85
- }
86
-
87
- [ Fact ]
88
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
89
- public void TestListAllComputeNodes ( )
33
+ public void TestRemoveComputeNodes ( )
90
34
{
91
35
BatchController controller = BatchController . NewInstance ;
92
36
BatchAccountContext context = null ;
93
- int computeNodeCount = 0 ;
37
+ string removeNodePoolId = "removenodepool" ;
94
38
controller . RunPsTestWorkflow (
95
- ( ) => { return new string [ ] { string . Format ( "Test-ListAllComputeNodes '{0}' '{1}' " , poolId , computeNodeCount ) } ; } ,
39
+ ( ) => { return new string [ ] { string . Format ( "Test-RemoveComputeNodes '{0}'" , removeNodePoolId ) } ; } ,
96
40
( ) =>
97
41
{
98
42
context = new ScenarioTestContext ( ) ;
99
- computeNodeCount = ScenarioTestHelpers . GetPoolCurrentDedicated ( controller , context , poolId ) ;
43
+ ScenarioTestHelpers . CreateTestPool ( controller , context , removeNodePoolId , 2 ) ;
44
+ ScenarioTestHelpers . WaitForSteadyPoolAllocation ( controller , context , removeNodePoolId ) ;
100
45
} ,
101
- null ,
102
- TestUtilities . GetCallingClass ( ) ,
103
- TestUtilities . GetCurrentMethodName ( ) ) ;
104
- }
105
-
106
- [ Fact ]
107
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
108
- public void TestListComputeNodePipeline ( )
109
- {
110
- BatchController controller = BatchController . NewInstance ;
111
- BatchAccountContext context = null ;
112
- int computeNodeCount = 0 ;
113
- controller . RunPsTestWorkflow (
114
- ( ) => { return new string [ ] { string . Format ( "Test-ListComputeNodePipeline '{0}' '{1}'" , poolId , computeNodeCount ) } ; } ,
115
46
( ) =>
116
47
{
117
- context = new ScenarioTestContext ( ) ;
118
- computeNodeCount = ScenarioTestHelpers . GetPoolCurrentDedicated ( controller , context , poolId ) ;
48
+ ScenarioTestHelpers . DeletePool ( controller , context , removeNodePoolId ) ;
119
49
} ,
120
- null ,
121
50
TestUtilities . GetCallingClass ( ) ,
122
51
TestUtilities . GetCurrentMethodName ( ) ) ;
123
52
}
124
53
125
54
[ Fact ]
126
55
[ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
127
- public void TestRemoveComputeNodeById ( )
128
- {
129
- TestRemoveComputeNode ( usePipeline : false , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
130
- }
131
-
132
- [ Fact ]
133
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
134
- public void TestRemoveComputeNodePipeline ( )
135
- {
136
- TestRemoveComputeNode ( usePipeline : true , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
137
- }
138
-
139
- [ Fact ]
140
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
141
- public void TestRemoveMultipleComputeNodes ( )
56
+ public void TestRebootAndReimageComputeNode ( )
142
57
{
143
58
BatchController controller = BatchController . NewInstance ;
144
59
BatchAccountContext context = null ;
145
60
string computeNodeId = null ;
146
61
string computeNodeId2 = null ;
147
- int originalDedicated = 3 ;
148
62
controller . RunPsTestWorkflow (
149
- ( ) => { return new string [ ] { string . Format ( "Test-RemoveMultipleComputeNodes '{0}' '{1}' '{2}'" , poolId , computeNodeId , computeNodeId2 ) } ; } ,
63
+ ( ) => { return new string [ ] { string . Format ( "Test-RebootAndReimageComputeNode '{0}' '{1}' '{2}'" , poolId , computeNodeId , computeNodeId2 ) } ; } ,
150
64
( ) =>
151
65
{
152
66
context = new ScenarioTestContext ( ) ;
153
- originalDedicated = ScenarioTestHelpers . GetPoolCurrentDedicated ( controller , context , poolId ) ;
154
- ScenarioTestHelpers . WaitForSteadyPoolAllocation ( controller , context , poolId ) ;
155
- ScenarioTestHelpers . ResizePool ( controller , context , poolId , originalDedicated + 2 ) ;
156
- ScenarioTestHelpers . WaitForSteadyPoolAllocation ( controller , context , poolId ) ;
157
- computeNodeId = ScenarioTestHelpers . GetComputeNodeId ( controller , context , poolId ) ;
158
- ScenarioTestHelpers . WaitForIdleComputeNode ( controller , context , poolId , computeNodeId ) ;
67
+ computeNodeId = ScenarioTestHelpers . GetComputeNodeId ( controller , context , poolId , 0 ) ;
159
68
computeNodeId2 = ScenarioTestHelpers . GetComputeNodeId ( controller , context , poolId , 1 ) ;
69
+ ScenarioTestHelpers . WaitForIdleComputeNode ( controller , context , poolId , computeNodeId ) ;
160
70
ScenarioTestHelpers . WaitForIdleComputeNode ( controller , context , poolId , computeNodeId2 ) ;
161
71
} ,
162
72
null ,
@@ -166,110 +76,13 @@ public void TestRemoveMultipleComputeNodes()
166
76
167
77
[ Fact ]
168
78
[ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
169
- public void TestRebootComputeNodeById ( )
170
- {
171
- TestRebootComputeNode ( usePipeline : false , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
172
- }
173
-
174
- [ Fact ]
175
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
176
- public void TestRebootComputeNodePipeline ( )
177
- {
178
- TestRebootComputeNode ( usePipeline : true , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
179
- }
180
-
181
- [ Fact ]
182
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
183
- public void TestReimageComputeNodeById ( )
184
- {
185
- TestReimageComputeNode ( usePipeline : false , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
186
- }
187
-
188
- [ Fact ]
189
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
190
- public void TestReimageComputeNodePipeline ( )
191
- {
192
- TestReimageComputeNode ( usePipeline : true , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
193
- }
194
-
195
- [ Fact ]
196
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
197
- public void TestDisableAndEnableComputeNodeSchedulingById ( )
198
- {
199
- TestDisableAndEnableComputeNodeScheduling ( usePipeline : false , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
200
- }
201
-
202
- [ Fact ]
203
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
204
- public void TestDisableAndEnableComputeNodeSchedulingPipeline ( )
205
- {
206
- TestDisableAndEnableComputeNodeScheduling ( usePipeline : true , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
207
- }
208
-
209
- [ Fact ]
210
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
211
- public void TestGetComputeNodeRemoteLoginSettingsById ( )
212
- {
213
- TestGetComputeNodeRemoteLoginSettings ( usePipeline : false , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
214
- }
215
-
216
- [ Fact ]
217
- [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
218
- public void TestGetComputeNodeRemoteLoginSettingsPipeline ( )
219
- {
220
- TestGetComputeNodeRemoteLoginSettings ( usePipeline : true , testMethodName : TestUtilities . GetCurrentMethodName ( ) ) ;
221
- }
222
-
223
- private void TestRemoveComputeNode ( bool usePipeline , string testMethodName )
79
+ public void TestDisableAndEnableComputeNodeScheduling ( )
224
80
{
225
81
BatchController controller = BatchController . NewInstance ;
226
82
BatchAccountContext context = null ;
227
83
string computeNodeId = null ;
228
- int originalDedicated = 3 ;
229
84
controller . RunPsTestWorkflow (
230
- ( ) => { return new string [ ] { string . Format ( "Test-RemoveComputeNode '{0}' '{1}' '{2}'" , poolId , computeNodeId , usePipeline ? 1 : 0 ) } ; } ,
231
- ( ) =>
232
- {
233
- context = new ScenarioTestContext ( ) ;
234
- originalDedicated = ScenarioTestHelpers . GetPoolCurrentDedicated ( controller , context , poolId ) ;
235
- ScenarioTestHelpers . WaitForSteadyPoolAllocation ( controller , context , poolId ) ;
236
- computeNodeId = ScenarioTestHelpers . GetComputeNodeId ( controller , context , poolId ) ;
237
- ScenarioTestHelpers . WaitForIdleComputeNode ( controller , context , poolId , computeNodeId ) ;
238
- } ,
239
- ( ) =>
240
- {
241
- ScenarioTestHelpers . WaitForSteadyPoolAllocation ( controller , context , poolId ) ;
242
- ScenarioTestHelpers . ResizePool ( controller , context , poolId , originalDedicated ) ;
243
- } ,
244
- TestUtilities . GetCallingClass ( ) ,
245
- testMethodName ) ;
246
- }
247
-
248
- private void TestRebootComputeNode ( bool usePipeline , string testMethodName )
249
- {
250
- BatchController controller = BatchController . NewInstance ;
251
- BatchAccountContext context = null ;
252
- string computeNodeId = null ;
253
- controller . RunPsTestWorkflow (
254
- ( ) => { return new string [ ] { string . Format ( "Test-RebootComputeNode '{0}' '{1}' '{2}'" , poolId , computeNodeId , usePipeline ? 1 : 0 ) } ; } ,
255
- ( ) =>
256
- {
257
- context = new ScenarioTestContext ( ) ;
258
- computeNodeId = ScenarioTestHelpers . GetComputeNodeId ( controller , context , poolId ) ;
259
- ScenarioTestHelpers . WaitForIdleComputeNode ( controller , context , poolId , computeNodeId ) ;
260
- } ,
261
- null ,
262
- TestUtilities . GetCallingClass ( ) ,
263
- testMethodName ) ;
264
- }
265
-
266
- private void TestReimageComputeNode ( bool usePipeline , string testMethodName )
267
- {
268
- BatchController controller = BatchController . NewInstance ;
269
- BatchAccountContext context = null ;
270
- string computeNodeId = null ;
271
- controller . RunPsTestWorkflow (
272
- ( ) => { return new string [ ] { string . Format ( "Test-ReimageComputeNode '{0}' '{1}' '{2}'" , poolId , computeNodeId , usePipeline ? 1 : 0 ) } ; } ,
85
+ ( ) => { return new string [ ] { string . Format ( "Test-DisableAndEnableComputeNodeScheduling '{0}' '{1}'" , poolId , computeNodeId ) } ; } ,
273
86
( ) =>
274
87
{
275
88
context = new ScenarioTestContext ( ) ;
@@ -278,43 +91,27 @@ private void TestReimageComputeNode(bool usePipeline, string testMethodName)
278
91
} ,
279
92
null ,
280
93
TestUtilities . GetCallingClass ( ) ,
281
- testMethodName ) ;
282
- }
283
-
284
- private void TestDisableAndEnableComputeNodeScheduling ( bool usePipeline , string testMethodName )
285
- {
286
- BatchController controller = BatchController . NewInstance ;
287
- BatchAccountContext context = null ;
288
- string computeNodeId = null ;
289
- controller . RunPsTestWorkflow (
290
- ( ) => { return new string [ ] { string . Format ( "Test-DisableAndEnableComputeNodeScheduling '{0}' '{1}' '{2}'" , poolId , computeNodeId , usePipeline ? 1 : 0 ) } ; } ,
291
- ( ) =>
292
- {
293
- context = new ScenarioTestContext ( ) ;
294
- computeNodeId = ScenarioTestHelpers . GetComputeNodeId ( controller , context , poolId ) ;
295
- ScenarioTestHelpers . WaitForIdleComputeNode ( controller , context , poolId , computeNodeId ) ;
296
- } ,
297
- null ,
298
- TestUtilities . GetCallingClass ( ) ,
299
- testMethodName ) ;
94
+ TestUtilities . GetCurrentMethodName ( ) ) ;
300
95
}
301
96
302
- private void TestGetComputeNodeRemoteLoginSettings ( bool usePipeline , string testMethodName )
97
+ [ Fact ]
98
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
99
+ public void TestGetComputeNodeRemoteLoginSettings ( )
303
100
{
304
101
BatchController controller = BatchController . NewInstance ;
305
102
BatchAccountContext context = null ;
306
103
string computeNodeId = null ;
307
104
308
105
controller . RunPsTestWorkflow (
309
- ( ) => { return new string [ ] { string . Format ( "Test-GetRemoteLoginSettings '{0}' '{1}' '{2}' " , iaasPoolId , computeNodeId , usePipeline ? 1 : 0 ) } ; } ,
106
+ ( ) => { return new string [ ] { string . Format ( "Test-GetRemoteLoginSettings '{0}' '{1}'" , iaasPoolId , computeNodeId ) } ; } ,
310
107
( ) =>
311
108
{
312
109
context = new ScenarioTestContext ( ) ;
313
110
computeNodeId = ScenarioTestHelpers . GetComputeNodeId ( controller , context , iaasPoolId ) ;
314
111
} ,
315
112
null ,
316
113
TestUtilities . GetCallingClass ( ) ,
317
- testMethodName ) ;
114
+ TestUtilities . GetCurrentMethodName ( ) ) ;
318
115
}
319
116
}
320
117
}
0 commit comments