Example #1
0
    def test__stop_process(self):
        std_env = StandardEnv(redisBinaryPath=REDIS_BINARY, outputFilesFormat='%s-test', dbDirPath=self.test_dir, useSlaves=True)
        assert std_env.isUp() == False
        std_env.startEnv()
        assert std_env._isAlive(std_env.masterProcess) == True
        assert std_env._isAlive(std_env.slaveProcess) == True
        std_env.stopEnv()
        assert std_env._isAlive(std_env.masterProcess) == False
        assert std_env._isAlive(std_env.slaveProcess) == False

        std_env = StandardEnv(redisBinaryPath=REDIS_BINARY, outputFilesFormat='%s-test', dbDirPath=self.test_dir, useSlaves=True)
        assert std_env.isUp() == False
        std_env.startEnv()
        assert std_env._isAlive(std_env.masterProcess) == True
        assert std_env._isAlive(std_env.slaveProcess) == True
        assert std_env.isUp() == True
        assert  std_env.isHealthy() == True
        std_env.stopEnv(masters=True, slaves=False)
        assert std_env._isAlive(std_env.masterProcess) == False
        assert std_env._isAlive(std_env.slaveProcess) == True
        assert std_env.isUp() == True
        assert std_env.isHealthy() == False
        std_env.stopEnv(slaves=True)
        assert std_env._isAlive(std_env.masterProcess) == False
        assert std_env._isAlive(std_env.slaveProcess) == False
        assert std_env.isUp() == False
        assert std_env.isHealthy() == False
Example #2
0
 def test__is_alive(self):
     std_env = StandardEnv(redisBinaryPath=REDIS_BINARY, outputFilesFormat='%s-test', dbDirPath=self.test_dir)
     assert std_env.isUp() == False
     std_env.startEnv()
     assert std_env._isAlive(std_env.masterProcess) == True
     std_env.stopEnv()
     assert std_env._isAlive(std_env.masterProcess) == False