Cover fabric session in mesh live smoke
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/fabricproto"
|
||||||
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/mesh"
|
"github.com/example/remote-access-platform/agents/rap-node-agent/internal/mesh"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -30,6 +31,9 @@ type smokeReport struct {
|
|||||||
RelayPath []string `json:"relay_path"`
|
RelayPath []string `json:"relay_path"`
|
||||||
TestServiceAccepted bool `json:"test_service_accepted"`
|
TestServiceAccepted bool `json:"test_service_accepted"`
|
||||||
TestServiceEchoPayload string `json:"test_service_echo_payload"`
|
TestServiceEchoPayload string `json:"test_service_echo_payload"`
|
||||||
|
FabricSessionAccepted bool `json:"fabric_session_accepted"`
|
||||||
|
FabricSessionLatencyMS int64 `json:"fabric_session_latency_ms"`
|
||||||
|
FabricSessionEndpoint string `json:"fabric_session_endpoint"`
|
||||||
PeerEndpoints map[string]any `json:"peer_endpoints"`
|
PeerEndpoints map[string]any `json:"peer_endpoints"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,6 +98,19 @@ func run(ctx context.Context) (smokeReport, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return smokeReport{}, fmt.Errorf("test service: %w", err)
|
return smokeReport{}, fmt.Errorf("test service: %w", err)
|
||||||
}
|
}
|
||||||
|
fabricSessionStartedAt := time.Now()
|
||||||
|
fabricSessionResponse, err := mesh.NewClient(nodeB.URL).SendFabricSessionFrame(ctx, mesh.FabricSessionDialOptions{
|
||||||
|
Token: "rap_fsn_mesh_live_smoke",
|
||||||
|
Timeout: 3 * time.Second,
|
||||||
|
}, fabricproto.Frame{
|
||||||
|
Type: fabricproto.FramePing,
|
||||||
|
Sequence: uint64(fabricSessionStartedAt.UnixNano()),
|
||||||
|
Payload: []byte("mesh-live-smoke-fabric-session"),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return smokeReport{}, fmt.Errorf("fabric session smoke: %w", err)
|
||||||
|
}
|
||||||
|
fabricSessionLatency := time.Since(fabricSessionStartedAt)
|
||||||
|
|
||||||
return smokeReport{
|
return smokeReport{
|
||||||
Stage: "C17F scoped synthetic config plus live HTTP transport",
|
Stage: "C17F scoped synthetic config plus live HTTP transport",
|
||||||
@@ -105,6 +122,9 @@ func run(ctx context.Context) (smokeReport, error) {
|
|||||||
RelayPath: decodeProbePath(relayAck),
|
RelayPath: decodeProbePath(relayAck),
|
||||||
TestServiceAccepted: testService.Ack.MessageType == mesh.SyntheticMessageTestServiceAck,
|
TestServiceAccepted: testService.Ack.MessageType == mesh.SyntheticMessageTestServiceAck,
|
||||||
TestServiceEchoPayload: testService.Response.EchoPayload,
|
TestServiceEchoPayload: testService.Response.EchoPayload,
|
||||||
|
FabricSessionAccepted: fabricSessionResponse.Type == fabricproto.FramePong && string(fabricSessionResponse.Payload) == "mesh-live-smoke-fabric-session",
|
||||||
|
FabricSessionLatencyMS: fabricSessionLatency.Milliseconds(),
|
||||||
|
FabricSessionEndpoint: nodeB.URL + "/mesh/v1/fabric/session/ws",
|
||||||
PeerEndpoints: map[string]any{
|
PeerEndpoints: map[string]any{
|
||||||
"node-a": nodeA.URL,
|
"node-a": nodeA.URL,
|
||||||
"node-r": nodeR.URL,
|
"node-r": nodeR.URL,
|
||||||
@@ -137,7 +157,7 @@ func writeSmokeScopedConfig(local mesh.PeerIdentity, peers map[string]string, ro
|
|||||||
func newSmokeNode(local mesh.PeerIdentity) *smokeNode {
|
func newSmokeNode(local mesh.PeerIdentity) *smokeNode {
|
||||||
node := &smokeNode{Local: local}
|
node := &smokeNode{Local: local}
|
||||||
node.server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
node.server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
mesh.Server{Local: node.Local, SyntheticRuntime: node.Runtime}.Handler().ServeHTTP(w, r)
|
mesh.Server{Local: node.Local, SyntheticRuntime: node.Runtime, FabricSessionEnabled: true}.Handler().ServeHTTP(w, r)
|
||||||
}))
|
}))
|
||||||
node.URL = node.server.URL
|
node.URL = node.server.URL
|
||||||
return node
|
return node
|
||||||
|
|||||||
@@ -265,6 +265,8 @@ authority-pinned nodes.
|
|||||||
Node-agent exposes the endpoint only when `RAP_MESH_FABRIC_SESSION_ENABLED` /
|
Node-agent exposes the endpoint only when `RAP_MESH_FABRIC_SESSION_ENABLED` /
|
||||||
`-mesh-fabric-session-enabled` is set, and reports the enabled endpoint in
|
`-mesh-fabric-session-enabled` is set, and reports the enabled endpoint in
|
||||||
heartbeat metadata.
|
heartbeat metadata.
|
||||||
|
`mesh-live-smoke` includes a fabric-session `PING`/`PONG` check alongside the
|
||||||
|
existing route and test-service probes.
|
||||||
|
|
||||||
Deliverables:
|
Deliverables:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user