ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
testRecoveryGroups.cc File Reference
#include <ChimeraTK/Device.h>
#include <boost/smart_ptr/make_shared_object.hpp>
#include <boost/thread/exceptions.hpp>
#include "Application.h"
#include "check_timeout.h"
#include "DeviceManager.h"
#include "DeviceModule.h"
#include "ModuleGroup.h"
#include "TestFacility.h"
#include <ChimeraTK/BackendFactory.h>
#include <ChimeraTK/cppext/finally.hpp>
#include <ChimeraTK/Exception.h>
#include <ChimeraTK/ExceptionDummyBackend.h>
#include <ChimeraTK/LogicalNameMappingBackend.h>
#include <ChimeraTK/NDRegisterAccessor.h>
#include <ChimeraTK/ScalarRegisterAccessor.h>
#include <ChimeraTK/VoidRegisterAccessor.h>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/test/included/unit_test.hpp>
#include <barrier>
#include <cstdint>
#include <string>
+ Include dependency graph for testRecoveryGroups.cc:

Go to the source code of this file.

Classes

struct  DeviceModuleWithPath
 
struct  WriteBlockingDummy
 
struct  WriteBlockingDummy::Registerer
 
struct  OpenCountingLmapBackend
 
struct  OpenCountingLmapBackend::Registerer
 
struct  BasicTestApp
 
struct  Fixture< APP >
 
struct  BlockInitTestApp
 
struct  InitFailureApp
 
struct  WriteRecoveryTestApp
 
struct  IncompleteRecoveryTestApp
 

Macros

#define BOOST_TEST_MODULE   testRecoveryGroups
 

Functions

 BOOST_FIXTURE_TEST_CASE (TestRecoveryGroups, Fixture< BasicTestApp >)
 A.5 DeviceManagers with at least one common involved backend ID (see DeviceBackend::getInvolvedBackendIDs()) form a recovery group.
 
 BOOST_FIXTURE_TEST_CASE (TestRecoveryGroupMerging, Fixture< BasicTestApp >)
 A.5.2 Two DeviceManagers which are not sharing any involved backend IDs will end up in the same recovery group if there is one other DeviceManager sharing an involved backend ID with each of them.
 
 BOOST_FIXTURE_TEST_CASE (TestDetectBarrier, Fixture< BasicTestApp >)
 B.3.1 DeviceManagers wait until all involved DeviceManagers have seen the error condition before trying to re-open ("barrier POST-DETECT").
 
 BOOST_FIXTURE_TEST_CASE (TestRecoveryStepOpen, Fixture< BasicTestApp >)
 B.3.2.1 DeviceManagers wait until all involved DeviceManagers successfully complete the open step before starting the initialisation handler
 
 BOOST_FIXTURE_TEST_CASE (TestRecoveryStepInitHandlers, Fixture< BlockInitTestApp >)
 B.3.2.2.2 DeviceManagers wait until all involved DeviceManagers complete the init handler step before restoring register values.
 
 BOOST_FIXTURE_TEST_CASE (TestInitFailure, Fixture< InitFailureApp >)
 B.3.2.2.3 If any DeviceManager sees an exception in one of its initialisation handlers, all DeviceManagers in the recovery group restart the recovery procedure after the POST-INIT-HANDLER barrier.
 
 BOOST_FIXTURE_TEST_CASE (TestRecoveryWriteBarrier, Fixture< WriteRecoveryTestApp >)
 B.3.2.3.1 DeviceManagers wait until all involved DeviceManagers complete the register value restoring before clearing the internal error flag.
 
 BOOST_FIXTURE_TEST_CASE (TestRecoveryWriteFailure, Fixture< WriteRecoveryTestApp >)
 B.3.2.3.2 If any DeviceManager sees an exception while restoring register values, all DeviceManagers in the recovery group restart the recovery procedure after the POST-WRITE-RECOVERY barrier.
 
 BOOST_AUTO_TEST_CASE (TestClearErrorBarrier)
 B.3.2.4.1 DeviceManagers wait until all involved DeviceManagers clear their internal error before flag activating the asynchronous read in B.3.2.5 ("barrier POST-CLEAR-ERROR").
 
 BOOST_AUTO_TEST_CASE (TestIncompleteRecoveryOpen)
 B.3.4 The application terminates cleanly, even if the recovery is waiting at one of the barriers mentioned in 3.2
 
 BOOST_AUTO_TEST_CASE (TestIncompleteRecoveryInit)
 B.3.4 The application terminates cleanly, even if the recovery is waiting at one of the barriers mentioned in 3.2
 
 BOOST_AUTO_TEST_CASE (TestIncompleteWriteRecovery)
 B.3.4 The application terminates cleanly, even if the recovery is waiting at one of the barriers mentioned in 3.2
 

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   testRecoveryGroups

