Commit 2e37243f authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Change ganeti-cleaner unittest to not use random values



Using random values in unittests isn't good. This one broke exactly
when building the 2.2.0~beta0 release. I suspect there were duplicate
job IDs generated (due to $large being not so large).
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent a0a470fa
......@@ -75,15 +75,13 @@ run_cleaner() {
create_archived_jobs() {
local i jobdir touchargs
local jobarchive=$queuedir/archive
local large=$(( RANDOM * RANDOM ))
local old_ts=$(date -d '25 days ago' +%Y%m%d%H%M)
# Remove jobs from previous run
find $jobarchive -mindepth 1 -type f | xargs -r rm
i=0
for job_id in {1..50} $(( large % RANDOM )) $RANDOM \
$(( large - 1 )) $large $(( large + 1 ))
for job_id in {1..50} 469581574 19857 1420164 494433 2448521
do
jobdir=$jobarchive/$(( job_id / 10 ))
test -d $jobdir || mkdir $jobdir
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment