summaryrefslogtreecommitdiffstats
path: root/odl-pipeline/lib
diff options
context:
space:
mode:
authorNikolas Hermanns <nikolas.hermanns@ericsson.com>2016-12-13 15:09:04 +0100
committerNikolas Hermanns <nikolas.hermanns@ericsson.com>2016-12-13 15:10:05 +0100
commitedff2695d6956d59b22951043f970fc55cddbe16 (patch)
treeec6c960e0b4f74e966837f1fbff8af879352b8b7 /odl-pipeline/lib
parent4a9cd22e5d4b44419721c4b7ef6c92c186963e4a (diff)
test_environment upload the cloner info to jenkins
Change-Id: If2f4d548a85732f3ef8e5412e67c377024f7d63b Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com>
Diffstat (limited to 'odl-pipeline/lib')
-rwxr-xr-xodl-pipeline/lib/test_environment/test_environment.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/odl-pipeline/lib/test_environment/test_environment.py b/odl-pipeline/lib/test_environment/test_environment.py
index 481f38d..8af6b58 100755
--- a/odl-pipeline/lib/test_environment/test_environment.py
+++ b/odl-pipeline/lib/test_environment/test_environment.py
@@ -5,6 +5,7 @@ from utils.service import Service
from utils.processutils import execute
from utils import utils_yaml
from utils.shutil import shutil
+from utils.node_manager import NodeManager
MAX_NODES = 5
@@ -21,9 +22,10 @@ class TestEnvironment(Service):
self.cleanup()
if sys_args.cleanup:
return
- if not sys_args.cloner_info or not sys_args.snapshot_disks:
- LOG.error('--cloner-info, --snapshot-disks have to be given if not'
- ' only cleanup.')
+ if not sys_args.cloner_info or not sys_args.snapshot_disk\
+ or not sys_args.vjump_hosts:
+ LOG.error('--cloner-info, --snapshot-disks and --vjump-hosts '
+ ' have to be given if not only --cleanup.')
exit(1)
node_info = utils_yaml.read_dict_from_yaml(sys_args.cloner_info +
'/node.yaml')
@@ -85,6 +87,22 @@ class TestEnvironment(Service):
'nodes_cpu': i,
'host_cpu': cores})
+ # Upload cloner_info to jenkins slave
+ jenkins_slaves = NodeManager(
+ utils_yaml.read_dict_from_yaml(
+ sys_args.vjump_hosts)['servers']).get_nodes()
+ if 'CLONER_INFO' in os.environ:
+ cloner_info_path = os.environ['CLONER_INFO']
+ else:
+ cloner_info_path = '/home/jenkins/cloner-info/'
+ node_name = 'jenkins%s' % self.env
+ if node_name not in jenkins_slaves:
+ raise Exception('Jenkins host %s not provided in %s'
+ % (node_name,
+ sys_args.vjump_hosts))
+ jenkins_slaves[node_name].copy('to', sys_args.cloner_info,
+ cloner_info_path)
+
def check_if_br_exists(self, bridge):
_, (_, rc) = execute('ovs-vsctl br-exists %s' % bridge,
check_exit_code=[0, 2], as_root=True)
@@ -118,6 +136,9 @@ class TestEnvironment(Service):
required=False)
parser.add_argument('--snapshot-disks', help="Path to the snapshots",
required=False)
+ parser.add_argument('--vjump-hosts', help=("Path to the information of"
+ " the virtual jumphosts"),
+ required=False)
parser.add_argument('--cleanup', help="Only Cleanup",
required=False, action='store_true')
return parser