Example #1
0
 def setUp(self):
     logging.basicConfig(
         level=logging.NOTSET,
         format=
         '%(asctime)s %(levelname)s %(name)s pid(%(process)d) Message: %(message)s',
         filename='/tmp/imagefactory-unittests.log')
     self.expected_state_transitions = (("NEW", "INITIALIZING"),
                                        ("INITIALIZING", "PENDING"),
                                        ("PENDING", "FINISHING"),
                                        ("FINISHING", "COMPLETED"))
     self.if_agent = ImageFactoryAgent("localhost")
     self.if_agent.start()
     self.connection = cqpid.Connection("localhost")
     self.connection.open()
     self.console_session = ConsoleSession(self.connection)
     self.console_session.setAgentFilter(
         "[and, [eq, _vendor, [quote, 'redhat.com']], [eq, _product, [quote, 'imagefactory']]]"
     )
     self.console_session.open()
     self.console = MockConsole(self.console_session,
                                self.if_agent.image_factory_addr)
     self.console.start()
     time.sleep(5)  # Give the agent some time to show up.