From ef856ef93da49a1a1f2c0a190855ec254f6f1f54 Mon Sep 17 00:00:00 2001 From: Dongri Jin Date: Tue, 9 Jan 2024 17:13:17 +0900 Subject: [PATCH] Add logger Signed-off-by: Dongri Jin --- core/service.go | 4 +++- tests/cases/tm2tm/scripts/test-service | 3 ++- tests/cases/tmmock2tmmock/scripts/test-service | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/service.go b/core/service.go index 9ed84531..f659b9f6 100644 --- a/core/service.go +++ b/core/service.go @@ -164,7 +164,7 @@ func (srv *RelayService) Serve(ctx context.Context) error { } func (srv *RelayService) shouldExecuteRelay(seqs *RelayPackets) (bool, bool) { - + logger := GetChannelPairLogger(srv.src, srv.dst) var err error srcRelay := false @@ -206,5 +206,7 @@ func (srv *RelayService) shouldExecuteRelay(seqs *RelayPackets) (bool, bool) { dstRelay = true } + logger.Info("shouldExecuteRelay", "srcRelay", srcRelay, "dstRelay", dstRelay) + return srcRelay, dstRelay } diff --git a/tests/cases/tm2tm/scripts/test-service b/tests/cases/tm2tm/scripts/test-service index 9d57e124..798865f6 100755 --- a/tests/cases/tm2tm/scripts/test-service +++ b/tests/cases/tm2tm/scripts/test-service @@ -85,7 +85,7 @@ sleep 4 expectUnrelayedCount "unrelayed-packets" "src" 0 expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5 -sleep 16 +sleep 20 echo "xxxxxxx ${SECONDS} relay service [acks = 5, time = 40] -> exec (time + count) xxxxxx" sleep 4 @@ -94,4 +94,5 @@ expectUnrelayedCount "unrelayed-packets" "src" 0 expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0 echo "Finished" + kill $RLY_PID diff --git a/tests/cases/tmmock2tmmock/scripts/test-service b/tests/cases/tmmock2tmmock/scripts/test-service index 9d534dcf..0fe475a2 100755 --- a/tests/cases/tmmock2tmmock/scripts/test-service +++ b/tests/cases/tmmock2tmmock/scripts/test-service @@ -90,7 +90,7 @@ sleep 4 expectUnrelayedCount "unrelayed-packets" "src" 0 expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5 -sleep 16 +sleep 20 echo "xxxxxxx ${SECONDS} relay service [akcs = 3, time = 40] -> exec - time + count xxxxxx" sleep 4