Revision 6890cf2e test/ganeti-cleaner_unittest.bash
b/test/ganeti-cleaner_unittest.bash | ||
---|---|---|
56 | 56 |
} |
57 | 57 |
|
58 | 58 |
count_watcher() { |
59 |
local n=$1
|
|
59 |
local suffix="$1" n=$2
|
|
60 | 60 |
local count=$(find $watcherdir -maxdepth 1 -type f \ |
61 |
-name 'watcher.*.data' | wc -l) |
|
62 |
[[ "$count" -eq "$n" ]] || err "Found $count watcher files instead of $n" |
|
61 |
-name "watcher.*-*-*-*.$suffix" | wc -l) |
|
62 |
[[ "$count" -eq "$n" ]] || \ |
|
63 |
err "Found $count watcher files with suffix '$suffix' instead of $n" |
|
63 | 64 |
} |
64 | 65 |
|
65 | 66 |
count_and_check_certs() { |
... | ... | |
120 | 121 |
|
121 | 122 |
i=0 |
122 | 123 |
for uuid in ${uuids[@]}; do |
123 |
touch -d "$(( 5 * i )) days ago" $watcherdir/watcher.$uuid.data |
|
124 |
touch -d "$(( 5 * i )) days ago" \ |
|
125 |
$watcherdir/watcher.$uuid.{data,instance-status} |
|
124 | 126 |
|
125 | 127 |
let ++i |
126 | 128 |
done |
... | ... | |
197 | 199 |
|
198 | 200 |
upto 'Watcher status files' |
199 | 201 |
create_watcher_state |
200 |
count_watcher 10 |
|
202 |
count_watcher data 10 |
|
203 |
count_watcher instance-status 10 |
|
201 | 204 |
run_cleaner |
202 |
count_watcher 5 |
|
205 |
count_watcher data 5 |
|
206 |
count_watcher instance-status 5 |
|
203 | 207 |
|
204 | 208 |
exit 0 |
Also available in: Unified diff