def test_stop_server(self): """Check touch_to_state puts a server into "Stopped" state. """ artifact_id = self.my_create_appliance("teststopped") s.touch_to_state(None, artifact_id, "Stopped") status = s.check_state(artifact_id) self.assertEqual(status, "Stopped")
def test_preboost_server(self): """Check touch_to_state puts a server into "Preparing" state. """ artifact_id = self.my_create_appliance("testpreboost") s.touch_to_state(None, artifact_id, "Preparing") status = s.check_state(artifact_id) self.assertEqual(status, "Preparing")
def server_state(request): """Get the status for a server. Anyone can request this, :param name: Name of VApp which we want to stop. :returns: The state, by name. """ vm_id, actor_id = _resolve_vm(request) return server.check_state(vm_id)