ci(windows): separate offline and live release desktop security test steps
This commit is contained in:
parent
279349f445
commit
c9cedd0552
2 changed files with 20 additions and 5 deletions
7
.github/workflows/windows-build.yml
vendored
7
.github/workflows/windows-build.yml
vendored
|
|
@ -36,7 +36,12 @@ jobs:
|
|||
run: ./tests/windows/Test-DesktopContracts.ps1
|
||||
|
||||
- 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
|
||||
shell: pwsh
|
||||
|
|
|
|||
|
|
@ -121,10 +121,20 @@ public sealed class LiveReleaseUpdateVerificationTests : IAsyncDisposable
|
|||
|
||||
// Alter manifest content by tampering with the hash
|
||||
var originalManifest = await File.ReadAllTextAsync(manifestPath, TestContext.Current.CancellationToken);
|
||||
var tamperedManifest = originalManifest.Replace(
|
||||
"710813668ac5efacc245472afd4da6dca6739c042b5189bd12c2bbbd3c6b7e19",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||
StringComparison.Ordinal);
|
||||
var node = JsonNode.Parse(originalManifest);
|
||||
Assert.NotNull(node);
|
||||
if (node["hashes"]?["ServerMonitorManager-win-x64.msix"] is not null)
|
||||
{
|
||||
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");
|
||||
await File.WriteAllTextAsync(tamperedManifestPath, tamperedManifest, TestContext.Current.CancellationToken);
|
||||
|
|
|
|||
Loading…
Reference in a new issue