Fix Vitest suite and wire cloud/AWS dashboard API helpers.
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
Adds missing client methods, VPC seeder badges, hospice strain UI, and uiHelp drift keys so server/web builds and all 849 Vitest tests pass.
This commit is contained in:
@@ -16,6 +16,25 @@ type okStore struct{}
|
||||
func (okStore) PutShard(context.Context, string, string, []byte) error { return nil }
|
||||
func (okStore) HeadBucket(context.Context, string) error { return nil }
|
||||
|
||||
func TestErasureSwarmGetPolicyJSON(t *testing.T) {
|
||||
h := NewErasureSwarmHandler(func() erasure.AWSSwarmSettings {
|
||||
return erasure.AWSSwarmSettings{S3Bucket: "lab-shards", CloudFrontDomain: "d.cf.net"}
|
||||
}, nil)
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/v1/erasure-swarm/policy?bucket=lab-shards", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
h.GetPolicyJSON(rec, req)
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("status=%d body=%s", rec.Code, rec.Body.String())
|
||||
}
|
||||
var body map[string]interface{}
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if body["iam_policy"] == nil || body["bucket_policy"] == nil {
|
||||
t.Fatalf("body=%v", body)
|
||||
}
|
||||
}
|
||||
|
||||
func TestErasureSwarmPostTestOK(t *testing.T) {
|
||||
os.Setenv("AF_AWS_ACCESS_KEY_ID", "A")
|
||||
os.Setenv("AF_AWS_SECRET_ACCESS_KEY", "s")
|
||||
|
||||
Reference in New Issue
Block a user