ci(windows): separate offline and live release desktop security test steps

This commit is contained in:
Ochenstarik 2026-08-18 01:11:28 +07:00
parent 279349f445
commit c9cedd0552
2 changed files with 20 additions and 5 deletions

View file

@ -36,7 +36,12 @@ jobs:
run: ./tests/windows/Test-DesktopContracts.ps1 run: ./tests/windows/Test-DesktopContracts.ps1
- name: Test Desktop security - name: Test Desktop security
run: dotnet test tests/ServerMonitorManager.Desktop.Security.Tests/ServerMonitorManager.Desktop.Security.Tests.csproj --configuration Release -p:RestoreLockedMode=true run: dotnet test tests/ServerMonitorManager.Desktop.Security.Tests/ServerMonitorManager.Desktop.Security.Tests.csproj --configuration Release -p:RestoreLockedMode=true --filter Category!=LiveRelease
- name: Test Desktop security (live release)
env:
SMM_TEST_RELEASE_TAG: v0.1.0-alpha.18
run: dotnet test tests/ServerMonitorManager.Desktop.Security.Tests/ServerMonitorManager.Desktop.Security.Tests.csproj --configuration Release -p:RestoreLockedMode=true --filter Category=LiveRelease
- name: Build test-signed MSIX installer - name: Build test-signed MSIX installer
shell: pwsh shell: pwsh

View file

@ -121,10 +121,20 @@ public sealed class LiveReleaseUpdateVerificationTests : IAsyncDisposable
// Alter manifest content by tampering with the hash // Alter manifest content by tampering with the hash
var originalManifest = await File.ReadAllTextAsync(manifestPath, TestContext.Current.CancellationToken); var originalManifest = await File.ReadAllTextAsync(manifestPath, TestContext.Current.CancellationToken);
var tamperedManifest = originalManifest.Replace( var node = JsonNode.Parse(originalManifest);
"710813668ac5efacc245472afd4da6dca6739c042b5189bd12c2bbbd3c6b7e19", Assert.NotNull(node);
"0000000000000000000000000000000000000000000000000000000000000000", if (node["hashes"]?["ServerMonitorManager-win-x64.msix"] is not null)
StringComparison.Ordinal); {
node["hashes"]!["ServerMonitorManager-win-x64.msix"] = "0000000000000000000000000000000000000000000000000000000000000000";
}
else
{
node["hashes"] = new JsonObject
{
["ServerMonitorManager-win-x64.msix"] = "0000000000000000000000000000000000000000000000000000000000000000"
};
}
var tamperedManifest = node.ToJsonString();
var tamperedManifestPath = Path.Combine(_tempDir, "tampered-manifest.json"); var tamperedManifestPath = Path.Combine(_tempDir, "tampered-manifest.json");
await File.WriteAllTextAsync(tamperedManifestPath, tamperedManifest, TestContext.Current.CancellationToken); await File.WriteAllTextAsync(tamperedManifestPath, tamperedManifest, TestContext.Current.CancellationToken);