fix(lab): refresh first T-014 batch ETags [T-014]
Harness governance / validate (push) Has been cancelled
Harness governance / validate (push) Has been cancelled
This commit is contained in:
@@ -293,7 +293,11 @@ function Invoke-BatchDesiredState(
|
||||
$results = @($operation.results)
|
||||
if ($operation.status -ne 'succeeded' -or $results.Count -ne $sourceCount -or
|
||||
@($results | Where-Object { $_.status -ne 'succeeded' }).Count -ne 0) {
|
||||
throw "batch desired-state operation was not fully successful"
|
||||
$statusCounts = @($results | Group-Object status | Sort-Object Name |
|
||||
ForEach-Object { "$($_.Name):$($_.Count)" }) -join ','
|
||||
$errorCounts = @($results | Where-Object { $_.error_code } | Group-Object error_code | Sort-Object Name |
|
||||
ForEach-Object { "$($_.Name):$($_.Count)" }) -join ','
|
||||
throw "batch desired-state operation was not fully successful: operation=$($operation.status), items=$($results.Count), statuses=$statusCounts, errors=$errorCounts"
|
||||
}
|
||||
return [ordered]@{
|
||||
status = [string]$operation.status
|
||||
@@ -714,7 +718,6 @@ try {
|
||||
|
||||
$stage = 'creating 16 disabled devices'
|
||||
$deviceIDs = [Collections.Generic.List[string]]::new()
|
||||
$createEntries = [Collections.Generic.List[object]]::new()
|
||||
foreach ($index in 1..$sourceCount) {
|
||||
$name = 'synthetic-{0:D2}' -f $index
|
||||
$response = Invoke-ControlRequest 'POST' '/api/v1/sites/site-t014/devices' @(201) ([ordered]@{
|
||||
@@ -729,10 +732,10 @@ try {
|
||||
}) @{ 'Idempotency-Key' = "t014-create-$index-$script:runNonce" }
|
||||
$created = Convert-ResponseJSON $response
|
||||
$deviceIDs.Add([string]$created.id)
|
||||
$createEntries.Add([pscustomobject]@{ DeviceID = [string]$created.id; ETag = Get-ResponseETag $response })
|
||||
}
|
||||
$stage = 'batch enabling 16 devices'
|
||||
$firstEnableBatch = Invoke-BatchDesiredState 'enabled' @($createEntries) 'enable-1'
|
||||
$firstEnableEntries = Get-DeviceEntries @($deviceIDs)
|
||||
$firstEnableBatch = Invoke-BatchDesiredState 'enabled' $firstEnableEntries 'enable-1'
|
||||
$firstEnableSeconds = Wait-Convergence 'enabled'
|
||||
$firstEnabledInventory = Get-MediaInventory $script:productionAPIPort
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ class SenseCapacityContractTests(unittest.TestCase):
|
||||
def test_exercises_real_control_api_and_quota_boundary(self):
|
||||
self.assertIn("/api/v1/sites/site-t014/devices:batchDesiredState", self.script)
|
||||
self.assertIn("desired_state = 'disabled'", self.script)
|
||||
self.assertIn("$firstEnableEntries = Get-DeviceEntries @($deviceIDs)", self.script)
|
||||
self.assertIn("t014-overflow-17", self.script)
|
||||
self.assertIn("quota_exceeded", self.script)
|
||||
self.assertIn("'enabled'", self.script)
|
||||
|
||||
Reference in New Issue
Block a user