@@ -285,6 +285,55 @@ await executor.ExecuteAsync(CancellationToken.None)
285
285
}
286
286
}
287
287
288
+ [ Test ]
289
+ public async Task FioDiscoveryExecutorExecutesAsExpectedIfGroupIDIsRemoved ( )
290
+ {
291
+ this . mockFixture . Parameters [ nameof ( FioDiscoveryExecutor . ProcessModel ) ] = WorkloadProcessModel . SingleProcess ;
292
+
293
+ List < string > expectedCommandLines = new List < string >
294
+ {
295
+ $ "--name=fio_discovery_randwrite_134G_4K_d1_th1 --numjobs=1 --iodepth=1 --ioengine=libaio --size=134G --rw=randwrite --bs=4K --direct=1 --ramp_time=30 --runtime=300 --time_based --overwrite=1 --thread --group_reporting --output-format=json --filename=/dev/sd[a-z] --filename=/dev/sd[a-z] --filename=/dev/sd[a-z]",
296
+ $ "--name=fio_discovery_randwrite_134G_4K_d1_th4 --numjobs=4 --iodepth=1 --ioengine=libaio --size=134G --rw=randwrite --bs=4K --direct=1 --ramp_time=30 --runtime=300 --time_based --overwrite=1 --thread --group_reporting --output-format=json --filename=/dev/sd[a-z] --filename=/dev/sd[a-z] --filename=/dev/sd[a-z]",
297
+ $ "--name=fio_discovery_randwrite_134G_4K_d2_th8 --numjobs=8 --iodepth=2 --ioengine=libaio --size=134G --rw=randwrite --bs=4K --direct=1 --ramp_time=30 --runtime=300 --time_based --overwrite=1 --thread --group_reporting --output-format=json --filename=/dev/sd[a-z] --filename=/dev/sd[a-z] --filename=/dev/sd[a-z]"
298
+ } ;
299
+
300
+ using ( TestFioDiscoveryExecutor executor = new TestFioDiscoveryExecutor ( this . mockFixture . Dependencies , this . mockFixture . Parameters ) )
301
+ {
302
+ executor . Metadata . Remove ( "GroupId" . CamelCased ( ) ) ;
303
+
304
+ await executor . ExecuteAsync ( CancellationToken . None )
305
+ . ConfigureAwait ( false ) ;
306
+
307
+ Assert . AreEqual ( 4 , this . mockFixture . ProcessManager . Commands . Count ( ) ) ;
308
+ Assert . IsTrue ( this . mockFixture . ProcessManager . CommandsExecuted ( expectedCommandLines . ToArray ( ) ) ) ;
309
+ }
310
+ }
311
+
312
+ [ Test ]
313
+ public async Task FioDiscoveryExecutorExecutesAsExpectedIfGroupIDHasBadCasing ( )
314
+ {
315
+ this . mockFixture . Parameters [ nameof ( FioDiscoveryExecutor . ProcessModel ) ] = WorkloadProcessModel . SingleProcess ;
316
+
317
+ List < string > expectedCommandLines = new List < string >
318
+ {
319
+ $ "--name=fio_discovery_randwrite_134G_4K_d1_th1 --numjobs=1 --iodepth=1 --ioengine=libaio --size=134G --rw=randwrite --bs=4K --direct=1 --ramp_time=30 --runtime=300 --time_based --overwrite=1 --thread --group_reporting --output-format=json --filename=/dev/sd[a-z] --filename=/dev/sd[a-z] --filename=/dev/sd[a-z]",
320
+ $ "--name=fio_discovery_randwrite_134G_4K_d1_th4 --numjobs=4 --iodepth=1 --ioengine=libaio --size=134G --rw=randwrite --bs=4K --direct=1 --ramp_time=30 --runtime=300 --time_based --overwrite=1 --thread --group_reporting --output-format=json --filename=/dev/sd[a-z] --filename=/dev/sd[a-z] --filename=/dev/sd[a-z]",
321
+ $ "--name=fio_discovery_randwrite_134G_4K_d2_th8 --numjobs=8 --iodepth=2 --ioengine=libaio --size=134G --rw=randwrite --bs=4K --direct=1 --ramp_time=30 --runtime=300 --time_based --overwrite=1 --thread --group_reporting --output-format=json --filename=/dev/sd[a-z] --filename=/dev/sd[a-z] --filename=/dev/sd[a-z]"
322
+ } ;
323
+
324
+ using ( TestFioDiscoveryExecutor executor = new TestFioDiscoveryExecutor ( this . mockFixture . Dependencies , this . mockFixture . Parameters ) )
325
+ {
326
+ executor . Metadata . Remove ( "GroupId" . CamelCased ( ) ) ;
327
+ executor . Metadata . Add ( "grouPId" , string . Empty ) ;
328
+
329
+ await executor . ExecuteAsync ( CancellationToken . None )
330
+ . ConfigureAwait ( false ) ;
331
+
332
+ Assert . AreEqual ( 4 , this . mockFixture . ProcessManager . Commands . Count ( ) ) ;
333
+ Assert . IsTrue ( this . mockFixture . ProcessManager . CommandsExecuted ( expectedCommandLines . ToArray ( ) ) ) ;
334
+ }
335
+ }
336
+
288
337
private class TestFioDiscoveryExecutor : FioDiscoveryExecutor
289
338
{
290
339
public TestFioDiscoveryExecutor ( IServiceCollection dependencies , IDictionary < string , IConvertible > parameters )
0 commit comments