Definition at line 8 of file testRecoveryGroups.cc.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/4]

BOOST_AUTO_TEST_CASE ( TestClearErrorBarrier  )

B.3.2.4.1 DeviceManagers wait until all involved DeviceManagers clear their internal error before flag activating the asynchronous read in B.3.2.5 ("barrier POST-CLEAR-ERROR").

Definition at line 693 of file testRecoveryGroups.cc.

◆ BOOST_AUTO_TEST_CASE() [2/4]

BOOST_AUTO_TEST_CASE ( TestIncompleteRecoveryInit  )

B.3.4 The application terminates cleanly, even if the recovery is waiting at one of the barriers mentioned in 3.2

Test at the POST-INIT-HANDLER barrier.

Definition at line 809 of file testRecoveryGroups.cc.

◆ BOOST_AUTO_TEST_CASE() [3/4]

BOOST_AUTO_TEST_CASE ( TestIncompleteRecoveryOpen  )

B.3.4 The application terminates cleanly, even if the recovery is waiting at one of the barriers mentioned in 3.2

Test at the POST-OPEN barrier.

Definition at line 730 of file testRecoveryGroups.cc.

◆ BOOST_AUTO_TEST_CASE() [4/4]

BOOST_AUTO_TEST_CASE ( TestIncompleteWriteRecovery  )

B.3.4 The application terminates cleanly, even if the recovery is waiting at one of the barriers mentioned in 3.2

Test at the POST-INIT-HANDLER barrier.

Definition at line 841 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [1/8]

BOOST_FIXTURE_TEST_CASE ( TestDetectBarrier  ,
Fixture< BasicTestApp  
)

B.3.1 DeviceManagers wait until all involved DeviceManagers have seen the error condition before trying to re-open ("barrier POST-DETECT").

Definition at line 239 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [2/8]

BOOST_FIXTURE_TEST_CASE ( TestInitFailure  ,
Fixture< InitFailureApp  
)

B.3.2.2.3 If any DeviceManager sees an exception in one of its initialisation handlers, all DeviceManagers in the recovery group restart the recovery procedure after the POST-INIT-HANDLER barrier.

Definition at line 450 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [3/8]

BOOST_FIXTURE_TEST_CASE ( TestRecoveryGroupMerging  ,
Fixture< BasicTestApp  
)

A.5.2 Two DeviceManagers which are not sharing any involved backend IDs will end up in the same recovery group if there is one other DeviceManager sharing an involved backend ID with each of them.

Definition at line 219 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [4/8]

BOOST_FIXTURE_TEST_CASE ( TestRecoveryGroups  ,
Fixture< BasicTestApp  
)

A.5 DeviceManagers with at least one common involved backend ID (see DeviceBackend::getInvolvedBackendIDs()) form a recovery group.

They collectively see exceptions and are recovered together.

A.5.1 Recovery groups which don't share any backend IDs behave independently.

Note: the tests are done together because test A.5.1 requires exactly the same lines of code as the A.5 test

Definition at line 180 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [5/8]

BOOST_FIXTURE_TEST_CASE ( TestRecoveryStepInitHandlers  ,
Fixture< BlockInitTestApp  
)

B.3.2.2.2 DeviceManagers wait until all involved DeviceManagers complete the init handler step before restoring register values.

Definition at line 354 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [6/8]

BOOST_FIXTURE_TEST_CASE ( TestRecoveryStepOpen  ,
Fixture< BasicTestApp  
)

B.3.2.1 DeviceManagers wait until all involved DeviceManagers successfully complete the open step before starting the initialisation handler

Definition at line 282 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [7/8]

BOOST_FIXTURE_TEST_CASE ( TestRecoveryWriteBarrier  ,
Fixture< WriteRecoveryTestApp  
)

B.3.2.3.1 DeviceManagers wait until all involved DeviceManagers complete the register value restoring before clearing the internal error flag.

Definition at line 562 of file testRecoveryGroups.cc.

◆ BOOST_FIXTURE_TEST_CASE() [8/8]

BOOST_FIXTURE_TEST_CASE ( TestRecoveryWriteFailure  ,
Fixture< WriteRecoveryTestApp  
)

B.3.2.3.2 If any DeviceManager sees an exception while restoring register values, all DeviceManagers in the recovery group restart the recovery procedure after the POST-WRITE-RECOVERY barrier.

Definition at line 608 of file testRecoveryGroups.cc.