263f544ad54ffd669a0ec1483b9a826ada646455
[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 # list the provisioned VMs
29 source env-vars
30 ironic node-list
31 sudo -H -E virsh list
32 EOF
33 chmod a+x bifrost_test.sh
34
35 # Fix up distros
36 case ${DISTRO} in
37         xenial) VM_DISTRO=ubuntu ;;
38         centos7) VM_DISTRO=centos ;;
39         *suse*) VM_DISTRO=opensuse ;;
40 esac
41
42 export XCI_BUILD_CLEAN_VM_OS=false
43 export XCI_UPDATE_CLEAN_VM_OS=true
44
45 ./xci/scripts/vm/start-new-vm.sh $VM_DISTRO
46
47 rsync -a $WORKSPACE/ ${VM_DISTRO}_xci_vm:~/bifrost
48
49 ssh -F $HOME/.ssh/xci-vm-config ${VM_DISTRO}_xci_vm "cd ~/bifrost/releng-xci && ./bifrost_test.sh"