jjb: xci: xci-verify-jobs: Fix block on bifrost jobs
[releng.git] / jjb / xci / bifrost-verify.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 set -o errexit
11 set -o nounset
12 set -o pipefail
13
14 git clone https://git.openstack.org/openstack/bifrost $WORKSPACE/bifrost
15 git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE/releng-xci
16
17 # checkout the patch
18 cd $CLONE_LOCATION
19 git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD
20
21 # combine opnfv and upstream scripts/playbooks
22 /bin/cp -rf $WORKSPACE/releng-xci/bifrost/* $WORKSPACE/bifrost/
23
24 cd $WORKSPACE/releng-xci
25 cat > bifrost_test.sh<<EOF
26 cd ~/bifrost
27 # provision 3 VMs; xcimaster, controller, and compute
28 ./scripts/bifrost-provision.sh
29
30 # list the provisioned VMs
31 source env-vars
32 ironic node-list
33 sudo -H -E virsh list
34 EOF
35 chmod a+x bifrost_test.sh
36
37 # Fix up distros
38 case ${DISTRO} in
39         xenial) VM_DISTRO=ubuntu ;;
40         centos7) VM_DISTRO=centos ;;
41         *suse*) VM_DISTRO=opensuse ;;
42 esac
43
44 ./xci/scripts/vm/start-new-vm.sh $VM_DISTRO
45
46 rsync -a $WORKSPACE/releng-xci ${VM_DISTRO}_xci_vm:~/bifrost
47
48 ssh -F $HOME/.ssh/xci-vm-config ${VM_DISTRO}_xci_vm "cd ~/bifrost && ./bifrost_test.sh"