Sharp.Augeas/Sharp.Augeas.Test/lens/tests/test_cron_user.aug

35 lines
779 B
Plaintext
Raw Normal View History

2022-11-08 20:57:02 +03:00
module Test_Cron_User =
let s = "MAILTO=cron@example.com
31 * * * * ${HOME}/bin/stuff
54 16 * * * /usr/sbin/tmpwatch -umc 30d ${HOME}/tmp\n"
let lns = Cron_User.lns
test lns get s =
{ "MAILTO" = "cron@example.com" }
{ "entry" = "${HOME}/bin/stuff"
{ "time"
{ "minute" = "31" }
{ "hour" = "*" }
{ "dayofmonth" = "*" }
{ "month" = "*" }
{ "dayofweek" = "*" }
}
}
{ "entry" = "/usr/sbin/tmpwatch -umc 30d ${HOME}/tmp"
{ "time"
{ "minute" = "54" }
{ "hour" = "16" }
{ "dayofmonth" = "*" }
{ "month" = "*" }
{ "dayofweek" = "*" }
}
}
test lns put s after
rm "/MAILTO";
rm "/entry[time/minute = '54']";
set "/entry[. = '${HOME}/bin/stuff']/time/minute" "24" =
"24 * * * * ${HOME}/bin/stuff\n"