Extend agent tests for cloud fleet features and erasure lanes.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Cover fleet torrent DHT fetch, cloud map/venue/meta IMDS mocks, S3 shard fetch order, zero-server policy polling, self-surgery reorder, contingency skip paths, epidemiology fix guards, and ssm_document deploy lane.
This commit is contained in:
@@ -27,3 +27,15 @@ func TestReadEC2InstanceMetaNonAWSFallback(t *testing.T) {
|
||||
t.Fatal("expected empty meta on non-AWS fallback")
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadEC2InstanceMetaRegionFromAZ(t *testing.T) {
|
||||
prev := ec2IMDSReadMeta
|
||||
t.Cleanup(func() { ec2IMDSReadMeta = prev })
|
||||
ec2IMDSReadMeta = func(ctx context.Context) (CloudInstanceMeta, error) {
|
||||
return CloudInstanceMeta{Region: "us-west-2", SubnetID: "subnet-123"}, nil
|
||||
}
|
||||
meta := ReadEC2InstanceMeta()
|
||||
if meta.Region != "us-west-2" || meta.SubnetID != "subnet-123" {
|
||||
t.Fatalf("meta=%+v", meta)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user