MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / TestJoinServerCleanup

Function TestJoinServerCleanup

pkg/joinserver/joinserver_test.go:3288–3421  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3286}
3287
3288func TestJoinServerCleanup(t *testing.T) {
3289 a, ctx := test.New(t)
3290
3291 appList := []*ttnpb.ApplicationIdentifiers{
3292 {ApplicationId: "app-1"},
3293 {ApplicationId: "app-2"},
3294 {ApplicationId: "app-3"},
3295 {ApplicationId: "app-4"},
3296 }
3297
3298 deviceList := []*ttnpb.EndDevice{
3299 {
3300 Ids: &ttnpb.EndDeviceIdentifiers{
3301 ApplicationIds: appList[0],
3302 DeviceId: "dev-1",
3303 JoinEui: types.EUI64{0x41, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3304 DevEui: types.EUI64{0x41, 0x42, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3305 },
3306 },
3307 {
3308 Ids: &ttnpb.EndDeviceIdentifiers{
3309 ApplicationIds: appList[0],
3310 DeviceId: "dev-2",
3311 JoinEui: types.EUI64{0x42, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3312 DevEui: types.EUI64{0x42, 0x42, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3313 },
3314 },
3315 {
3316 Ids: &ttnpb.EndDeviceIdentifiers{
3317 ApplicationIds: appList[1],
3318 DeviceId: "dev-3",
3319 JoinEui: types.EUI64{0x43, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3320 DevEui: types.EUI64{0x43, 0x42, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3321 },
3322 },
3323 {
3324 Ids: &ttnpb.EndDeviceIdentifiers{
3325 ApplicationIds: appList[3],
3326 DeviceId: "dev-4",
3327 JoinEui: types.EUI64{0x44, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3328 DevEui: types.EUI64{0x44, 0x42, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3329 },
3330 },
3331 {
3332 Ids: &ttnpb.EndDeviceIdentifiers{
3333 ApplicationIds: appList[3],
3334 DeviceId: "dev-5",
3335 JoinEui: types.EUI64{0x45, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3336 DevEui: types.EUI64{0x45, 0x42, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3337 },
3338 },
3339 {
3340 Ids: &ttnpb.EndDeviceIdentifiers{
3341 ApplicationIds: appList[3],
3342 DeviceId: "dev-6",
3343 JoinEui: types.EUI64{0x46, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3344 DevEui: types.EUI64{0x46, 0x42, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}.Bytes(),
3345 },

Callers

nothing calls this directly

Calls 12

InitMethod · 0.95
InitMethod · 0.95
SetByIDMethod · 0.95
SetByIDMethod · 0.95
RangeToLocalSetMethod · 0.95
CleanDataMethod · 0.95
NewFunction · 0.92
NewRedisFunction · 0.92
IDFunction · 0.92
BytesMethod · 0.65
CloseMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected