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 echo "-----------------------------------"
106 echo "Install DPDK RPMs"
108 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-2*.rpm
109 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-tools-2*.rpm
110 sudo rpm -ivh $RPMDIR/RPMS/x86_64/dpdk-examples-2*.rpm
113 if [ ! -z $kmod ]; then
114 echo "-----------------------------------"
115 echo "Test installation of kmod RPM"
117 sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-kmod*.rpm
119 echo "-----------------------------------"
120 echo "Test installation of user space RPM"
122 sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-2*.rpm
124 echo "-----------------------------------"
125 echo "Start openvswitch service."
127 sudo service openvswitch start
130 sudo ovs-vsctl add-br brtest
131 sudo ovs-ofctl dump-flows brtest
132 sudo ovs-vsctl del-br brtest
133 sudo service openvswitch stop