Prepare the retained passive Windows echo build and time-profile successor
Rust development slice / linux (push) Failing after 7s
Rust development slice / linux (push) Failing after 7s
This commit is contained in:
@@ -3,18 +3,30 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)][ValidateRange(1,9223372036854775807)][long]$Generation,
|
||||
[switch]$AfterRestart
|
||||
[switch]$AfterRestart,
|
||||
[switch]$EchoPassive
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Add-Type -AssemblyName System.Runtime.Serialization
|
||||
$caseId = '49c230d8-fb5d-4c64-96b6-e0edce03ed90'
|
||||
$revision = 2
|
||||
$agentHash = 'df80b00fc2119b973d690053b9f9e4bdedd8fbc211f67599c3301eeb42e7702f'
|
||||
if ($EchoPassive) {
|
||||
$pair = Join-Path $PSScriptRoot 'Set-PassiveJobPair.ps1'
|
||||
if ((Get-FileHash -LiteralPath $pair).Hash -ne '723bd03d809191455f5909644f518ae2bebabbbb9ce6399f3007cb4cc0bc9341') { throw 'Passive controller changed' }
|
||||
$observed = (& $pair -Mode Read -EchoPassive) | ConvertFrom-Json
|
||||
if ($observed.id -cne '1d61d88b-ab17-49b1-9a8d-2427348313b4' -or
|
||||
$observed.new_agent.image_file.sha256 -cnotmatch '^[0-9a-f]{64}$') { throw 'Passive successor missing' }
|
||||
$caseId = $observed.id
|
||||
$agentHash = $observed.new_agent.image_file.sha256
|
||||
$revision = 3
|
||||
}
|
||||
$bootDir = 'C:\ProgramData\RustDiscoveryBootstrap'
|
||||
$caseDir = Join-Path $bootDir "job-passive-pair-$caseId"
|
||||
$publication = Join-Path $caseDir 'profile-published.json'
|
||||
$profile = 'C:\ProgramData\RustDiscoverySystem\time-attestation.json'
|
||||
$reader = Join-Path $PSScriptRoot 'Read-PassiveTimeSamples.ps1'
|
||||
$readerHash = 'd9e2b9344c19af1296b86ec70ba754ef820f369ac5ec897979bd4233e0722d04'
|
||||
$agentHash = 'df80b00fc2119b973d690053b9f9e4bdedd8fbc211f67599c3301eeb42e7702f'
|
||||
$helperHash = '59675a3cbb3a5d213fc764f38379d6b81baaf9d47a7124470cc2767d4985763e'
|
||||
$sessionId = [guid]::NewGuid().ToString()
|
||||
|
||||
@@ -128,7 +140,7 @@ $pub = Get-Content -LiteralPath $publication -Raw | ConvertFrom-Json
|
||||
$profileHash = Get-FileDigest $profile
|
||||
if ($pub.id -cne $caseId -or $pub.configuration.sha256 -cne $profileHash -or
|
||||
$pub.agent.image_file.sha256 -cne $agentHash -or $pub.helper.image_file.sha256 -cne $helperHash -or
|
||||
$pub.successor_revision -ne 2 -or $pub.job_mode -ne $false) { throw 'Unexpected pair publication' }
|
||||
$pub.successor_revision -ne $revision -or $pub.job_mode -ne $false) { throw 'Unexpected pair publication' }
|
||||
$since = Get-UtcNs $pub.publication_since
|
||||
$request = @{id=$sessionId;agent_sha256=$agentHash;helper_sha256=$helperHash} | ConvertTo-Json -Compress
|
||||
$clock = [Diagnostics.Stopwatch]::StartNew()
|
||||
|
||||
Reference in New Issue
Block a user