jjb: xci: Use the correct SSH configuration file
[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/bifrost/* $WORKSPACE/
21
22 cd $WORKSPACE/releng-xci
23 cat > bifrost_test.sh<<EOF
24 cd ~/bifrost
25 # provision 3 VMs; xcimaster, controller, and compute
26 ./scripts/bifrost-provision.sh
27
28 sudo -H -E virsh list
29 EOF
30 chmod a+x bifrost_test.sh
31
32 # Fix up distros
33 case ${DISTRO} in
34         xenial) VM_DISTRO=ubuntu ;;
35         centos7) VM_DISTRO=centos ;;
36         *suse*) VM_DISTRO=opensuse ;;
37 esac
38
39 export XCI_BUILD_CLEAN_VM_OS=false
40 export XCI_UPDATE_CLEAN_VM_OS=true
41
42 ./xci/scripts/vm/start-new-vm.sh $VM_DISTRO
43
44 rsync -a -e "ssh -F $HOME/.ssh/xci-vm-config" $WORKSPACE/ ${VM_DISTRO}_xci_vm:~/bifrost
45
46 ssh -F $HOME/.ssh/xci-vm-config ${VM_DISTRO}_xci_vm "cd ~/bifrost/releng-xci && ./bifrost_test.sh"