diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 00299df58..5fbf2faff 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -16,13 +16,6 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on - env: - Solution_Name: Agent.sln # Replace with your solution name, i.e. MyWpfApp.sln. - Solution_Path: Athena\Payload_Type\athena\athena\agent_code\Agent\ - Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. - Wap_Project_Directory: your-wap-project-directory-name # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. - Wap_Project_Path: your-wap-project-path # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. - steps: - name: Checkout uses: actions/checkout@v3 @@ -44,15 +37,27 @@ jobs: # run: dotnet test - name: Build Agent Linux if: matrix.os == 'ubuntu-latest' - run: dotnet publish Payload_Type/athena/athena/agent_code/Agent.sln -c Release /p:LinuxTest=True + run: dotnet publish Payload_Type/athena/athena/agent_code/Agent.sln -c Release -r linux-x64 /p:LinuxTest=True - name: Build Agent MacOS if: matrix.os == 'macos-latest' - run: dotnet publish Payload_Type/athena/athena/agent_code/Agent.sln -c Release /p:MacTest=True + run: dotnet publish Payload_Type/athena/athena/agent_code/Agent.sln -c Release -r osx-x64 /p:MacTest=True - name: Build Agent Windows if: matrix.os == 'windows-latest' - run: dotnet publish Payload_Type\athena\athena\agent_code\Agent.sln -c Release /p:WindowsTest=True + run: dotnet publish Payload_Type\athena\athena\agent_code\Agent.sln -c Release -r win-x64 /p:WindowsTest=True + + - name: Test Agent Linux + if: matrix.os == 'ubuntu-latest' + run: dotnet test Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/ -c Release /p:LinuxTest=True /p:SolutionDir="" + + - name: Test Agent MacOS + if: matrix.os == 'macos-latest' + run: dotnet test Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/ -c Release /p:MacTest=True /p:SolutionDir="" + + - name: Test Agent Windows + if: matrix.os == 'windows-latest' + run: dotnet test Payload_Type\athena\athena\agent_code\Tests\Agent.Tests\ -c Release /p:WindowsTest=True /p:SolutionDir="" # Restore the application to populate the obj folder with RuntimeIdentifiers #- name: Restore the application diff --git a/.github/workflows/threatcheck.yml b/.github/workflows/threatcheck.yml index c92d19dbe..053dcd832 100644 --- a/.github/workflows/threatcheck.yml +++ b/.github/workflows/threatcheck.yml @@ -28,4 +28,4 @@ jobs: dotnet-version: 7.0.X - name: Test with ThreatCheck - run: dotnet test Payload_Type\athena\athena\agent_code\Agent.sln /p:WindowsTest=True --logger "console;verbosity=normal" + run: dotnet test Payload_Type\athena\athena\agent_code\Tests\Agent.Tests.Defender\ /p:WindowsTest=True --logger "console;verbosity=normal" diff --git a/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/AgentTests/TaskingTests.cs b/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/AgentTests/TaskingTests.cs index 535ac837d..d577940b2 100644 --- a/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/AgentTests/TaskingTests.cs +++ b/Payload_Type/athena/athena/agent_code/Tests/Agent.Tests/AgentTests/TaskingTests.cs @@ -81,7 +81,7 @@ public async Task TestGetTaskingMultiple() Task.Run(_agent.Start); prof.taskingSent.WaitOne(1000); _profile.First().StopBeacon(); - Assert.IsTrue(((TestTaskManager)_taskManager).jobs.Count > 2); + Assert.IsTrue(((TestTaskManager)_taskManager).jobs.Count > 1); } [TestMethod] public async Task TestGetTaskingNoTasks() {