7.3. ufs_test_utils module

create_yaml()[source]

Parses default rt.conf into ufs_test.yaml

delete_files(deletefiles)[source]

Removes specified filepath

Parameters:

deletefiles (str) – filepath to remove, e.g., tests/rocoto.*

get_testcase(test)[source]

Retrieves test case names and configs from given dictionary from PyYAML

Parameters:

test (dict) – Dictionary retrieved from reading in YAML test file

Returns:

case_name, case_config – Test name (str) and Python dictionary of test configuration

get_testdep(casename, val)[source]

Retrieves test case dependencies

Parameters:
  • casename (str) – Test case name

  • val (dict) – Test case attributes, e.g., val[‘compiler’]

Returns:

test_dep – Dictionary with test case and configuration for the specified dependency

Creates symlinks for newly generated baselines

machine_check_off(machine_id, val)[source]

Checks turned-off machine from YAML configuration

Parameters:
  • machine_id (str) – Local machine name

  • val (dict) – Build and test config dictionary list

Returns:

pass_machine – Logical flag to pass local machine

parse_line(str_in)[source]

Parses rt.conf line into list

Parameters:

str_in (str) – RUN or COMPILE line from rt.conf

Returns:

build_attr – List of RUN or COMPILE test attributes

rrmdir(path)[source]

Removes all files and directories in specified path.

Parameters:

path (str) – File path to remove

string_clean(str_in)[source]

Strips out RUN or COMPILE whitespace and separates with commas.

Parameters:

str_in (str) – RUN or COMPILE line read in from rt.conf

Returns:

str – Whitespace stripped and comma separated values

sync_testscripts()[source]

Symlinks sharable rt.sh test scripts

update_testyaml(input_list)[source]

Generates temporary test YAML based on list of tests received

Parameters:

input_list (list) – list of tests to run

update_testyaml_b()[source]

Updates test YAML file for tests specified in -b <file>

update_testyaml_n()[source]

Updates test YAML file for a single test specified in -n <test_name> <compiler>

write_logfile(logfile, openmod, output='', subproc='')[source]

Appends given output into log file

Parameters:
  • logfile (str) – Log filename

  • openmod (str) – Mode to open file in

  • output (str) – Content to append to log file. Defaults to “”.

  • subproc (str) – Command to run within the shell. Defaults to “”.