Crinit -- Configurable Rootfs Init
Loading...
Searching...
No Matches
case-success.c File Reference

(/usr/bin/git 2025-02-19, commit: 5f1bbfa)

Unit test for crinitExpandPIDVariablesInSingleCommand(), successful execution. More...

#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "confhdl.h"
#include "unit_test.h"
#include "utest-crinit-expand-pid-variables.h"
Include dependency graph for case-success.c:

Functions

int crinitExpandPIDVariablesInSingleCommand (char *input, const pid_t pid, char **result)
 
void crinitExpandPIDVariablesInCommands (crinitTaskCmd_t *commands, size_t cmdsSize, const pid_t pid)
 Expands variable ${TASK_PID} in a command with the task's PID.
 
void crinitExpandPIDVariablesInSingleCommandOneVariableReplaced (void **state)
 
void crinitExpandPIDVariablesInSingleCommandTwoVariablesReplaced (void **state)
 
void crinitExpandPIDVariablesInCommandsOneVariableInThreeArgv (void **state)
 
void crinitExpandPIDVariablesInCommandsOneVariableInThreeCommands (void **state)
 

Detailed Description

Unit test for crinitExpandPIDVariablesInSingleCommand(), successful execution.

Function Documentation

◆ crinitExpandPIDVariablesInCommands()

void crinitExpandPIDVariablesInCommands ( crinitTaskCmd_t commands,
size_t  cmdsSize,
const pid_t  pid 
)

Expands variable ${TASK_PID} in a command with the task's PID.

Please note that this makes only sense for a STOP_COMMAND. Currently this is the only variable that can be expanded here.

Parameters
commandsPointer to task command structure
cmdsSizeNumber of elements in commands
pidPID of task

◆ crinitExpandPIDVariablesInCommandsOneVariableInThreeArgv()

void crinitExpandPIDVariablesInCommandsOneVariableInThreeArgv ( void **  state)

Tests successful parsing and replacement of a command task structure

◆ crinitExpandPIDVariablesInCommandsOneVariableInThreeCommands()

void crinitExpandPIDVariablesInCommandsOneVariableInThreeCommands ( void **  state)

Tests successful parsing and replacement of a command task structure

◆ crinitExpandPIDVariablesInSingleCommand()

int crinitExpandPIDVariablesInSingleCommand ( char *  input,
const pid_t  pid,
char **  result 
)

◆ crinitExpandPIDVariablesInSingleCommandOneVariableReplaced()

void crinitExpandPIDVariablesInSingleCommandOneVariableReplaced ( void **  state)

Tests successful replacing one variable in a command.

◆ crinitExpandPIDVariablesInSingleCommandTwoVariablesReplaced()

void crinitExpandPIDVariablesInSingleCommandTwoVariablesReplaced ( void **  state)

Tests successful replacing two variables in a command.