1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2019-2020 UPF-N4 authors. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
package message_test
import (
"testing"
"time"
"n4/pkg/pfcp/ie"
"n4/pkg/pfcp/message"
"go_n4/pfcp/internal/testutil"
)
func TestHeartbeatRequest(t *testing.T) {
cases := []testutil.TestCase{
{
Description: "Normal",
Structured: message.NewHeartbeatRequest(
ie.NewRecoveryTimeStamp(time.Date(2019, time.January, 1, 0, 0, 0, 0, time.UTC)),
),
Serialized: []byte{
0x20, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x00, 0x04, 0xdf, 0xd5, 0x2c, 0x00,
},
},
}
testutil.Run(t, cases, func(b []byte) (testutil.Serializable, error) {
v, err := message.ParseHeartbeatRequest(b)
if err != nil {
return nil, err
}
v.Payload = nil
return v, nil
})
}