Skip to content

Commit 19a1f76

Browse files
committed
Adding Commandline references
1 parent 2b4ade4 commit 19a1f76

3 files changed

Lines changed: 10 additions & 115 deletions

File tree

src/VirtualClient/VirtualClient.Actions.UnitTests/Network/NetworkingWorkloadExecutorTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void NetworkingWorkloadStateInstancesAreJsonSerializable(bool? noSyncEnab
9090
"Profiling_Scenario_1",
9191
"00:00:30",
9292
"00:00:05",
93+
1,
9394
noSyncEnabled,
9495
Guid.NewGuid());
9596

@@ -126,6 +127,7 @@ public void NetworkingWorkloadStateInstancesAreJsonSerializable_2()
126127
"Profiling_Scenario_1",
127128
"00:00:30",
128129
"00:00:05",
130+
1,
129131
false,
130132
Guid.NewGuid(),
131133
//
@@ -174,6 +176,7 @@ public void NetworkingWorkloadStateInstancesAreJsonSerializable_3()
174176
"Profiling_Scenario_1",
175177
"00:00:30",
176178
"00:00:05",
179+
1,
177180
false,
178181
Guid.NewGuid(),
179182
//

src/VirtualClient/VirtualClient.Actions/Network/NetworkingWorkload/CPS/CPSClientExecutor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ private void InitializeWindowsClientCommandline()
6565
// -c (client mode)
6666
if (!this.CommandLineWindowsClient.Contains("-c", StringComparison.OrdinalIgnoreCase))
6767
{
68-
this.CommandLineWindowsClient += "-c ";
68+
this.CommandLineWindowsClient += " -c";
6969
}
7070

7171
// -r {Connections}
7272
// Your reference includes "-c -r {Connections}"
73-
if (!this.CommandLineWindowsClient.Contains("-r", StringComparison.OrdinalIgnoreCase) && this.Connections != null)
73+
if (!this.CommandLineWindowsClient.Contains("-r", StringComparison.OrdinalIgnoreCase))
7474
{
7575
this.CommandLineWindowsClient += $"-r {this.Connections} ";
7676
}
@@ -85,7 +85,7 @@ private void InitializeWindowsClientCommandline()
8585
}
8686

8787
// -i {DisplayInterval}
88-
if (!this.CommandLineWindowsClient.Contains("-i", StringComparison.OrdinalIgnoreCase) && this.DisplayInterval != null)
88+
if (!this.CommandLineWindowsClient.Contains("-i", StringComparison.OrdinalIgnoreCase))
8989
{
9090
this.CommandLineWindowsClient += $"-i {this.DisplayInterval} ";
9191
}

src/VirtualClient/VirtualClient.Actions/Network/NetworkingWorkload/NTttcp/NTttcpExecutor.cs

Lines changed: 4 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -198,70 +198,6 @@ public bool? NoSyncEnabled
198198
}
199199
}
200200

