refactor(agent): remove obsolete compatibility paths
This commit is contained in:
@@ -98,6 +98,7 @@ public sealed class RemoteReportingTests
|
||||
public async Task ConfigStoreLoadsInvalidConfigAsDenyAndUpdatesOneGlobalVersion()
|
||||
{
|
||||
var path = Path.Combine(Path.GetTempPath(), "wxagent-reporting-" + Guid.NewGuid().ToString("N") + ".json");
|
||||
var nodePath = path + ".node.json";
|
||||
try
|
||||
{
|
||||
await File.WriteAllTextAsync(path, "{\"enabled\":true,\"configVersion\":-1}");
|
||||
@@ -112,15 +113,15 @@ public sealed class RemoteReportingTests
|
||||
Assert.True(loaded.Enabled);
|
||||
Assert.Equal(4, loaded.ConfigVersion);
|
||||
|
||||
var nodePath = Path.Combine(Path.GetDirectoryName(path)!, "remote-node.json");
|
||||
var nodeConfig = (new RemoteNodeConfiguration { Reporting = loaded }).WithAudit("reporting.enable");
|
||||
await RemoteNodeConfigurationStore.SaveAsync(nodePath, nodeConfig);
|
||||
await File.WriteAllTextAsync(nodePath, "{\"reporting\":{\"enabled\":true,\"configVersion\":4}}");
|
||||
var nodeLoaded = await RemoteNodeConfigurationStore.LoadAsync(nodePath);
|
||||
Assert.Equal("reporting.enable", Assert.Single(nodeLoaded.Audit).Action);
|
||||
Assert.True(nodeLoaded.Reporting.Enabled);
|
||||
Assert.Equal(4, nodeLoaded.Reporting.ConfigVersion);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(path)) File.Delete(path);
|
||||
if (File.Exists(nodePath)) File.Delete(nodePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user