summaryrefslogtreecommitdiffstats
path: root/kernel/networking/libvirt
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2013-01-28 15:44:28 -0500
committerBill Peck <bpeck@redhat.com>2013-01-28 15:44:28 -0500
commit62ac6acc5e2f44f0fa56547bd7167d3d38a10be5 (patch)
tree37dada403720609951149f034a834bdbdfb858c3 /kernel/networking/libvirt
parent6ef978fcfe34ff90bca11a7486e7f517f785388d (diff)
Update libvirt ping and netperf commands to use ../common/autologin.exp
Diffstat (limited to 'kernel/networking/libvirt')
-rw-r--r--kernel/networking/libvirt/common/Makefile50
-rwxr-xr-xkernel/networking/libvirt/common/autologin.exp43
-rw-r--r--kernel/networking/libvirt/netperf-client/Makefile51
-rw-r--r--kernel/networking/libvirt/netperf-client/PURPOSE3
-rwxr-xr-xkernel/networking/libvirt/netperf-client/runtest.sh56
-rw-r--r--kernel/networking/libvirt/netperf-server/Makefile51
-rw-r--r--kernel/networking/libvirt/netperf-server/PURPOSE3
-rwxr-xr-xkernel/networking/libvirt/netperf-server/runtest.sh34
-rw-r--r--kernel/networking/libvirt/ping/Makefile51
-rw-r--r--kernel/networking/libvirt/ping/PURPOSE3
-rwxr-xr-xkernel/networking/libvirt/ping/runtest.sh57
11 files changed, 402 insertions, 0 deletions
diff --git a/kernel/networking/libvirt/common/Makefile b/kernel/networking/libvirt/common/Makefile
new file mode 100644
index 0000000..329564f
--- /dev/null
+++ b/kernel/networking/libvirt/common/Makefile
@@ -0,0 +1,50 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Makefile of /kernel/networking/libvirt/common
+# Description: common code for libvirt functions
+# Author: Bill Peck <bpeck@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile PURPOSE
+
+.PHONY: all install run download clean
+
+build: $(BUILT_FILES)
+ test -x autologin.exp || chmod a+x autologin.exp
+
+run: build
+
+clean:
+ rm -f *~ $(BUILT_FILES)
+
+
+include /usr/share/rhts/lib/rhts-make.include
+
+$(METADATA): Makefile
+ @echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA)
+ @echo "TestTime: 10m" >> $(METADATA)
+ @echo "License: GPLv2" >> $(METADATA)
+ @echo "Confidential: no" >> $(METADATA)
+ @echo "Destructive: no" >> $(METADATA)
+ @echo "Requires: expect" >> $(METADATA)
diff --git a/kernel/networking/libvirt/common/autologin.exp b/kernel/networking/libvirt/common/autologin.exp
new file mode 100755
index 0000000..609afc6
--- /dev/null
+++ b/kernel/networking/libvirt/common/autologin.exp
@@ -0,0 +1,43 @@
+#!/usr/bin/expect -f
+
+set login "root"
+set password "redhat"
+
+set timeout -1
+set guest [lindex $argv 0]
+set prompt "$login@.*\](%|#|\\\$) $"
+
+spawn virsh console $guest
+
+#login if needed
+expect "Escape character is"
+send "\r"
+expect {
+ {login:} { send "$login\r"
+ expect {
+ {Password:} { send "$password\r" }
+ }
+ }
+ -re $prompt { send "\r"}
+ }
+
+expect -re $prompt
+
+#run command
+for {set i 1} {$i < $argc} {incr i 1} {
+ set cmd [lindex $argv $i]
+ send "$cmd\r"
+ expect -re $prompt
+ sleep 1
+}
+
+#capture return code from last command
+send "echo \$?\r"
+expect -re "(\\d+)" {
+ set result $expect_out(1,string)
+}
+
+#logout
+send "exit\r"
+expect "logout"
+exit $result
diff --git a/kernel/networking/libvirt/netperf-client/Makefile b/kernel/networking/libvirt/netperf-client/Makefile
new file mode 100644
index 0000000..932cac0
--- /dev/null
+++ b/kernel/networking/libvirt/netperf-client/Makefile
@@ -0,0 +1,51 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Makefile of /kernel/networking/netperf
+# Description: run netperf both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+# Author: Bill Peck <bpeck@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile PURPOSE
+
+.PHONY: all install download clean
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ test -x runtest.sh || chmod a+x runtest.sh
+
+clean:
+ rm -f *~ $(BUILT_FILES)
+
+
+include /usr/share/rhts/lib/rhts-make.include
+
+$(METADATA): Makefile
+ @echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA)
+ @echo "TestTime: 10m" >> $(METADATA)
+ @echo "License: GPLv2" >> $(METADATA)
+ @echo "Confidential: no" >> $(METADATA)
+ @echo "Destructive: no" >> $(METADATA)
+ @echo "Requires: netperf" >> $(METADATA)
diff --git a/kernel/networking/libvirt/netperf-client/PURPOSE b/kernel/networking/libvirt/netperf-client/PURPOSE
new file mode 100644
index 0000000..6b42020
--- /dev/null
+++ b/kernel/networking/libvirt/netperf-client/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of /kernel/networking/ping
+Description: run netperf both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+Author: Bill Peck <bpeck@redhat.com>
diff --git a/kernel/networking/libvirt/netperf-client/runtest.sh b/kernel/networking/libvirt/netperf-client/runtest.sh
new file mode 100755
index 0000000..fe712f9
--- /dev/null
+++ b/kernel/networking/libvirt/netperf-client/runtest.sh
@@ -0,0 +1,56 @@
+#!/bin/bash -x
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /kernel/networking/libvirt/ping
+# Description: pings both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+# Author: Bill Peck <bpeck@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include Beaker environment
+. /usr/bin/rhts-environment.sh || exit 1
+
+PERF_TIME=${PERF_TIME:="10"}
+
+pass()
+{
+ report_result $WHITEBOARD/$1/$addr PASS 0
+}
+
+fail()
+{
+ report_result $WHITEBOARD/$1/$addr FAIL 1
+}
+
+for guest in $GUESTS; do
+ for blob in $(eval echo \$$guest); do
+ eval $(echo $blob| sed 's/;/\\;/g')
+ done
+ IFS=";"
+ for addr in $valid_addrs; do
+ ../common/autologin.exp $guest "netperf -4 -H $addr -l $PERF_TIME" && pass VALID|| fail VALID
+ done
+ for addr in $invalid_addrs; do
+ ../common/autologin.exp $guest "netperf -4 -H $addr -l $PERF_TIME" && pass INVALID|| fail INVALID
+ done
+ unset IFS
+done
diff --git a/kernel/networking/libvirt/netperf-server/Makefile b/kernel/networking/libvirt/netperf-server/Makefile
new file mode 100644
index 0000000..932cac0
--- /dev/null
+++ b/kernel/networking/libvirt/netperf-server/Makefile
@@ -0,0 +1,51 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Makefile of /kernel/networking/netperf
+# Description: run netperf both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+# Author: Bill Peck <bpeck@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile PURPOSE
+
+.PHONY: all install download clean
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ test -x runtest.sh || chmod a+x runtest.sh
+
+clean:
+ rm -f *~ $(BUILT_FILES)
+
+
+include /usr/share/rhts/lib/rhts-make.include
+
+$(METADATA): Makefile
+ @echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA)
+ @echo "TestTime: 10m" >> $(METADATA)
+ @echo "License: GPLv2" >> $(METADATA)
+ @echo "Confidential: no" >> $(METADATA)
+ @echo "Destructive: no" >> $(METADATA)
+ @echo "Requires: netperf" >> $(METADATA)
diff --git a/kernel/networking/libvirt/netperf-server/PURPOSE b/kernel/networking/libvirt/netperf-server/PURPOSE
new file mode 100644
index 0000000..6b42020
--- /dev/null
+++ b/kernel/networking/libvirt/netperf-server/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of /kernel/networking/ping
+Description: run netperf both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+Author: Bill Peck <bpeck@redhat.com>
diff --git a/kernel/networking/libvirt/netperf-server/runtest.sh b/kernel/networking/libvirt/netperf-server/runtest.sh
new file mode 100755
index 0000000..6f60d50
--- /dev/null
+++ b/kernel/networking/libvirt/netperf-server/runtest.sh
@@ -0,0 +1,34 @@
+#!/bin/bash -x
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /kernel/networking/ping
+# Description: pings both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+# Author: Bill Peck <bpeck@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include Beaker environment
+. /usr/bin/rhts-environment.sh || exit 1
+
+service iptables stop
+nohup netserver -4 &
+sleep 10
diff --git a/kernel/networking/libvirt/ping/Makefile b/kernel/networking/libvirt/ping/Makefile
new file mode 100644
index 0000000..3c90a4d
--- /dev/null
+++ b/kernel/networking/libvirt/ping/Makefile
@@ -0,0 +1,51 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Makefile of /kernel/networking/ping
+# Description: pings both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+# Author: Bill Peck <bpeck@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile PURPOSE
+
+.PHONY: all install download clean
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ test -x runtest.sh || chmod a+x runtest.sh
+
+clean:
+ rm -f *~ $(BUILT_FILES)
+
+
+include /usr/share/rhts/lib/rhts-make.include
+
+$(METADATA): Makefile
+ @echo "Owner: Bill Peck <bpeck@redhat.com>" > $(METADATA)
+ @echo "Description: Verifies openvswitch is working properly" >> $(METADATA)
+ @echo "TestTime: 10m" >> $(METADATA)
+ @echo "License: GPLv2" >> $(METADATA)
+ @echo "Confidential: no" >> $(METADATA)
+ @echo "Destructive: no" >> $(METADATA)
diff --git a/kernel/networking/libvirt/ping/PURPOSE b/kernel/networking/libvirt/ping/PURPOSE
new file mode 100644
index 0000000..2dbbd56
--- /dev/null
+++ b/kernel/networking/libvirt/ping/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of /kernel/networking/ping
+Description: pings both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+Author: Bill Peck <bpeck@redhat.com>
diff --git a/kernel/networking/libvirt/ping/runtest.sh b/kernel/networking/libvirt/ping/runtest.sh
new file mode 100755
index 0000000..facbd9b
--- /dev/null
+++ b/kernel/networking/libvirt/ping/runtest.sh
@@ -0,0 +1,57 @@
+#!/bin/bash -x
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /kernel/networking/libvirt/ping
+# Description: pings both $VALID_ADDRS and $INVALID_ADDRS, verifies connectivity
+# Author: Bill Peck <bpeck@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing
+# to use, modify, copy, or redistribute it subject to the terms
+# and conditions of the GNU General Public License version 2.
+#
+# This program is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include Beaker environment
+. /usr/bin/rhts-environment.sh || exit 1
+
+PING_COUNT=${PING_COUNT:="10"}
+PING_SIZE=${PING_SIZE:="64"}
+
+pass()
+{
+ report_result $WHITEBOARD/$1/$addr PASS 0
+}
+
+fail()
+{
+ report_result $WHITEBOARD/$1/$addr FAIL 1
+}
+
+for guest in $GUESTS; do
+ for blob in $(eval echo \$$guest); do
+ eval $(echo $blob| sed 's/;/\\;/g')
+ done
+ IFS=";"
+ for addr in $valid_addrs; do
+ ../common/autologin.exp $guest "ping -c $PING_COUNT -i 0.2 -s $PING_SIZE $addr" && pass VALID|| fail VALID
+ done
+ for addr in $invalid_addrs; do
+ ../common/autologin.exp $guest "ping -c $PING_COUNT -i 0.2 -s $PING_SIZE $addr" && pass INVALID|| fail INVALID
+ done
+ unset IFS
+done