Browse Source

fix: dev: [cron] make test pass again

pull/43/head
Valentin Lab 6 months ago
parent
commit
115fb33060
  1. 2
      cron/lib/common
  2. 11
      cron/test/entries_from_service

2
cron/lib/common

@ -73,7 +73,7 @@ cron:get_config() {
;; ;;
esac > "$cache_file.tmp" esac > "$cache_file.tmp"
mv -v "$cache_file.tmp" "$cache_file" >&2
mv "$cache_file.tmp" "$cache_file" >&2
## if cache file is empty, this is an error ## if cache file is empty, this is an error
if [ ! -s "$cache_file" ]; then if [ ! -s "$cache_file" ]; then

11
cron/test/entries_from_service

@ -45,11 +45,6 @@ cfg-get-value() {
} }
export -f cfg-get-value export -f cfg-get-value
yaml_get_interpret() {
shyaml get-value
}
export -f yaml_get_interpret
get_top_master_service_for_service() { get_top_master_service_for_service() {
local service="$1" local service="$1"
echo "$service" echo "$service"
@ -62,6 +57,12 @@ get_service_charm() {
} }
export -f get_service_charm export -f get_service_charm
charm.get_dir() {
local charm="$1"
echo "/path/to/charm-store/$charm"
}
export -f charm.get_dir
export CACHEDIR=$(mktemp -d -t tmp.XXXXXXXXXX) export CACHEDIR=$(mktemp -d -t tmp.XXXXXXXXXX)
export state_tmpdir=$(mktemp -d -t tmp.XXXXXXXXXX) export state_tmpdir=$(mktemp -d -t tmp.XXXXXXXXXX)
trap "rm -rf \"$state_tmpdir\"" EXIT trap "rm -rf \"$state_tmpdir\"" EXIT

Loading…
Cancel
Save