201-
/// <summary>
202-
/// Commandline for linux client side.
203-
/// </summary>
204-
public string CommandLineLinuxClient
205-
{
206-
get
207-
{
208-
return this.Parameters.GetValue<string>(nameof(this.CommandLineLinuxClient));
209-
}
210-
211-
set
212-
{
213-
this.Parameters[nameof(this.CommandLineLinuxClient)] = value;
214-
}
215-
}
216-
217-
/// <summary>
218-
/// Commandline for linux server side.
219-
/// </summary>
220-
public string CommandLineLinuxServer
221-
{
222-
get
223-
{
224-
return this.Parameters.GetValue<string>(nameof(this.CommandLineLinuxServer));
225-
}
226-
227-
set
228-
{
229-
this.Parameters[nameof(this.CommandLineLinuxServer)] = value;
230-
}
231-
}
232-
233-
/// <summary>
234-
/// Commandline for windows client side.
235-
/// </summary>
236-
public string CommandLineWindowsClient
237-
{
238-
get
239-
{
240-
return this.Parameters.GetValue<string>(nameof(this.CommandLineWindowsClient));
241-
}
242-
243-
set
244-
{
245-
this.Parameters[nameof(this.CommandLineWindowsClient)] = value;
246-
}
247-
}
248-
249-
/// <summary>
250-
/// Commandline for windows server side.
251-
/// </summary>
252-
public string CommandLineWindowsServer
253-
{
254-
get
255-
{
256-
return this.Parameters.GetValue<string>(nameof(this.CommandLineWindowsServer));
257-
}
258-
259-
set
260-
{
261-
this.Parameters[nameof(this.CommandLineWindowsServer)] = value;
262-
}
263-
}
264-
265201
/// <summary>
266202
/// The retry policy to apply to the startup of the NTttcp workload to handle
267203
/// transient issues.
@@ -320,9 +256,9 @@ protected override Task InitializeAsync(EventContext telemetryContext, Cancellat
320256
protected override string GetCommandLineArguments()
321257
{
322258
string command = null;
323-
if (this.Platform == PlatformID.Win32NT)
259+
if (this.Platform == PlatformID.Win32NT && this.IsInClientRole)
324260
{
325-
command = this.GetWindowsSpecificCommandLine();
261+
command = this.CommandLineWindowsClient;
326262
}
327263
else if (this.Platform == PlatformID.Unix)
328264
{
@@ -600,50 +536,6 @@ private void IntializeWindowsClientCommandline()
600536
}
601537
}
602538

603-
private void IntializeWindowsServerCommandline()
604-
{
605-
string serverIPAddress = this.GetLayoutClientInstances(ClientRole.Server).First().IPAddress;
606-
if (!this.CommandLineWindowsServer.Contains("-r") && !this.CommandLineWindowsServer.Contains("-s"))
607-
{
608-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + " -r";
609-
}
610-
611-
if (!this.CommandLineWindowsServer.Contains("-t") && this.TestDuration != null)
612-
{
613-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + $" -t {this.TestDuration.TotalSeconds}";
614-
}
615-
616-
if (!this.CommandLineWindowsServer.Contains("-l") && this.BufferSizeServer != null)
617-
{
618-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + $" -l {this.BufferSizeServer}";
619-
}
620-
621-
if (!this.CommandLineWindowsServer.Contains("-p"))
622-
{
623-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + $" -p {this.Port}";
624-
}
625-
626-
if (!this.CommandLineWindowsServer.Contains("-xml") && this.ResultsPath != null)
627-
{
628-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + $" -xml {this.ResultsPath}";
629-
}
630-
631-
if (!this.CommandLineWindowsServer.Contains("-u") && this.Protocol != null)
632-
{
633-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + $"{(this.Protocol.ToLowerInvariant() == "udp" ? " -u" : string.Empty)} ";
634-
}
635-
636-
if (!this.CommandLineWindowsServer.Contains("-ns") && this.NoSyncEnabled != null)
637-
{
638-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + $"{(this.NoSyncEnabled == true ? " -ns" : string.Empty)} ";
639-
}
640-
641-
if (!this.CommandLineWindowsServer.Contains("-m"))
642-
{
643-
this.CommandLineWindowsServer = this.CommandLineWindowsServer + $"-m {this.ThreadCount},*,{serverIPAddress} ";
644-
}
645-
}
646-
647539
private void IntializeLinuxClientCommandline()
648540
{
649541
string serverIPAddress = this.GetLayoutClientInstances(ClientRole.Server).First().IPAddress;
@@ -696,12 +588,12 @@ private void IntializeLinuxClientCommandline()
696588

697589
if (!this.CommandLineLinuxClient.Contains("-n"))
698590
{
699-
this.CommandLineLinuxClient = this.CommandLineLinuxClient + $"{(( this.ThreadsPerServerPort != null) ? $" -n {this.ThreadsPerServerPort}" : string.Empty)} ";
591+
this.CommandLineLinuxClient = this.CommandLineLinuxClient + $"{((this.ThreadsPerServerPort != null) ? $" -n {this.ThreadsPerServerPort}" : string.Empty)} ";
700592
}
701593

702594
if (!this.CommandLineLinuxClient.Contains("-l"))
703595
{
704-
this.CommandLineLinuxClient = this.CommandLineLinuxClient + $"{(( this.ConnectionsPerThread != null) ? $" -l {this.ConnectionsPerThread}" : string.Empty)} "
596+
this.CommandLineLinuxClient = this.CommandLineLinuxClient + $"{((this.ConnectionsPerThread != null) ? $" -l {this.ConnectionsPerThread}" : string.Empty)} ";
705597
}
706598

707599
if (!this.CommandLineLinuxClient.Contains("-N") && this.NoSyncEnabled != null)

0 commit comments

Comments
 (0)