3 # Copyright (c) 2016 Open Platform for NFV Project, Inc. and its contributors
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
19 echo "==============================="
20 echo "Requires sudo privileges"
22 echo executing on machine `uname -a`
27 echo -d -- Test with DPDK
28 echo -k -- Load linux kernel module
31 function uninstallrpms() {
35 while getopts "dg:hkp:u:v" opt; do
51 OVS_REPO_URL=${OPTARG}
64 source $BUILDDIR/functions.sh
75 mkdir -p $HOME/rpmbuild/RPMS/x86_64
76 mkdir -p $HOME/rpmbuild/SOURCES
77 mkdir -p $HOME/rpmbuild/SPECS
78 mkdir -p $HOME/rpmbuild/SRPMS
81 cp $HOME/*.rpm $RPMDIR/RPMS/x86_64
85 /bin/systemctl is-active openvswitch.service
87 sudo /bin/systemctl stop openvswitch.service
92 echo "-----------------------------------"
93 echo "Clean old dpdk and ovs installations"
98 if [ ! -z $DPDK ]; then
99 if [ -z $DPDK_VERSION ]; then
102 echo "-----------------------------------"
103 echo "Install DPDK RPMs for version $DPDK_VERSION"
105 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-${DPDK_VERSION:0:1}*.rpm
106 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-tools-${DPDK_VERSION:0:1}*.rpm
107 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-examples-${DPDK_VERSION:0:1}*.rpm
110 if [ ! -z $kmod ]; then
111 echo "-----------------------------------"
112 echo "Test installation of kmod RPM"
114 sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-kmod*.rpm
116 echo "-----------------------------------"
117 echo "Test installation of user space RPM"
119 sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-2*.rpm
121 echo "-----------------------------------"
122 echo "Start openvswitch service."
124 sudo service openvswitch start
127 sudo ovs-vsctl add-br brtest
128 sudo ovs-ofctl dump-flows brtest
129 sudo ovs-vsctl del-br brtest
130 sudo service openvswitch stop