NAME

Tapper::PRC::Testcontrol - Control running test programs

FUNCTIONS

capture_handler_tap

This function is a handler for the capture function. It handles capture requests of type 'tap'. This means the captured output is supposed to be TAP already and therefore no transformation is needed.

@param file handle - opened file handle

@return string - output in TAP format @return error - die()

send_output

Send the captured TAP output to the report receiver.

@param string - TAP text

@return success - 0 @return error - error string

send_output

Send the a attachment to the report receiver and add attachements.

@return success - 0 @return error - error string

upload_files

Upload files written in one stage of the testrun to report framework.

@param int - report id @param int - testrun id

@return success - 0 @return error - error string

get_appendix

For testprogram with the same name the output file names will be identical. To prevent this, we append a serial number. This function calculates this appendix and returns the next one to use. If no such serial is needed because no output file of the given name exists yet the empty string is returned.

@param string - name of the output file without appendix

@return string - string to append to output file name to make it unique

kill_process($pid)

Gracefully kill a single process.

get_process_tree($pid)

Get list of children for a process. The process itself is not contained in the list.

kill_process_tree($pid)

Kill whole tree of processes, depth-first, with extreme prejudice.

testprogram_execute

Execute one testprogram. Handle all error conditions.

@param hash ref - contains all config options for program to execute * program - program name * timeout - timeout in seconds * outdir - output directory * parameters - arrayref of strings - parameters for test program * environment - hashref of strings - environment variables for test program * chdir - string - where to chdir before executing the testprogram

@return success - 0 @return error - error string

guest_start

Start guest images for virtualisation. Only Xen guests can be started at the moment.

@return success - 0 @return error - error string

create_log

Checks whether fifos for guest logging exists and creates them if not. Existing files of wrong type are deleted.

@retval success - 0 @retval error - error string

nfs_mount

Mount the output directory from an NFS server. This method is used since we only want to mount this NFS share in live mode.

@return success - 0 @return error - error string

control_testprogram

Control running of one program including caring for its input, output and the environment variables some testers asked for.

@return success - 0 @return error - error string

get_peers_from_file

Read syncfile and extract list of peer hosts (not including this host).

@param string - file name

@return success - hash ref

@throws plain error message

wait_for_sync

Synchronise with other hosts belonging to the same interdependent testrun.

@param array ref - list of hostnames of peer machines

@return success - 0 @return error - error string

send_keep_alive_loop

Send keepalive messages to MCP in an endless loop.

@param int - sleep time between two keepalives

run

Main function of Program Run Control.

AUTHORS

  • AMD OSRC Tapper Team <tapper@amd64.org>

  • Tapper Team <tapper-ops@amazon.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by Advanced Micro Devices, Inc..

This is free software, licensed under:

The (two-clause) FreeBSD License