Disable blocking on buildable queue (Functest)
[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://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE/releng-xci
15
16 cd $WORKSPACE
17 git fetch $PROJECT_REPO $GERRIT_REFSPEC && sudo git checkout FETCH_HEAD
18
19 # combine opnfv and upstream scripts/playbooks
20 /bin/cp -rf $WORKSPACE/releng-xci/xci/infra/bifrost/* $WORKSPACE/
21
22 cd $WORKSPACE/releng-xci
23 cat > bifrost_test.sh<<EOF
24 #!/bin/bash
25 set -o errexit
26 set -o nounset
27 set -o pipefail
28
29 cd ~/bifrost
30 # set path for XCI repository
31 export XCI_PATH=~/bifrost/releng-xci
32
33 # provision 3 VMs; xcimaster, controller, and compute
34 ./scripts/bifrost-provision.sh | ts
35
36 sudo -H -E virsh list
37 EOF
38 chmod a+x bifrost_test.sh
39
40 # Fix up distros
41 case ${DISTRO} in
42         xenial) VM_DISTRO=ubuntu ;;
43         centos7) VM_DISTRO=centos ;;
44         *suse*) VM_DISTRO=opensuse ;;
45 esac
46
47 export XCI_BUILD_CLEAN_VM_OS=false
48 export XCI_UPDATE_CLEAN_VM_OS=true
49
50 ./xci/scripts/vm/start-new-vm.sh $VM_DISTRO
51
52 rsync -a -e "ssh -F $HOME/.ssh/${VM_DISTRO}-xci-vm-config" $WORKSPACE/ ${VM_DISTRO}_xci_vm:~/bifrost
53
54 ssh -F $HOME/.ssh/${VM_DISTRO}-xci-vm-config ${VM_DISTRO}_xci_vm "cd ~/bifrost/releng-xci && ./bifrost_test.sh"