예제 #1
0
    def test_wrap_control_file_server(self):
        self._test_wrap_control_file_helper()
        control_segment = '|control_segment|'

        control_file.apply_string_arguments.expect_call(
                control_file.SERVER_SEGMENT,
                control_raw=self.control).and_return(control_segment)

        result = control_file.wrap_control_file(control_file=self.control,
                                       is_server=True,
                                       skip_verify=False,
                                       verify_params=self.verify_params)

        self.assertEqual(result, self.verify_segment + control_segment)
        self.god.check_playback()
예제 #2
0
파일: rpc_utils.py 프로젝트: ceph/autotest
def wrap_control_file(plan, hostname, run_verify, test_config):
    """
    Wraps a control file using the ControlParameters for the plan
    """
    site_additional_wrap_arguments = utils.import_site_function(
            __file__, 'autotest_lib.frontend.planner.site_rpc_utils',
            'additional_wrap_arguments', _additional_wrap_arguments_dummy)
    additional_wrap_arguments = site_additional_wrap_arguments(plan, hostname)

    verify_params = get_wrap_arguments(
            plan, hostname, model_attributes.AdditionalParameterType.VERIFY)

    return control_file.wrap_control_file(
            control_file=test_config.control_file.contents,
            is_server=test_config.is_server,
            skip_verify=(not run_verify),
            verify_params=verify_params,
            **additional_wrap_arguments)
예제 #3
0
def wrap_control_file(plan, hostname, run_verify, test_config):
    """
    Wraps a control file using the ControlParameters for the plan
    """
    site_additional_wrap_arguments = utils.import_site_function(
        __file__, 'autotest_lib.frontend.planner.site_rpc_utils',
        'additional_wrap_arguments', _additional_wrap_arguments_dummy)
    additional_wrap_arguments = site_additional_wrap_arguments(plan, hostname)

    verify_params = get_wrap_arguments(
        plan, hostname, model_attributes.AdditionalParameterType.VERIFY)

    return control_file.wrap_control_file(
        control_file=test_config.control_file.contents,
        is_server=test_config.is_server,
        skip_verify=(not run_verify),
        verify_params=verify_params,
        **additional_wrap_arguments)
예제 #4
0
    def test_wrap_control_file_client(self):
        self._test_wrap_control_file_helper()
        control_base64 = 'control_base64'
        control_segment = '|control_segment|'

        self.god.stub_function(base64, 'encodestring')
        base64.encodestring.expect_call(self.control).and_return(control_base64)
        control_file.apply_string_arguments.expect_call(
                control_file.CLIENT_SEGMENT, control_base64=control_base64,
                control_comment=mock.is_string_comparator()).and_return(
                        control_segment)

        result = control_file.wrap_control_file(control_file=self.control,
                                       is_server=False,
                                       skip_verify=False,
                                       verify_params=self.verify_params)

        self.assertEqual(result, self.verify_segment + control_segment)
        self.god.check_playback()