예제 #1
0
 def tearDown(self):
     if not DEBUG:
         self.worker_processes.terminate()
     if self.queue:
         delete_queue("localhost", self.queue)
     if self.testrun_id:
         delete_queue("localhost", testrun_queue_name(self.testrun_id))
     if self.testrun_id2:
         delete_queue("localhost", testrun_queue_name(self.testrun_id2))
예제 #2
0
 def tearDown(self):
     if not DEBUG:
         self.worker_processes.terminate()
     if self.queue:
         delete_queue("localhost", self.queue)
     if self.testrun_id:
         delete_queue("localhost", testrun_queue_name(self.testrun_id))
     if self.testrun_id2:
         delete_queue("localhost", testrun_queue_name(self.testrun_id2))
예제 #3
0
    def __init__(self, server_host, testrun_id, response_queue=None):
        self.log = get_logger_adapter(__name__)
        self.host = server_host
        self.testrun_id = testrun_id
        self.conn = None
        self.channel = None

        if response_queue:
            self.response_queue = response_queue
        else:
            self.response_queue = testrun_queue_name(testrun_id)
예제 #4
0
    def tearDown(self):
        if not DEBUG:
            self.worker_processes.terminate()

        self._remove_zip_file(TEST_DEFINITION_ZIP)
        self._remove_files_created_by_remote_commands()

        if self.queue:
            delete_queue("localhost", self.queue)
        if self.testrun_id:
            delete_queue("localhost", testrun_queue_name(self.testrun_id))
예제 #5
0
    def __init__(self, server_host, testrun_id, response_queue=None):
        self.log = get_logger_adapter(__name__)
        self.host = server_host
        self.testrun_id = testrun_id
        self.conn = None
        self.channel = None

        if response_queue:
            self.response_queue = response_queue
        else:
            self.response_queue = testrun_queue_name(testrun_id)
    def tearDown(self):
        if not DEBUG:
            self.worker_processes.terminate()

        self._remove_zip_file(TEST_DEFINITION_ZIP)
        self._remove_files_created_by_remote_commands()

        if self.queue:
            delete_queue("localhost", self.queue)
        if self.testrun_id:
            delete_queue("localhost", testrun_queue_name(self.testrun_id))
예제 #7
0
    def _init_amqp(self):
        """
        Make the AMQP connection. 
        Prepare a Queue
        Start Consuming 
        """
        # Disabling "Attribute defined outside __init__" because this method is
        # called from the __init__
        #pylint: disable=W0201

        self._testrun_queue = testrun_queue_name(self._testrun_id)
        self._connection = amqp.Connection(host=self._host,
                                           userid=self._username,
                                           password=self._password,
                                           virtual_host=self._vhost,
                                           insist=False)
        self._channel = self._connection.channel()
        _init_queue(self._channel, self._testrun_queue, self._testrun_queue,
                    self._testrun_queue)
        self._channel.basic_consume(queue=self._testrun_queue,
                                    callback=self._on_message,
                                    no_ack=True)
예제 #8
0
    def _init_amqp(self):
        """
        Make the AMQP connection. 
        Prepare a Queue
        Start Consuming 
        """
        # Disabling "Attribute defined outside __init__" because this method is
        # called from the __init__
        #pylint: disable=W0201

        self._testrun_queue = testrun_queue_name(self._testrun_id)
        self._connection = amqp.Connection(host = self._host, 
                                           userid = self._username,
                                           password = self._password,
                                           virtual_host = self._vhost, 
                                           insist = False)
        self._channel = self._connection.channel()
        _init_queue(self._channel, 
                    self._testrun_queue, 
                    self._testrun_queue, 
                    self._testrun_queue)
        self._channel.basic_consume(queue = self._testrun_queue, 
                                    callback = self._on_message,
                                    no_ack = True)
 def tearDown(self):
     self.worker_processes.terminate()
     self.cleanup()
     if self.testrun_id:
         delete_queue("localhost", testrun_queue_name(self.testrun_id))