Skip to content

Commit 3ccab7a

Browse files
RakeshwarKRakeshwar Reddy Kambaiahgari
andauthored
Added Nginx & ASP.NET workloads (#687)
* Init commit * commit changes and Profile Updates. * Fix wrk.md: replace single-backtick code fences with triple backticks for MDX compatibility * commit changes * Fix LLM review findings: infinite recursion, nginx stop, fire-and-forget, async deadlock, port mismatch, dispose safety * typo fix * Bump version from 3.0.14 to 3.0.15 Signed-off-by: Rakesh <153008248+RakeshwarK@users.noreply.github.com> * fix tests * addressing cmnts * rename * up version * fix wrk2 setup * Update tests --------- Signed-off-by: Rakesh <153008248+RakeshwarK@users.noreply.github.com> Co-authored-by: Rakeshwar Reddy Kambaiahgari <rkambaiahgar@microsoft.com>
1 parent a223a64 commit 3ccab7a

55 files changed

Lines changed: 8551 additions & 1369 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.15
1+
3.0.16

src/VirtualClient/VirtualClient.Actions.FunctionalTests/AspNetBenchProfileTests.cs

Lines changed: 0 additions & 150 deletions
This file was deleted.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
namespace VirtualClient.Actions
5+
{
6+
using System;
7+
using System.Collections.Generic;
8+
using System.Linq;
9+
using System.Net;
10+
using System.Threading;
11+
using System.Threading.Tasks;
12+
using NUnit.Framework;
13+
using VirtualClient.Common;
14+
using VirtualClient.Contracts;
15+
16+
[TestFixture]
17+
[Category("Functional")]
18+
public class NginxWrkProfileTests
19+
{
20+
private DependencyFixture mockFixture;
21+
private string clientAgentId;
22+
private string serverAgentId;
23+
24+
[OneTimeSetUp]
25+
public void SetupFixture()
26+
{
27+
this.clientAgentId = $"{Environment.MachineName}-Client";
28+
this.serverAgentId = $"{Environment.MachineName}-Server";
29+
30+
ComponentTypeCache.Instance.LoadComponentTypes(TestDependencies.TestDirectory);
31+
}
32+
33+
[SetUp]
34+
public void Setup()
35+
{
36+
this.mockFixture = new DependencyFixture();
37+
}
38+
39+
[Test]
40+
[TestCase("PERF-WEB-NGINX-WRK.json")]
41+
[TestCase("PERF-WEB-NGINX-WRK2.json")]
42+
public void NginxWrkProfileParametersAreInlinedCorrectly(string profile)
43+
{
44+
this.mockFixture.Setup(PlatformID.Unix, agentId: this.clientAgentId).SetupLayout(
45+
new ClientInstance(this.clientAgentId, "1.2.3.5", ClientRole.Client),
46+
new ClientInstance(this.serverAgentId, "1.2.3.4", ClientRole.Server));
47+
48+
using (ProfileExecutor executor = TestDependencies.CreateProfileExecutor(profile, this.mockFixture.Dependencies))
49+
{
50+
WorkloadAssert.ParameterReferencesInlined(executor.Profile);
51+
}
52+
}
53+
54+
[Test]
55+
[TestCase("PERF-WEB-NGINX-WRK.json")]
56+
[TestCase("PERF-WEB-NGINX-WRK2.json")]
57+
public void NginxWrkProfileParametersAreAvailable(string profile)
58+
{
59+
this.mockFixture.Setup(PlatformID.Unix, agentId: this.clientAgentId).SetupLayout(
60+
new ClientInstance(this.clientAgentId, "1.2.3.5", ClientRole.Client),
61+
new ClientInstance(this.serverAgentId, "1.2.3.4", ClientRole.Server));
62+
63+
var serverPrams = new List<string> { "PackageName", "Role", "Timeout" };
64+
65+
var reverseProxyPrams = new List<string> { "PackageName", "Role", "Timeout" };
66+
67+
var clientPrams = new List<string> { "PackageName", "Role", "Timeout", "TestDuration", "FileSizeInKB", "Connection", "ThreadCount", "CommandArguments", "MetricScenario", "Scenario" };
68+
69+
using (ProfileExecutor executor = TestDependencies.CreateProfileExecutor(profile, this.mockFixture.Dependencies))
70+
{
71+
foreach (var actionBlock in executor.Profile.Actions)
72+
{
73+
string role = actionBlock.Parameters["Role"].ToString();
74+
75+
if (role.Equals("server", StringComparison.OrdinalIgnoreCase))
76+
{
77+
foreach (var pram in serverPrams)
78+
{
79+
if (!actionBlock.Parameters.ContainsKey(pram))
80+
{
81+
Assert.False(true, $"{actionBlock.Type} does not have {pram} parameter.");
82+
}
83+
}
84+
}
85+
else if (role.Equals("reverseproxy", StringComparison.OrdinalIgnoreCase))
86+
{
87+
foreach (var pram in reverseProxyPrams)
88+
{
89+
if (!actionBlock.Parameters.ContainsKey(pram))
90+
{
91+
Assert.False(true, $"{actionBlock.Type} does not have {pram} parameter.");
92+
}
93+
}
94+
}
95+
else
96+
{
97+
foreach (var pram in clientPrams)
98+
{
99+
if (!actionBlock.Parameters.ContainsKey(pram))
100+
{
101+
Assert.False(true, $"{actionBlock.Type} does not have {pram} parameter.");
102+
}
103+
}
104+
}
105+
}
106+
}
107+
}
108+
}
109+
}

0 commit comments

Comments
 (0)