Add Emberwake Cloud Ecosystem deploy hub with AWS and generic spread templates.
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
Unified expandable panels with mermaid flows, ZIP export, connection tests, and Playwright smoke coverage.
This commit is contained in:
33
server/internal/api/spread_s3_crr_test.go
Normal file
33
server/internal/api/spread_s3_crr_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"crypto-miner-server/internal/erasure"
|
||||
)
|
||||
|
||||
func TestGetS3CRRTemplate(t *testing.T) {
|
||||
h := NewSpreadHandler(nil, t.TempDir(), t.TempDir(), nil)
|
||||
h.BindS3CRRConfig(func() erasure.S3ShardConfig {
|
||||
return erasure.S3ShardConfig{
|
||||
ShardBucket: "primary", ShardRegion: "us-east-1",
|
||||
CRRDestBucket: "replica", CRRDestRegion: "eu-west-1",
|
||||
}
|
||||
})
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/v1/spread/aws-s3-crr-template", nil)
|
||||
w := httptest.NewRecorder()
|
||||
h.GetS3CRRTemplate(w, req)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Fatalf("status=%d body=%s", w.Code, w.Body.String())
|
||||
}
|
||||
var body map[string]interface{}
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &body); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if body["rule"] == nil {
|
||||
t.Fatalf("body=%v", body)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user