Add bats test for generate jails with different times

This commit is contained in:
Victor LABORIE 2018-05-30 18:33:36 +02:00
parent b1400c83b6
commit ce674490f7
1 changed files with 11 additions and 0 deletions

11
test/generate.bats Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bats
@test "generate" {
jails="test0 test1 test2 test3 test4 test5"
for jail in ${jails}; do
bkctld init "${jail}"
random=$(od -An -N4 -i < /dev/urandom|grep -Eo "[0-9]{2}$")
date=$(date -d "${random} hour ago")
touch -m --date="${date}" "/backup/jails/${jail}/var/log/lastlog"
done
}