From fbeb505dd2f52b3208acddaa971ef7124923fe19 Mon Sep 17 00:00:00 2001 From: checkymander Date: Fri, 16 Feb 2024 11:10:36 -0500 Subject: [PATCH] update ls test for parent parsing --- .../agent_code/Tests/Agent.Tests/PluginTests/LsTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/PluginTests/LsTests.cs b/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/PluginTests/LsTests.cs index da966b08..4142a41a 100644 --- a/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/PluginTests/LsTests.cs +++ b/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/PluginTests/LsTests.cs @@ -36,14 +36,17 @@ public LsTests() [TestMethod] public void TestValidParentPath() { - string path = string.Empty; + string path; + string parent; if (OperatingSystem.IsWindows()) { path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers", "etc"); + parent = "drivers"; } else { path = Path.Combine("/", "etc"); + parent = ""; } Dictionary parameters = new Dictionary { @@ -56,7 +59,7 @@ public void TestValidParentPath() ((TestMessageManager)_messageManager).hasResponse.WaitOne(); string response = ((TestMessageManager)_messageManager).GetRecentOutput().Result; FileBrowserTaskResponse fb = JsonSerializer.Deserialize(response); - Assert.AreEqual(fb.file_browser.parent_path, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers")); + Assert.AreEqual(fb.file_browser.parent_path, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), parent)); } [TestMethod] public void TestGetFileListingLocal()