Commit eea55d78 authored by Łukasz Nowak's avatar Łukasz Nowak

XXX Experiment with different cron mocking

Mock per section level instead of mocking the whole cron process.
parent 2d0d3884
......@@ -15,4 +15,8 @@
[template-test]
filename = test-instance.cfg.in
md5sum = 8650b9054e2a1b74b6ceca6927b56b90
md5sum = 851636fe4e190e086ed424fabf0f36a4
[template-kvm-export-mock]
filename = test-instance-kvm-export-mock.cfg.jinja2
md5sum = dbbc617d5c7fa3c488615db17982ee5f
[buildout]
extends = {{ template_kvm_export }}
[cron-entry-backup]
recipe = slapos.recipe.template:jinja2
inline =
${:command}
output = {{ cron_d_mock }}/${:name}
......@@ -13,6 +13,7 @@ services = $${:etc}/service
bin = $${buildout:directory}/bin
var = $${buildout:directory}/var
log = $${:var}/log
cron-d-mock = $${:var}/cron-d-mock
cron-env-entries = $${:etc}/cron-env.d
crontabs-env = $${:etc}/crontabs-env
cronstamps-env = $${:etc}/cronstamps-env
......@@ -43,3 +44,14 @@ recipe = slapos.cookbook:cron.d
name = environment
frequency = * * * * *
command = ${buildout:executable} -c 'import os ; import json ; print(json.dumps(dict(os.environ)))' > $${directory:var}/cron-environment.json
[dynamic-template-kvm-export-mock]
recipe = slapos.recipe.template:jinja2
url = ${template-kvm-export-mock:location}/${template-kvm-export-mock:filename}
output = $${buildout:directory}/template-kvm-export-mock.cfg
context =
key template_kvm_export dynamic-template-kvm-export:output
key cron_d_mock directory:cron-d-mock
[switch_softwaretype]
kvm-export = dynamic-template-kvm-export-mock:output
......@@ -14,7 +14,10 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
[template-kvm-export-mock]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
[dcron-output]
crond = ${:_profile_base_location_}/mock-crond
crond-orig = ${dcron:location}/sbin/crond
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