From 1955efdae56519d1fb0673a09f791bb7adcb3d20 Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Wed, 2 Sep 2026 00:13:59 +0200 Subject: [PATCH] test: replace the operator's own tenant/device identities with synthetic values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test code used the real test-tenant GUID, a real UPN, a real VM serial (and its Intune-normalized form) and a real hostname as literals. None of the assertions depended on the specific values; they are contoso/1111…/1234… now. The one that stays is CertTenantBindingTests: its tenant GUID is stamped inside device-cert-sample.pem and can only change together with the fixture. Co-Authored-By: Claude Opus 5 (1M context) --- .../SignalAdapters/RealmJoinWatcherAdapterTests.cs | 2 +- .../CloudPcDeviceValidatorTests.cs | 4 ++-- .../CorporateIdentifierValidatorTests.cs | 8 ++++---- .../IngestOnDemandDiagnosticsTests.cs | 2 +- .../SecurityValidatorTests.cs | 2 +- .../SessionAnnotationsPaginationTests.cs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Agent/AutopilotMonitor.Agent.V2.Core.Tests/SignalAdapters/RealmJoinWatcherAdapterTests.cs b/src/Agent/AutopilotMonitor.Agent.V2.Core.Tests/SignalAdapters/RealmJoinWatcherAdapterTests.cs index 725f3d13..4441a813 100644 --- a/src/Agent/AutopilotMonitor.Agent.V2.Core.Tests/SignalAdapters/RealmJoinWatcherAdapterTests.cs +++ b/src/Agent/AutopilotMonitor.Agent.V2.Core.Tests/SignalAdapters/RealmJoinWatcherAdapterTests.cs @@ -644,7 +644,7 @@ namespace AutopilotMonitor.Agent.V2.Core.Tests.SignalAdapters [Fact] public void AutoUpdate_fires_once_with_previous_and_new_version_when_binary_version_changes_after_detection() { - // gktatooine session 946ccbd6: realmjoin_detected read 4.21.4 from the MSI-shipped + // Observed on a test-tenant session: realmjoin_detected read 4.21.4 from the MSI-shipped // binary; nine minutes later the tray AppUpdater swapped it for 4.21.18 and rewrote // Uninstall\RealmJoin. The Detected read is the baseline; the re-read after the // Uninstall-key change must surface exactly one auto-update event. diff --git a/src/Backend/AutopilotMonitor.Functions.Tests/CloudPcDeviceValidatorTests.cs b/src/Backend/AutopilotMonitor.Functions.Tests/CloudPcDeviceValidatorTests.cs index e580fa2d..4af1900c 100644 --- a/src/Backend/AutopilotMonitor.Functions.Tests/CloudPcDeviceValidatorTests.cs +++ b/src/Backend/AutopilotMonitor.Functions.Tests/CloudPcDeviceValidatorTests.cs @@ -81,10 +81,10 @@ public class CloudPcDeviceValidatorTests var body = $@"{{ ""value"":[{{ ""id"":""423a1fb4-6033-4b69-a31f-e7f3f54194dc"", - ""displayName"":""GKT-CloudPC - Obi-Wan Kenobi"", + ""displayName"":""CPC-Contoso - Obi-Wan Kenobi"", ""managedDeviceId"":""{DeviceId}"", ""managedDeviceName"":""CPC-cloud-AY5HT"", - ""userPrincipalName"":""cloudadmin@gktatooine.net"", + ""userPrincipalName"":""cloudadmin@contoso.com"", ""servicePlanName"":""Cloud PC Enterprise 2vCPU/4GB/128GB"" }}] }}"; diff --git a/src/Backend/AutopilotMonitor.Functions.Tests/CorporateIdentifierValidatorTests.cs b/src/Backend/AutopilotMonitor.Functions.Tests/CorporateIdentifierValidatorTests.cs index 1ae4affe..8b914766 100644 --- a/src/Backend/AutopilotMonitor.Functions.Tests/CorporateIdentifierValidatorTests.cs +++ b/src/Backend/AutopilotMonitor.Functions.Tests/CorporateIdentifierValidatorTests.cs @@ -22,12 +22,12 @@ namespace AutopilotMonitor.Functions.Tests; public class CorporateIdentifierValidatorTests { private const string TenantId = "11111111-1111-1111-1111-111111111111"; - private const string Serial = "7801-5131-4473-3387-5637-4002-18"; + private const string Serial = "1234-5678-9012-3456-7890-1234-56"; private const string MmsIdentifier = $"Microsoft Corporation,Virtual Machine,{Serial}"; // The form Intune actually stores (field-verified 2026-08-17 in the portal list): // uppercased, spaces and dashes stripped per component. - private const string StoredIdentifier = "MICROSOFTCORPORATION,VIRTUALMACHINE,78015131447333875637400218"; - private const string StoredSerial = "78015131447333875637400218"; + private const string StoredIdentifier = "MICROSOFTCORPORATION,VIRTUALMACHINE,12345678901234567890123456"; + private const string StoredSerial = "12345678901234567890123456"; private sealed class SequenceHandler : HttpMessageHandler { @@ -200,7 +200,7 @@ public class CorporateIdentifierValidatorTests [Theory] [InlineData("Microsoft Corporation", "MICROSOFTCORPORATION")] [InlineData("Virtual Machine", "VIRTUALMACHINE")] - [InlineData("7801-5131-4473-3387-5637-4002-18", "78015131447333875637400218")] + [InlineData("1234-5678-9012-3456-7890-1234-56", "12345678901234567890123456")] [InlineData("ThinkPad T14 Gen 3", "THINKPADT14GEN3")] [InlineData("Serial.With.Periods", "SERIALWITHPERIODS")] public void NormalizeComponent_matchesIntunePortalNormalization(string raw, string expected) diff --git a/src/Backend/AutopilotMonitor.Functions.Tests/IngestOnDemandDiagnosticsTests.cs b/src/Backend/AutopilotMonitor.Functions.Tests/IngestOnDemandDiagnosticsTests.cs index 2396e990..4522ea86 100644 --- a/src/Backend/AutopilotMonitor.Functions.Tests/IngestOnDemandDiagnosticsTests.cs +++ b/src/Backend/AutopilotMonitor.Functions.Tests/IngestOnDemandDiagnosticsTests.cs @@ -13,7 +13,7 @@ namespace AutopilotMonitor.Functions.Tests; /// public class IngestOnDemandDiagnosticsTests { - private const string TenantId = "b54dc1af-5320-4f60-b5d4-821e0cf2a359"; + private const string TenantId = "11111111-1111-1111-1111-111111111111"; private const string HostedBlob = TenantId + "/AgentDiagnostics-8e4cc8ae-1111-2222-3333-444455556666-20260724170902-server-requested.zip"; diff --git a/src/Backend/AutopilotMonitor.Functions.Tests/SecurityValidatorTests.cs b/src/Backend/AutopilotMonitor.Functions.Tests/SecurityValidatorTests.cs index 86bcf663..35d36906 100644 --- a/src/Backend/AutopilotMonitor.Functions.Tests/SecurityValidatorTests.cs +++ b/src/Backend/AutopilotMonitor.Functions.Tests/SecurityValidatorTests.cs @@ -21,7 +21,7 @@ public class SecurityValidatorTests [InlineData("", false)] [InlineData(" ", false)] // whitespace only [InlineData("not-a-guid", false)] - [InlineData(@"DESKTOP-DIU8038\defaultuser0", false)] // regression: agent-as-defaultuser0 sent this as TenantId + [InlineData(@"DESKTOP-CONTOSO\defaultuser0", false)] // regression: agent-as-defaultuser0 sent this as TenantId [InlineData("a1b2c3d4e5f67890abcdef1234567890", false)] // no dashes → not standard format [InlineData("{a1b2c3d4-e5f6-7890-abcd-ef1234567890}", false)] // braced {…} not accepted public void IsValidGuid_reflects_guid_format(string? input, bool expected) diff --git a/src/Backend/AutopilotMonitor.Functions.Tests/SessionAnnotationsPaginationTests.cs b/src/Backend/AutopilotMonitor.Functions.Tests/SessionAnnotationsPaginationTests.cs index 071262af..210b2d06 100644 --- a/src/Backend/AutopilotMonitor.Functions.Tests/SessionAnnotationsPaginationTests.cs +++ b/src/Backend/AutopilotMonitor.Functions.Tests/SessionAnnotationsPaginationTests.cs @@ -11,7 +11,7 @@ namespace AutopilotMonitor.Functions.Tests; /// public class SessionAnnotationsPaginationTests { - private const string Caller = "b54dc1af-5320-4f60-b5d4-821e0cf2a359"; + private const string Caller = "11111111-1111-1111-1111-111111111111"; [Fact] public void ParseQuery_reads_and_trims_q()