def chkSusp():
     for r in nonPrimaryReps:
         # Every node with non primary replicas of instance 0 should raise
         # suspicion twice, once for each extra PRE-PREPARE request
         assert len(getNodeSuspicions(r.node,
                                      Suspicions.DUPLICATE_PPR_SENT.code)) == 2
         # Each non primary replica should just send one PREPARE
         assert len(sentPrepare(r)) == 1
 def chkSusp():
     for r in nonPrimaryReps:
         # Every node with non primary replicas of instance 0 should raise
         # suspicion
         assert len(getNodeSuspicions(r.node,
                                      Suspicions.PPR_DIGEST_WRONG.code)) == 1
         # No non primary replica should send any PREPARE
         assert len(sentPrepare(r)) == 0
 def chkSusp():
     for r in nonPrimaryReps:
         # Every node with non primary replicas of instance 0 should raise
         # suspicion twice, once for each extra PRE-PREPARE request
         assert len(getNodeSuspicions(r.node,
                                      Suspicions.DUPLICATE_PPR_SENT.code)) == 2
         # Each non primary replica should just send one PREPARE
         assert len(sentPrepare(r)) == 1
 def chkSusp():
     for r in nonPrimaryReps:
         # Every node with non primary replicas of instance 0 should raise
         # suspicion
         assert len(
             getNodeSuspicions(r.node,
                               Suspicions.PPR_DIGEST_WRONG.code)) == 1
         # No non primary replica should send any PREPARE
         assert len(sentPrepare(r)) == 0
 def chkSusp():
     for r in nonPrimaryReps:
         # Every node with non primary replicas of instance 0 should raise
         # suspicion
         susp_code = Suspicions.PPR_DIGEST_WRONG.code
         # Since the node sending bad requests might become primary of
         # some backup instance after view changes, it will again send a
         # PRE-PREPARE with incorrect digest, so other nodes might raise
         # suspicion more than once
         assert len(getNodeSuspicions(r.node, susp_code)) >= 1
         # No non primary replica should send any PREPARE
         assert len(sentPrepare(r, viewNo=0, ppSeqNo=1)) == 0
 def chkSusp():
     for r in nonPrimaryReps:
         # Every node with non primary replicas of instance 0 should raise
         # suspicion
         susp_code = Suspicions.PPR_DIGEST_WRONG.code
         # Since the node sending bad requests might become primary of
         # some backup instance after view changes, it will again send a
         # PRE-PREPARE with incorrect digest, so other nodes might raise
         # suspicion more than once
         assert len(getNodeSuspicions(r.node,
                                      susp_code)) >= 1
         # No non primary replica should send any PREPARE
         assert len(sentPrepare(r, viewNo=0, ppSeqNo=1)) == 0