Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shutdown ordering in IM integration test #7469

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/app/tests/integration/chip_im_initiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <core/CHIPCore.h>
#include <mutex>
#include <platform/CHIPDeviceLayer.h>
#include <protocols/secure_channel/MessageCounterManager.h>
#include <protocols/secure_channel/PASESession.h>
#include <support/ErrorStr.h>
#include <system/SystemPacketBuffer.h>
Expand All @@ -55,9 +54,6 @@ constexpr chip::Transport::AdminId gAdminId = 0;
chip::app::ReadClient * gpReadClient = nullptr;

chip::TransportMgr<chip::Transport::UDP> gTransportManager;
chip::SecureSessionMgr gSessionManager;
chip::secure_channel::MessageCounterManager gMessageCounterManager;

chip::Inet::IPAddress gDestAddr;

// The last time a CHIP Command was attempted to be sent.
Expand Down
3 changes: 0 additions & 3 deletions src/app/tests/integration/chip_im_responder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <messaging/ExchangeMgr.h>
#include <messaging/Flags.h>
#include <platform/CHIPDeviceLayer.h>
#include <protocols/secure_channel/MessageCounterManager.h>
#include <protocols/secure_channel/PASESession.h>
#include <support/ErrorStr.h>
#include <system/SystemPacketBuffer.h>
Expand Down Expand Up @@ -131,9 +130,7 @@ CHIP_ERROR ReadSingleClusterData(ClusterInfo & aClusterInfo, TLV::TLVWriter & aW

namespace {
chip::TransportMgr<chip::Transport::UDP> gTransportManager;
chip::SecureSessionMgr gSessionManager;
chip::SecurePairingUsingTestSecret gTestPairing;
chip::secure_channel::MessageCounterManager gMessageCounterManager;
LivenessEventGenerator gLivenessGenerator;

uint8_t gDebugEventBuffer[2048];
Expand Down
7 changes: 5 additions & 2 deletions src/app/tests/integration/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
#include <platform/CHIPDeviceLayer.h>
#include <support/ErrorStr.h>

// The ExchangeManager global object.
chip::Messaging::ExchangeManager gExchangeManager;
chip::SecureSessionMgr gSessionManager;
chip::secure_channel::MessageCounterManager gMessageCounterManager;

void InitializeChip(void)
{
Expand All @@ -57,8 +58,10 @@ void InitializeChip(void)

void ShutdownChip(void)
{
gExchangeManager.Shutdown();
chip::DeviceLayer::PlatformMgr().Shutdown();
gMessageCounterManager.Shutdown();
gExchangeManager.Shutdown();
gSessionManager.Shutdown();
}

void TLVPrettyPrinter(const char * aFormat, ...)
Expand Down
3 changes: 3 additions & 0 deletions src/app/tests/integration/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@

#include <app/util/basic-types.h>
#include <messaging/ExchangeMgr.h>
#include <protocols/secure_channel/MessageCounterManager.h>

#define MAX_MESSAGE_SOURCE_STR_LENGTH (100)
#define NETWORK_SLEEP_TIME_MSECS (100 * 1000)

extern chip::Messaging::ExchangeManager gExchangeManager;
extern chip::SecureSessionMgr gSessionManager;
extern chip::secure_channel::MessageCounterManager gMessageCounterManager;

constexpr chip::NodeId kTestNodeId = 0x1ULL;
constexpr chip::NodeId kTestNodeId1 = 0x2ULL;
Expand Down