Merge "Bugfix: task_id parameter from API can not pass to yardstick core"
[yardstick.git] / yardstick / benchmark / scenarios / networking / netperf_install.bash
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
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 set -e
13
14 svc="netserver"
15 if pgrep $svc >/dev/null
16 then
17     echo "$svc have existed, exit!"
18     exit 0
19 fi
20
21 echo "===Install netperf before test begin!!!==="
22 cp /etc/apt/sources.list /etc/apt/sources.list_bkp
23 cp /etc/resolv.conf /etc/resolv.conf_bkp
24 echo "nameserver 8.8.4.4" >> /etc/resolv.conf
25
26 cat <<EOF >/etc/apt/sources.list
27 deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
28 deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
29 deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
30 deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
31 deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
32 EOF
33
34 sudo apt-get update
35 sudo apt-get install -y netperf
36
37 service netperf start
38
39 echo "===Install netperf before test end!!!==="
40