Configurator API for Agent job control (tapi_cfg_job)

Overview

Configurator API for Agent job control. More…

// typedefs

typedef enum cfg_job_exit_status_type_t cfg_job_exit_status_type_t;
typedef struct cfg_job_exit_status_t cfg_job_exit_status_t;

// enums

enum cfg_job_exit_status_type_t;

// structs

struct cfg_job_exit_status_t;

// global variables

const tapi_job_methods_t cfg_job_methods;
tapi_job_method_create cfg_job_create;
tapi_job_method_start cfg_job_start;
tapi_job_method_kill cfg_job_kill;
tapi_job_method_killpg cfg_job_killpg;
tapi_job_method_wait cfg_job_wait;
tapi_job_method_stop cfg_job_stop;
tapi_job_method_destroy cfg_job_destroy;
tapi_job_method_set_workdir cfg_job_set_workdir;
tapi_job_method_set_autorestart cfg_job_set_autorestart;
tapi_job_method_get_autorestart cfg_job_get_autorestart;
tapi_job_method_recreate cfg_job_recreate;

Detailed Documentation

Configurator API for Agent job control. Since the API is based on “/agent/process” Configurator subtree, terms “job” and “process” are used interchangeably in this file.

Copyright (C) 2020-2022 OKTET Labs Ltd. All rights reserved.

Typedefs

typedef enum cfg_job_exit_status_type_t cfg_job_exit_status_type_t

Cause of process termination

typedef struct cfg_job_exit_status_t cfg_job_exit_status_t

Structure that represents status of a terminated process

Global Variables

const tapi_job_methods_t cfg_job_methods

Methods for job created by CFG factory

tapi_job_method_create cfg_job_create

Create a job

See also:

tapi_job_method_create

tapi_job_method_start cfg_job_start

Start a job

See also:

tapi_job_method_start

tapi_job_method_kill cfg_job_kill

Send a signal to the job

See also:

tapi_job_method_kill

tapi_job_method_killpg cfg_job_killpg

Send a signal to the job’s proccess group

See also:

tapi_job_method_killpg

tapi_job_method_wait cfg_job_wait

Wait for a job completion

Negative timeout_ms blocks the test execution until the job changes its status. Zero return value may also mean that the job was never started.

See also:

tapi_job_method_wait

tapi_job_method_stop cfg_job_stop

Stop a job

Parameters signo and term_timeout_ms are ignored, use -1 to avoid warnings

See also:

tapi_job_method_stop

tapi_job_method_destroy cfg_job_destroy

Destroy a job

Parameter term_timeout_ms is ignored, use -1 to avoid warning

See also:

tapi_job_method_destroy

tapi_job_method_set_workdir cfg_job_set_workdir

Set new working directory for a job.

This function should be called before the job is started.

See also:

tapi_job_method_set_workdir

tapi_job_method_set_autorestart cfg_job_set_autorestart

Set autorestart timeout for a job

This function should be called before the job is started

See also:

tapi_job_method_set_autorestart

tapi_job_method_get_autorestart cfg_job_get_autorestart

Get autorestart timeout of a job

See also:

tapi_job_method_get_autorestart

tapi_job_method_recreate cfg_job_recreate

Retrieve information about a job from Configurator

At this moment the function only checks that a process corresponding to the job exists, but later it might be extended to extract additional job data

See also:

tapi_job_method_recreate