Actions.CiRegressionActions package

Submodules

Actions.CiRegressionActions.ci_regression_actions module

Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class Actions.CiRegressionActions.ci_regression_actions.CIregressionActions[source]

Bases: object

This class contains keywords that are used in warrior regression test

check_kw_arg_type_prefix(str_value, int_value, float_value, bool_value, list_value, tuple_value, dict_value, file_value)[source]

This keyword is intended to test the type prefix for keyword arguments when an argument name has a type_ prefix, the variable type will become the type specified in the type_ prefix :Argument:

  1. str_value - expected to be string
  2. int_value - expected to be int
  3. float_value - expected to be float
  4. bool_value - expected to be bool
  5. list_value - expected to be list
  6. tuple_value - expected to be tuple
  7. dict_value - expected to be dict
  8. file_value - expected to be file
check_opt_values_from_datafile(langs=['Sanskrit', 'Tamil'], strvar='I am a default variable', states='wtag=states', system_name='sys_wtag', currencys={'USA': 'USD'}, ramspace=False, configfile='../../config_files/check_file_type', intvar=496)[source]

Verify the datatype of the value read from the datafile using either the tag or wtag feature :Argument:

  1. system_name = system name in the datafile
  2. strvar = string variable
  3. langs = list variable (should get from data file using wtag)
  4. states = tuple variable
  5. currencys = dict variable
  6. ramspace = boolean variable
  7. configfile = file variable
  8. intvar = int variable
check_tmp_file_exists(system_name='', filename='')[source]

check if temp folder exist in the parallel execution result tmp dir

check_values_from_datafile(system_name, strvar, langs, states, currencys, ramspace, configfile, intvar, anotherfile)[source]

Verify the datatype of the value read from the datafile using either the tag or wtag feature :Argument:

  1. system_name = system name in the datafile
  2. strvar = string variable
  3. langs = list variable (should get from data file using wtag)
  4. states = tuple variable
  5. currencys = dict variable
  6. ramspace = boolean variable
  7. configfile = file variable
  8. intvar = int variable
  9. anotherfile = file variable
compare_hybrid_tc_result(input_file)[source]

It takes the input file path which is the expected result and compares with the log file and returns True if both matches else False and prints the difference to console.

Arguments:
input_file: It takes expected result file path as input
create_sub_tmp_file(system_name='', filename='', delete='yes')[source]

Create temp file for parallel execution test

create_tmp_dir()[source]

Create a temp directory for parallel execution test

delete_tmp_dir()[source]

Delete temp directory for parallel execution test

end_of_tc_with_error(system_name, step_num)[source]

It is used to test the functionality of end of tc with error given in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
end_of_tc_with_system_name_given(system_name, step_num)[source]

It is used to test the functionality of end of tc with system name given in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
end_of_tc_with_system_name_not_given(system_name, step_num)[source]

It is used to test the functionality of end of tc with no system name given in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
generate_timestamp_delta(stored_delta_key, timestamp_key, desired_status)[source]
test keyword created for runmode_timer Generate a delta from comparing current time with store timestamp save the delta and current timestamp in repo for keyword verify_delta
Argument:

stored_delta_key = key name to store the list of delta timestamp_key = key name to store the timestamp desired_status = user desired status

input pass->true, fail->false and everything else ->exception

increase_value(key, status, max_value, max_status)[source]

write to a value in datarepo and return status if value == max, return max_status instead

instantiate_list_key_in_data_repository(key)[source]

This will create a key in the data_repository :param key: name of the key that should be created in the data_repository.

The data type of it’s value will be list.
Returns:status (bool), output_dict (dict)
local_data_test(desired_status)[source]

For testing/demo/placeholder return true/false/exception based on input :Argument:

desired_status = user desired status input pass->true, fail->false and everything else ->exception
once_per_tc_with_error(system_name, step_num)[source]

It is used to test the functionality of once per tc with error in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
once_per_tc_with_no_name_given(system_name, step_num)[source]

It is used to test the functionality of once per tc with no system name given in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
once_per_tc_with_system_name_given(system_name, step_num)[source]

It is used to test the functionality of once per tc with system name given in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
standard_with_error(system_name, step_num)[source]

It is used to test the functionality of standard with error in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
standard_with_system_name_given(system_name, step_num)[source]

It is used to test the functionality of standard with system name given in the test case Arguments:

system_name: Name of the system on which it needs to be Running step_num: It is the step_num in the test case file
Returns:
Returns True
standard_with_system_name_not_given(system_name, step_num)[source]

It is used to test the functionality of standard with no system name given in the test case Arguments:

system_name: Name of the system on which it needs to be run step_num: It is the step_num in the test case file
Returns:
Returns True
tmp_file_count(int_count)[source]

count how many files are under the temp dir

update_list_key_in_data_repository(key, value, status='True')[source]

This keyword will update an existing key in the data repository :param key: key name :param value: value to be updated :param: status: kw will pass/fail accordingly :return: status (bool), updated_dict (dict)

verify_delta(delta_key, int_num, float_min_val)[source]
test keyword created for runmode_timer Compare a list of delta to a minimum value This is used to ensure runmode is correctly waiting for a minimum amount of time (float_min_val)
Argument:delta_key = key name for the list of delta int_num = number of delta required in list of delta float_min_val = minimum value of each delta
verify_list_key_value_in_data_repo(key, expected_value)[source]

This keyword will update an existing key in the data repository :param key: key name :param value: value to be updated :return: status (bool), updated_dict (dict)

write_to_file(key, system_name)[source]

Here we are writing to the file which keyword ran and on which system

Argument:
Key: It is basically the keyword name followed by step num in the test case system_name: It is the system_name on which the step ran
Returns:
True

Module contents

Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.