コード例 #1
0
    def test_submit_test_event(self):
        """ Testing POST /EventService/SubmitTestEvent  """
        global task
        # Suppose rackhd and test stack have the same localhost
        server = Httpd(port=int(self.__httpd_port), handler_class=self.EventServiceHandler)
        task = WorkerThread(server, 'httpd')
        worker = WorkerTasks(tasks=[task], func=self.__httpd_start)
        worker.run()
        redfish().test_event(body={})
        worker.wait_for_completion(timeout_sec=60)
        if task.timeout:
            # Else port forward rackhd -> localhost
            server = Httpd(port=int(HTTPD_PORT), handler_class=self.EventServiceHandler)
            task = WorkerThread(server, 'httpd')
            worker = WorkerTasks(tasks=[task], func=self.__httpd_start)
            worker.run()

            # forward port for services running on a guest host
            session = open_ssh_forward(self.__httpd_port)

            redfish().test_event(body={})
            worker.wait_for_completion(timeout_sec=60)
            session.logout()
        self.assertFalse(task.timeout, msg='timeout waiting for task {0}'.format(task.id))
        self.assertFalse(self.__class__.eventHandlerFailed, msg='Event handler reported subscriptionId / memberId mismatch')
コード例 #2
0
ファイル: event_service_tests.py プロジェクト: uppalk1/RackHD
    def test_submit_test_event(self):
        """ Testing POST /EventService/SubmitTestEvent  """
        global task
        # Suppose rackhd and test stack have the same localhost
        server = Httpd(port=int(self.__httpd_port),
                       handler_class=self.EventServiceHandler)
        task = WorkerThread(server, 'httpd')
        worker = WorkerTasks(tasks=[task], func=self.__httpd_start)
        worker.run()
        redfish().test_event(body={})
        worker.wait_for_completion(timeout_sec=60)
        if task.timeout:
            # Else port forward rackhd -> localhost
            server = Httpd(port=int(HTTPD_PORT),
                           handler_class=self.EventServiceHandler)
            task = WorkerThread(server, 'httpd')
            worker = WorkerTasks(tasks=[task], func=self.__httpd_start)
            worker.run()

            # forward port for services running on a guest host
            session = open_ssh_forward(self.__httpd_port)

            redfish().test_event(body={})
            worker.wait_for_completion(timeout_sec=60)
            session.logout()
        assert_false(task.timeout,
                     message='timeout waiting for task {0}'.format(task.id))
コード例 #3
0
ファイル: event_service_tests.py プロジェクト: tannoa2/RackHD
 def test_submit_test_event(self):
     """ Testing POST /EventService/SubmitTestEvent  """
     global task
     server = Httpd(port=int(HTTPD_PORT), handler_class=self.EventServiceHandler)
     task = WorkerThread(server,'httpd')
     worker = WorkerTasks(tasks=[task], func=self.__httpd_start)
     worker.run()
     
     # forward port for services running on a guest host
     session = open_ssh_forward(self.__httpd_port) 
     
     redfish().test_event(body={})
     worker.wait_for_completion(timeout_sec=60)
     session.logout()
     assert_false(task.timeout, message='timeout waiting for task {0}'.format(task.id))
コード例 #4
0
ファイル: event_service_tests.py プロジェクト: tbattle/RackHD
    def test_submit_test_event(self):
        # """ Testing POST /EventService/SubmitTestEvent  """
        global task
        server = Httpd(port=int(HTTPD_PORT),
                       handler_class=self.EventServiceHandler)
        task = WorkerThread(server, 'httpd')
        worker = WorkerTasks(tasks=[task], func=self.__httpd_start)
        worker.run()

        # forward port for services running on a guest host
        session = open_ssh_forward(self.__httpd_port)

        redfish().test_event(body={})
        worker.wait_for_completion(timeout_sec=60)
        session.logout()
        self.assertFalse(task.timeout,
                         msg='timeout waiting for task {0}'.format(task.id))
        self.assertFalse(
            self.__class__.eventHandlerFailed,
            msg='Event handler reported subscriptionId / memberId mismatch')