Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-5010

ACL self tests written in python handle self.fail incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.14
    • None
    • C++ Broker, C++ Client
    • None
    • cmake 'make test', or ./cpp/src/tests/run_acl_tests

    Description

      When a self.fail() function is called inside a try: block then control simply passes to the except: handler. The function does not exit with a failure.

      In this example suppose that the get_connection() for evildude is expected to fail but it does not.

      try:
          conne1 = self.get_connection('evildude','evildude')
          self.fail("Should not create a connection for user evildude")
      except Exception, e:
          result = None
          self.fail("8888:" + str(e))
      

      produces failure:

      AssertionError: 8888:Should not create a connection for user evildude
      

      Code in acl.py expected the function to exit with the signalled error. To properly fail the code must set a flag while in the try block and then test that flag to sequently fail outside of the try block.

      Attachments

        Activity

          People

            chug Charles E. Rolke
            chug Charles E. Rolke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: