To modify Ixia port numbers and IP in pod.yaml
[kvmfornfv.git] / ci / envs / host-install-qemu.sh
1 #!/bin/bash
2
3 ###############################################################################
4 ## Copyright (c) 2016 Intel Corp.
5 ##
6 ## All rights reserved. This program and the accompanying materials
7 ## are made available under the terms of the Apache License, Version 2.0
8 ## which accompanies this distribution, and is available at
9 ## http://www.apache.org/licenses/LICENSE-2.0
10 ###############################################################################
11
12 source utils.sh
13 source host-config
14
15 QEMU_VERSION=$( getQemuVersion )
16
17 if [ -z $QEMU_VERSION ];then
18    echo "qemu RPM not found"
19    exit 1
20 fi
21 rpmdir=${1:-"/root/workspace/rpm/"}
22 rpmpat="qemu-${QEMU_VERSION}*.rpm"
23
24 install_qemu () {
25     # Removing Existing qemu rpms
26     qemu_rpm=$(rpm -qa | grep 'qemu')
27     echo "Removing Existing qemu packages"
28     rpm -ev $qemu_rpm
29     # Install the qemu rpm
30     filenum=`ls -l ${rpmdir}/${rpmpat} |wc -l`
31     if [ $filenum -eq 0 ]
32     then
33         echo "No qemu rpm found in workspace/rpm"
34         exit 1
35     elif [ $filenum -gt 1 ]
36     then
37         echo "Multiple qemu rpm found in workspace/rpm"
38         exit 1
39     else
40        qrpm=`find "${rpmdir}" -name "${rpmpat}"`
41         rpm -ihv $qrpm
42     fi
43 }
44 install_qemu