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:
@@ -1,3 +1,42 @@
|
||||
package client
|
||||
import "testing"
|
||||
func TestCloudVenueReportPayloadShape(t *testing.T){ t.Skip("covered") }
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"crypto-miner-agent/deploy"
|
||||
)
|
||||
|
||||
func TestCloudVenueReportPayloadShape(t *testing.T) {
|
||||
probe := &deploy.CloudVenueProbe{
|
||||
CloudProvider: "aws",
|
||||
Environment: "prod",
|
||||
Workload: "gpu",
|
||||
InstanceType: "g4dn.xlarge",
|
||||
InstanceLifecycle: "spot",
|
||||
AvailabilityZone: "us-east-1a",
|
||||
OrganizationalUnit: "ou/GPU",
|
||||
EC2Tags: map[string]string{"Environment": "prod"},
|
||||
}
|
||||
payload := map[string]interface{}{
|
||||
"cloud_provider": probe.CloudProvider,
|
||||
"environment": probe.Environment,
|
||||
"workload": probe.Workload,
|
||||
"instance_type": probe.InstanceType,
|
||||
"instance_lifecycle": probe.InstanceLifecycle,
|
||||
"availability_zone": probe.AvailabilityZone,
|
||||
"organizational_unit": probe.OrganizationalUnit,
|
||||
"ec2_tags": probe.EC2Tags,
|
||||
}
|
||||
raw, err := json.Marshal(payload)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var got map[string]interface{}
|
||||
if err := json.Unmarshal(raw, &got); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got["cloud_provider"] != "aws" || got["instance_type"] != "g4dn.xlarge" {
|
||||
t.Fatalf("payload=%v", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user