Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
exbotanical committed Jan 21, 2025
1 parent 871b5f4 commit 32808ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/api/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ write_crontabs_command (int client_fd) {
char* cmd_esc = escape_json_string(ce->cmd);

char* s = s_fmt(
"{\"id\":\"%d\",\"cmd\":\"%s\",\"schedule\":\"%s\",\"owner\":\"%s\","
"{\"id\":\"%d\",\"filepath\":\"%s\",\"cmd\":\"%s\",\"schedule\":\"%s\","
"\"owner\":\"%s\","
"\"envp\":\"%s\",\"next\":\"%s\"}%s",
ce->id,
entry->key,
cmd_esc,
ce->schedule,
ct->uname,
Expand Down
8 changes: 5 additions & 3 deletions t/integ/ipc_shpec.bash
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ describe 'ipc API IPC_SHOW_INFO command'
end_describe

describe 'ipc API IPC_LIST_CRONTABS command'
n_syscrontabs="$(find /etc/cron.{hourly,daily,weekly,monthly} -type f 2>/dev/null | wc -l)"
n_syscrontabs="$(find /etc/cron.{hourly,daily,weekly,monthly} -type f 2>/dev/null | wc -l)"
start_chronic
sleep 5

out="$(sock_call '{ "command" : "IPC_LIST_CRONTABS"}' 2>/dev/null | tr -d '\0')"
out="$(sock_call '{ "command" : "IPC_LIST_CRONTABS"}')"
echo ">>>>> $(echo "$out" | wc -l)"

it 'lists all crontabs'
assert equal $(jq 'length' <<< "$out") "$((n_syscrontabs + 3))"
Expand All @@ -177,7 +178,8 @@ describe 'ipc API IPC_LIST_JOBS command'
echo 'sleeping for 60 seconds...'
sleep 60

out="$(sock_call '{ "command" : "IPC_LIST_JOBS"}' 2>/dev/null | tr -d '\0')"
out="$(sock_call '{ "command" : "IPC_LIST_JOBS"}')"
echo ">>> $out"

it 'lists all jobs'
assert gt "$(jq 'length' <<< "$out")" 0
Expand Down
10 changes: 5 additions & 5 deletions t/integ/utils/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ TESTING_DIR=t/integ
UTILS_F=run_utils.bash

declare -a SKIP_FILES=(
# 'daemon_shpec.bash'
'daemon_shpec.bash'
# 'ipc_shpec.bash'
# 'peripherals_shpec.bash'
# 'root_shpec.bash'
# 'sig_shpec.bash'
# 'user_shpec.bash'
'peripherals_shpec.bash'
'root_shpec.bash'
'sig_shpec.bash'
'user_shpec.bash'
)

run_test () {
Expand Down

0 comments on commit 32808ad

Please sign in to comment.