summaryrefslogtreecommitdiffstats
path: root/build/test_ovs_rpm.sh
diff options
context:
space:
mode:
authorThomas F Herbert <therbert@redhat.com>2016-01-23 19:06:55 -0500
committerThomas F Herbert <therbert@redhat.com>2016-01-31 00:16:08 -0500
commit4c54b37aca48867c694539692a3ada76be39f4d6 (patch)
treea99b48f4420c53058fad82260a752b3f4dcb9aa3 /build/test_ovs_rpm.sh
parent4aa1ce14bb812da904f65e8c8f6e6a92053a41e3 (diff)
Introduce ability to accept command arguments to build with DPDK or Linux kernel.
Specify patches to apply, build kernel module RPM and build with a special version of the kernel. Also instack_ovs.sh creates a VM for building and initial testing of RPMs and copies scripts to VMs build_ovs_rpm.sh builds the RPM according to command line options. test_ovs_rpm.sh tests the RPM by installing the RPM and running some ovs commands to create a bridge and dump flows. Also add two scripts generally to be executed in VM to do actual building and Testing. This 2nd series adds the following: Use fedora spec file for kmod builds. Added Explanations to configuration options. Fixes in response to review comments. Rename script for clarity and change references: buildtestovs.sh -> BuildTestOVS.sh Fix nocheck option, print default options, fix kmod option, fix test of kmod. For command line options execute build/buildtestovs.sh -h Change-Id: I415ca39afab27482b1cb473d392f48b36c8e0745 Signed-off-by: Thomas F Herbert <therbert@redhat.com>
Diffstat (limited to 'build/test_ovs_rpm.sh')
-rwxr-xr-xbuild/test_ovs_rpm.sh81
1 files changed, 81 insertions, 0 deletions
diff --git a/build/test_ovs_rpm.sh b/build/test_ovs_rpm.sh
new file mode 100755
index 0000000..fce5ca4
--- /dev/null
+++ b/build/test_ovs_rpm.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 Red Hat Inc. and others.
+# therbert@redhat.com
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -e
+declare -i CNT
+
+echo "==============================="
+echo executing $0 $@
+echo executing on machine `uname -a`
+
+
+usage() {
+ echo run BuildAndTest -h for help
+}
+
+while getopts "dg:hkp:u:v" opt; do
+ case "$opt" in
+ d)
+ DPDK="yes"
+ ;;
+ g)
+ TAG=${OPTARG}
+ ;;
+ h|\?)
+ usage
+ exit 1
+ ;;
+ k)
+ kmod="yes"
+ ;;
+ u)
+ OVS_REPO_URL=${OPTARG}
+ ;;
+ v)
+ verbose="yes"
+ ;;
+ esac
+done
+
+HOME=`pwd`
+TOPDIR=$HOME
+TMPDIR=$TOPDIR/ovsrpm
+
+if [ -d $TMPDIR ]
+then
+ rm -rf $TMPDIR
+fi
+
+mkdir -p $TMPDIR
+
+cd $TMPDIR
+
+mkdir -p $HOME/rpmbuild/RPMS
+mkdir -p $HOME/rpmbuild/SOURCES
+mkdir -p $HOME/rpmbuild/SPECS
+mkdir -p $HOME/rpmbuild/SRPMS
+
+RPMDIR=$HOME/rpmbuild
+
+echo " Testing installation of kmod RPM"
+if [ ! -z $kmod ]; then
+ echo "Install kernel module"
+ sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-kmod*.rpm
+ echo " Kernel RPM installed."
+fi
+echo "Testing User Space RPM"
+sudo rpm -ivh $RPMDIR/RPMS/x86_64/openvswitch-2*.rpm
+
+sudo service openvswitch start
+
+sudo ovs-vsctl show
+sudo ovs-vsctl add-br br1
+sudo ovs-ofctl dump-flows br1
+
+exit 0