{% if slap_software_type == software_type -%}
[buildout]
parts =
  erp5-cluster
  binary-wrap-launcher
  
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true

# Request erp5-cluster instance
[erp5-cluster]
recipe = slapos.cookbook:request.serialised
sla = computer_guid
server-url = ${slap-connection:server-url}
key-file = ${slap-connection:key-file}
cert-file = ${slap-connection:cert-file}
computer-id = ${slap-connection:computer-id}
partition-id = ${slap-connection:partition-id}
name = ERP5 Cluster
software-url = ${slap-connection:software-release-url}
software-type = cluster
sla-computer_guid = {{ slapparameter_dict.get('launcher-computer-guid', computer_id) }}
config =
  use-ipv6
  ${:extra-config}
extra-config =
config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}

# Create wrapper and execute command with parameters
[binary-wrap-launcher]
recipe = slapos.cookbook:wrapper
log-path = ${basedirectory:log}/runScalabilityTestSuite.log
binary-path = {{ bin_directory }}/runScalabilityTestSuite
wrapper-path = ${rootdirectory:bin}/runScalabilityTestSuite
output = ${binary-wrap-launcher:binary-path}
# TODO : get the erp5-cluster main url (apache listening user port ?)
erp5-url = http://foo.bar
# Run scalability test suite wrapper command with parameters
# -\ dirty way to conserve spaces
command-line = "${binary-wrap-launcher:binary-path}" --erp5-url ${binary-wrap-launcher:erp5-url} --test-result-path {{ slapparameter_dict.get('test-result-path') }} --revision {{ slapparameter_dict.get('revision') }} --node-title {{ slapparameter_dict.get('node-title') }} --test-suite-master-url {{ slapparameter_dict.get('test-suite-master-url') }} --log-path ${binary-wrap-launcher:log-path}
return = url


# Create partition's directories
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = ${rootdirectory:var}/log

[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
var = ${buildout:directory}/var
bin = ${buildout:directory}/bin

{% endif %}