From 4a438d9114b7ecbad3554fdc95668a0f6af7c087 Mon Sep 17 00:00:00 2001
From: Gabriel Monnerat <gabriel@tiolive.com>
Date: Wed, 12 Oct 2011 14:52:17 +0200
Subject: [PATCH] add argument in testnode section to be possible pass the list
 of bt5(as string) that will be used by runUnitTest.

---
 slapos/recipe/erp5testnode/__init__.py                 | 10 ++++++++++
 .../recipe/erp5testnode/template/erp5testnode.cfg.in   |  1 +
 2 files changed, 11 insertions(+)

diff --git a/slapos/recipe/erp5testnode/__init__.py b/slapos/recipe/erp5testnode/__init__.py
index e5730fed6..af7177dc2 100644
--- a/slapos/recipe/erp5testnode/__init__.py
+++ b/slapos/recipe/erp5testnode/__init__.py
@@ -64,7 +64,17 @@ class Recipe(BaseSlapRecipe):
     CONFIG['slapproxy_binary'] = self.options['slapproxy_binary']
     CONFIG['zip_binary'] = self.options['zip_binary']
     CONFIG['PATH'] = os.environ['PATH']
+    additional_bt5_repository_id = \
+        self.parameter_dict.get('additional_bt5_repository_id')
 
+    CONFIG['bt5_path'] = None
+    if additional_bt5_repository_id is not None:
+      CONFIG['bt5_path'] = ""
+      additional_bt5_repository_id_list = additional_bt5_repository_id.split(",")
+      for id in additional_bt5_repository_id_list:
+        id_path = os.path.join(CONFIG['slapos_directory'], id)
+        bt_path = os.path.join(id_path, "bt5")
+        CONFIG['bt5_path'] += "%s,%s," % (id_path, bt_path)
     CONFIG['instance_dict'] = ''
     if 'instance_dict' in self.parameter_dict:
       CONFIG['instance_dict'] = '[instance_dict]\n'
diff --git a/slapos/recipe/erp5testnode/template/erp5testnode.cfg.in b/slapos/recipe/erp5testnode/template/erp5testnode.cfg.in
index 3318c1fd1..08c4619a2 100644
--- a/slapos/recipe/erp5testnode/template/erp5testnode.cfg.in
+++ b/slapos/recipe/erp5testnode/template/erp5testnode.cfg.in
@@ -14,6 +14,7 @@ project_title= %(project_title)s
 ipv4_address = %(ipv4_address)s
 ipv6_address = %(ipv6_address)s
 test_suite_master_url = %(test_suite_master_url)s
+bt5_path = %(bt5_path)s
 
 # Binaries
 git_binary = %(git_binary)s
-- 
2.30.9