Merge "fuel-deploy.sh: Drop local_env mechanism"
[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 cd $WORKSPACE/bifrost
29 ./scripts/bifrost-provision.sh
30
31 # list the provisioned VMs
32 cd $WORKSPACE/bifrost
33 source env-vars
34 ironic node-list
35 sudo -H -E virsh list
36 EOF
37 chmod a+x bifrost_test.sh
38
39 ./xci/scripts/vm/start-new-vm.sh $DISTRO
40
41 rsync -a $WORKSPACE/bifrost ${DISTRO,,}_xci_vm:~/bifrost
42
43 ssh ${DISTRO,,}_xci_vm "cd ~/bifrost && ./bifrost_test.sh"