MCPcopy Create free account
hub / github.com/facebook/time / TestFetchChannelTarget_PTP

Function TestFetchChannelTarget_PTP

calnex/api/api_test.go:258–274  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

256}
257
258func TestFetchChannelTarget_PTP(t *testing.T) {
259 sampleResp := "measure/ch9/ptp_synce/ptp/master_ip_ipv6=fd00:3116:301a::3e"
260 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter,
261 r *http.Request) {
262 fmt.Fprintln(w, sampleResp)
263 }))
264 defer ts.Close()
265
266 parsed, _ := url.Parse(ts.URL)
267 calnexAPI, err := NewAPI(parsed.Host, true, time.Second)
268 require.NoError(t, err)
269 calnexAPI.Client = ts.Client()
270
271 target, err := calnexAPI.FetchChannelTarget(ChannelVP1, ProbePTP)
272 require.NoError(t, err)
273 require.Equal(t, "fd00:3116:301a::3e", target)
274}
275
276func TestFetchChannelTarget_PPS(t *testing.T) {
277 sampleResp := "measure/ch0/signal_type=1 PPS"

Callers

nothing calls this directly

Calls 3

FetchChannelTargetMethod · 0.95
NewAPIFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…