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

Function TestFetchChannelTarget_NTP

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

Source from the content-addressed store, hash-verified

238}
239
240func TestFetchChannelTarget_NTP(t *testing.T) {
241 sampleResp := "measure/ch9/ptp_synce/ntp/server_ip_ipv6=fd00:3116:301a::3e"
242 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter,
243 r *http.Request) {
244 fmt.Fprintln(w, sampleResp)
245 }))
246 defer ts.Close()
247
248 parsed, _ := url.Parse(ts.URL)
249 calnexAPI, err := NewAPI(parsed.Host, true, time.Second)
250 require.NoError(t, err)
251 calnexAPI.Client = ts.Client()
252
253 target, err := calnexAPI.FetchChannelTarget(ChannelVP1, ProbeNTP)
254 require.NoError(t, err)
255 require.Equal(t, "fd00:3116:301a::3e", target)
256}
257
258func TestFetchChannelTarget_PTP(t *testing.T) {
259 sampleResp := "measure/ch9/ptp_synce/ptp/master_ip_ipv6=fd00:3116:301a::3e"

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…