def test_kill_all_should_kill_all_nodes_and_remove_state_file(): run('create') assert_mongods_running(3) run('killnodes all') assert_mongods_running(0) assert_no_state_file()
def test_should_start_mongods_and_save_state(): assert not os.path.isfile(state.filename) assert_mongods_running(0) run('create') assert os.path.isfile(state.filename) assert_mongods_running(3)
def test_kill_should_kill_just_specific_nodes(): run('create') assert_mongods_running(3) run('killnodes 2 3') assert_mongods_running(1) nodes = state.load() assert ['1'] == nodes.keys()
def test_should_not_allow_create_if_state_file_exists(): run('create') assert os.path.isfile(state.filename) assert_mongods_running(3) output = run('create') assert exitcodes.MONGOD_ALREADY_STARTED == output.exitcode assert 'Mongods already started' in output.stderr assert 'state file found' in output.stderr
def test_should_list_all_running_nodes(): run('create') output = run('listnodes') assert_mongods_running(3) assert 3 == output.stdout.count('Node')
def test_should_not_fail_if_no_state_file(): assert_mongods_running(0) assert_no_state_file() output = run('listnodes')
def test_should_not_fail_if_no_state_file(): assert_mongods_running(0) assert_no_state_file() run('killnodes all')