Пример #1
0
    def check_segment_roles(self):
        """
        @summary: Checks if the segments are in preferred roles or not.
                    If not, rebalances the cluster.
        
        @return: None
        """

        newfault = Fault()
        # If the segments are not in preferred roles, go for rebalancing the cluster
        if newfault.check_if_not_in_preferred_role():
            tinctest.logger.warn(
                "***** Segments not in their preferred roles : rebalancing the segments..."
            )
            # If rebalancing downs the segments, go for incremental recovery - this is observed sometimes
            if not self.recover_segments('-r', 10):
                tinctest.logger.warn(
                    "***** Segments down after rebalance : Tests cannot proceed further!!"
                )
            # If rebalancing passes proceed for tests
            else:
                tinctest.logger.info(
                    "***** Segments successfully rebalanced : Proceeding with the tests"
                )
        # If segments in preferred roles, proceed for the tests
        else:
            tinctest.logger.info(
                "***** Segments in preferred roles : Proceeding with the tests"
            )
Пример #2
0
 def check_segment_roles(self):
     """
     @summary: Checks if the segments are in preferred roles or not.
                 If not, rebalances the cluster.
     
     @return: None
     """
     
     newfault = Fault()
     # If the segments are not in preferred roles, go for rebalancing the cluster
     if newfault.check_if_not_in_preferred_role():
         tinctest.logger.warn("***** Segments not in their preferred roles : rebalancing the segments...")
         # If rebalancing downs the segments, go for incremental recovery - this is observed sometimes
         if not self.recover_segments('-r',10):
             tinctest.logger.warn("***** Segments down after rebalance : Tests cannot proceed further!!")
         # If rebalancing passes proceed for tests
         else:
             tinctest.logger.info("***** Segments successfully rebalanced : Proceeding with the tests")
     # If segments in preferred roles, proceed for the tests
     else:
         tinctest.logger.info("***** Segments in preferred roles : Proceeding with the tests")
Пример #3
0
 def check_if_not_in_preferred_role(self):
     ''' Checks if the segments are in preferred role or not '''
     newfault = Fault()
     result = newfault.check_if_not_in_preferred_role()
     if result == True:
        self.fail("Segments are not in preferred roles!!!")