コード例 #1
0
    def test_simultaneous_sampling(self):
        assert self.trex.is_running(
        ) == False  # first, make sure T-Rex is not running
        tmp_trex = CTRexClient(
            self.trex_server_name
        )  # initialize another client connecting same server
        ret = self.trex.start_trex(**
                                   self.valid_start_params)  # start T-Rex run
        assert ret == True  # make sure 1st run submitted successfuly

        time.sleep(6)
        # now, sample server from both clients
        while (self.trex.is_running()):
            info_1 = self.trex.get_running_info()
            info_2 = tmp_trex.get_running_info()

            # make sure samples are consistent
            if self.trex.get_result_obj().is_valid_hist():
                assert tmp_trex.get_result_obj().is_valid_hist() == True
            if self.trex.get_result_obj().is_done_warmup():
                assert tmp_trex.get_result_obj().is_done_warmup() == True
            # except TRexError as inst: # T-Rex might have stopped between is_running result and get_running_info() call
            #     # hence, ingore that case
            #     break

        assert self.trex.is_running() == False
コード例 #2
0
    def test_start_more_than_once_different_users(self):
        assert self.trex.is_running() == False                  # first, make sure TRex is not running
        ret = self.trex.start_trex(**self.valid_start_params)   # start 1st TRex run
        assert ret == True                                      # make sure 1st run submitted successfuly
        # time.sleep(1)
        
        tmp_trex = CTRexClient(self.trex_server_name)           # initialize another client connecting same server
        assert_raises(TRexInUseError, tmp_trex.start_trex, **self.valid_start_params)  # try to start TRex again

        ret = self.trex.stop_trex()
        assert ret==True    # make sure stop succeeded
        assert self.trex.is_running() == False
コード例 #3
0
    def test_simultaneous_sampling(self):
        assert self.trex.is_running() == False                  # first, make sure TRex is not running
        tmp_trex = CTRexClient(self.trex_server_name)           # initialize another client connecting same server
        ret = self.trex.start_trex(**self.valid_start_params)   # start TRex run
        assert ret == True                                      # make sure 1st run submitted successfuly

        time.sleep(6)
        # now, sample server from both clients
        while (self.trex.is_running()):
            info_1 = self.trex.get_running_info()
            info_2 = tmp_trex.get_running_info()

            # make sure samples are consistent
            if self.trex.get_result_obj().is_valid_hist():
                assert tmp_trex.get_result_obj().is_valid_hist() == True
            if self.trex.get_result_obj().is_done_warmup():
                assert tmp_trex.get_result_obj().is_done_warmup() == True
            # except TRexError as inst: # TRex might have stopped between is_running result and get_running_info() call
            #     # hence, ingore that case
            #     break   

        assert self.trex.is_running() == False
コード例 #4
0
 def __init__(self):
     self.trex_server_name = 'csi-kiwi-02'
     self.trex = CTRexClient(self.trex_server_name)
     pass
コード例 #5
0
 def test_verbose_mode(self):
     tmp_client = CTRexClient(self.trex_server_name, verbose=True)
     pass