def test_terminate_on_unexpected_revoke_machine_ready():
    with create_upstream_context() as ctxt:
        ctxt.send_msg(Message.ServiceDescription("AcceptanceTest", 2))
        ctxt.expect_message("ServiceDescription")

        msg = Message.RevokeMachineReady()
        ctxt.send_msg(msg)
        # other end has to close connection so check if socked is dead now, optionally a Notification can be sent before closing
        try:
            ctxt._socket.recv(0)
            uc.expect_message("Notification")
            ctxt.close()
            raise ValueError("RevokeMachineReady erroneously accepted after handshake")
        except:
            pass
Пример #2
0
def connect_board_available_disconnect_n_times():
    for _ in range(10):
        with create_upstream_context_with_board_available() as ctxt:
            ctxt.send_msg(Message.MachineReady())
            ctxt.send_msg(Message.RevokeMachineReady())