# Stack for creating testnode instances to be run via nxdtest on Nexedi testing
# infrastructure.
#
# Usage:
#
#    ---- 8< ---- (<software>/test.cfg)
#    [buildout]
#    extends = .../stack/nxdtest.cfg
#
#    parts =
#       ...
#
#    #  for instance
#       slapos-cookbook
#       instance.cfg
#
#    ...
#
#    [instance.cfg]
#    <= jinja2-template
#    template = inline:
#      [buildout]
#      extends = ${nxdtest-instance.cfg:rendered}
#
#      [runTestSuite]
#      env.sh  = ...
#      workdir = ...
#
# Created instance will have bin/runTestSuite that sources env.sh and runs
# nxdtest in workdir.

[buildout]
extends =
    slapos.cfg
    ../component/nxdtest/buildout.cfg
    nxdtest/buildout.hash.cfg

[jinja2-template]
recipe   = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/${:_buildout_section_name_}
mode     = 0644
context  =
  section buildout  buildout

[nxdtest-instance.cfg]
<= jinja2-template
template = ${:_profile_base_location_}/nxdtest/${:filename}
# NOTE += does not work
context =
  section buildout  buildout
  section nxdtest   nxdtest