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 "==============================="
21 echo executing on machine `uname -a`
25 echo run BuildAndTest -h for help
32 sudo rpm -e --allmatches $1
36 function cleanrpms() {
44 while getopts "dg:hkp:u:v" opt; do
60 OVS_REPO_URL=${OPTARG}
81 mkdir -p $HOME/rpmbuild/RPMS/x86_64
82 mkdir -p $HOME/rpmbuild/SOURCES
83 mkdir -p $HOME/rpmbuild/SPECS
84 mkdir -p $HOME/rpmbuild/SRPMS
87 cp $HOME/*.rpm $RPMDIR/RPMS/x86_64
91 /bin/systemctl is-active openvswitch.service
93 sudo /bin/systemctl stop openvswitch.service
98 echo "-----------------------------------"
99 echo "Clean old dpdk and ovs installations"
104 if [ ! -z $DPDK ]; then
105 if [ -z $DPDK_VERSION ]; then
108 echo "-----------------------------------"
109 echo "Install DPDK RPMs for version $DPDK_VERSION"
111 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-${DPDK_VERSION:0:1}*.rpm
112 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-tools-${DPDK_VERSION:0:1}*.rpm
113 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-examples-${DPDK_VERSION:0:1}*.rpm
116 if [ ! -z $kmod ]; then
117 echo "-----------------------------------"
118 echo "Test installation of kmod RPM"
120 sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-kmod*.rpm
122 echo "-----------------------------------"
123 echo "Test installation of user space RPM"
125 sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-2*.rpm
127 echo "-----------------------------------"
128 echo "Start openvswitch service."
130 sudo service openvswitch start
133 sudo ovs-vsctl add-br brtest
134 sudo ovs-ofctl dump-flows brtest
135 sudo ovs-vsctl del-br brtest
136 sudo service openvswitch stop