diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-22 23:03:59 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-22 23:03:59 +0900 |
commit | 6cffab405aaee92ba3f0b065be1f0ea9cc11cf9f (patch) | |
tree | 20fa2b6ea1acdbcf870fe939afa9f7773b7286eb /table/path_test.go | |
parent | 3901b2e7be031ccc0ba8217113a0cf3ffeeac63a (diff) |
table: add timestamp to Path
Set timestamp at Path when update message for the path arrived.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/path_test.go')
-rw-r--r-- | table/path_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/table/path_test.go b/table/path_test.go index 20083785..fe80b3d7 100644 --- a/table/path_test.go +++ b/table/path_test.go @@ -7,20 +7,21 @@ import ( "github.com/stretchr/testify/assert" "net" "testing" + "time" ) func TestPathNewIPv4(t *testing.T) { peerP := PathCreatePeer() msgP := PathCreateMSG(peerP) pathP := PathCreatePath(msgP) - ipv4p := NewIPv4Path(pathP[0].getSource(), pathP[0].getNlri(), true, pathP[0].getPathAttrs(), pathP[0].getMedSetByTargetNeighbor()) + ipv4p := NewIPv4Path(pathP[0].getSource(), pathP[0].getNlri(), true, pathP[0].getPathAttrs(), pathP[0].getMedSetByTargetNeighbor(), time.Now()) assert.NotNil(t, ipv4p) } func TestPathNewIPv6(t *testing.T) { peerP := PathCreatePeer() msgP := PathCreateMSG(peerP) pathP := PathCreatePath(msgP) - ipv6p := NewIPv6Path(pathP[0].getSource(), pathP[0].getNlri(), true, pathP[0].getPathAttrs(), pathP[0].getMedSetByTargetNeighbor()) + ipv6p := NewIPv6Path(pathP[0].getSource(), pathP[0].getNlri(), true, pathP[0].getPathAttrs(), pathP[0].getMedSetByTargetNeighbor(), time.Now()) assert.NotNil(t, ipv6p) } @@ -142,7 +143,7 @@ func TestPathCreatePath(t *testing.T) { nlriList := updateMsgP.NLRI pathAttributes := updateMsgP.PathAttributes nlri_info := nlriList[0] - path := CreatePath(msgP[0].fromPeer, &nlri_info, pathAttributes, false) + path := CreatePath(msgP[0].fromPeer, &nlri_info, pathAttributes, false, time.Now()) assert.NotNil(t, path) } @@ -189,7 +190,7 @@ func PathCreatePath(msgs []*ProcessMessage) []Path { nlriList := updateMsgP.NLRI pathAttributes := updateMsgP.PathAttributes nlri_info := nlriList[0] - pathP[i] = CreatePath(msg.fromPeer, &nlri_info, pathAttributes, false) + pathP[i] = CreatePath(msg.fromPeer, &nlri_info, pathAttributes, false, time.Now()) } return pathP } |