in e2etest/GuestProxyAgentTest/TestCases/EnableProxyAgentCase.cs [23:61]
public override async Task StartAsync(TestCaseExecutionContext context)
{
var vmr = context.VirtualMachineResource;
var patch = new VirtualMachinePatch()
{
SecurityProfile = new SecurityProfile
{
ProxyAgentSettings = new ProxyAgentSettings
{
Enabled = EnableProxyAgent
}
}
};
if (EnableProxyAgent)
{
patch.SecurityProfile.ProxyAgentSettings.WireServer = new HostEndpointSettings
{
InVmAccessControlProfileReferenceId = TestSetting.Instance.InVmWireServerAccessControlProfileReferenceId
};
patch.SecurityProfile.ProxyAgentSettings.Imds = new HostEndpointSettings
{
InVmAccessControlProfileReferenceId = TestSetting.Instance.InVmIMDSAccessControlProfileReferenceId
};
}
await vmr.UpdateAsync(Azure.WaitUntil.Completed, patch, cancellationToken: context.CancellationToken);
var iv = await vmr.InstanceViewAsync();
context.TestResultDetails = new TestCaseResultDetails
{
CustomOut = JsonConvert.SerializeObject(iv),
StdOut = "Enable ProxyAgent succeed.",
StdErr = "",
Succeed = true,
FromBlob = false,
};
}