qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Giusti <kgiu...@redhat.com>
Subject [Proton] Should engine allow links to be re-opened?
Date Fri, 10 Jan 2014 23:48:25 GMT
Hi,

While playing around with the proton-c engine, I tried to re-open a link that I had previously
closed.  The link failed to come up - but no error state was returned.

Should the engine allow a previously closed link to be re-opened?  IOW, should the engine
allow the following Link test to pass (code refactored from tests/python/proton_tests/engine.py
LinkTests):

  def test_open_close_reopen(self):

    self.snd.open()
    self.pump()
    self.rcv.open()
    self.pump()

    print "both open"
    print "SEND STATE %s" % hex(self.snd.state)
    print "RCV STATE %s" % hex(self.rcv.state)
    assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
    assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE

    self.snd.close()
    self.pump()
    self.rcv.close()
    self.pump()

    print "both closed"
    print "SEND STATE %s" % hex(self.snd.state)
    print "RCV STATE %s" % hex(self.rcv.state)
    assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
    assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED

    self.rcv.session.connection._transport.trace(Transport.TRACE_FRM)
    self.snd.session.connection._transport.trace(Transport.TRACE_FRM)

    print "Re opening..."
    self.rcv.open()
    self.pump()
    self.snd.open()
    self.pump()
    assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
    assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE

-- 
-K

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message