'list_live_nodes should be able to walk pages to get all live nodes and
should not have nodes after they are destroyed or stopped.
Also, _stop_node and start_node should be able to take a node off-line
and bring it back online.
Sorry for testing two things in this test.
Unfortunately, to verify pagination is working there must be two nodes
running. Also, to test start_node and _stop_node, there must be a
second instance started up. Since starting and stopping a node is time
consuming, I decided to combine these into the same test. My apologies
to future maintainers if this makes debugging failures less pleasant.'

def test_list_live_nodes_pagination_and_removal(self):

    api = gceblockdeviceapi_for_test(self)
    api = api.set('_page_size', 1)
    gce_fixture = self.useFixture(GCEComputeTestObjects(compute=api._operations._compute, project=get_machine_project(), zone=get_machine_zone()))
    other_instance_name = (u'functional-test-' + unicode(uuid4()))
    other_instance = gce_fixture.create_instance(other_instance_name)
    self.assertThat(api.list_live_nodes(), MatchesAll(Contains(other_instance_name), Contains(api.compute_instance_id())))
    api._stop_node(other_instance_name)
    self.assertThat(api.list_live_nodes(), MatchesAll(Not(Contains(other_instance_name)), Contains(api.compute_instance_id())))
    api.start_node(other_instance_name)
    self.assertThat(api.list_live_nodes(), MatchesAll(Contains(other_instance_name), Contains(api.compute_instance_id())))
    other_instance.destroy()
    self.assertThat(api.list_live_nodes(), MatchesAll(Not(Contains(other_instance_name)), Contains(api.compute_instance_id())))
