parameters: (self, conf_key, duration, check_after, should_be_down)
docstring: Pause injection testing. Check for osd being down when finished.
docstring_summary: Pause injection testing. Check for osd being down when finished.
docstring_tokens: Pause injection testing . Check for osd being down when finished .
function: def inject_pause(self, conf_key, duration, check_after, should_be_down):
          """
          Pause injection testing. Check for osd being down when finished.
          """
          the_one = random.choice(self.live_osds)
          self.log("inject_pause on {osd}".format(osd=the_one))
          self.log(
              "Testing {key} pause injection for duration {duration}".format(
                  key=conf_key,
                  duration=duration
                  ))
          self.log(
              "Checking after {after}, should_be_down={shouldbedown}".format(
                  after=check_after,
                  shouldbedown=should_be_down
                  ))
          self.ceph_manager.set_config(the_one, **{conf_key: duration})
          if not should_be_down:
              return
          time.sleep(check_after)
          status = self.ceph_manager.get_osd_status()
          assert the_one in status['down']
          time.sleep(duration - check_after + 20)
          status = self.ceph_manager.get_osd_status()
          assert not the_one in status['down']
function_tokens: def inject_pause ( self , conf_key , duration , check_after , should_be_down ) : the_one = random . choice ( self . live_osds ) self . log ( "inject_pause on {osd}" . format ( osd = the_one ) ) self . log ( "Testing {key} pause injection for duration {duration}" . format ( key = conf_key , duration = duration ) ) self . log ( "Checking after {after}, should_be_down={shouldbedown}" . format ( after = check_after , shouldbedown = should_be_down ) ) self . ceph_manager . set_config ( the_one , * * { conf_key : duration } ) if not should_be_down : return time . sleep ( check_after ) status = self . ceph_manager . get_osd_status ( ) assert the_one in status [ 'down' ] time . sleep ( duration - check_after + 20 ) status = self . ceph_manager . get_osd_status ( ) assert not the_one in status [ 'down' ]