Index: projects/vnet/_scripts/cleanup-epairs.sh =================================================================== --- projects/vnet/_scripts/cleanup-epairs.sh (nonexistent) +++ projects/vnet/_scripts/cleanup-epairs.sh (revision 302301) @@ -0,0 +1,54 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +timeout=$1 +case "${timeout}" in +"") timeout=60 ;; +0) timeout=60 ;; +esac + +while : ; do + + for iface in `ifconfig -l`; do + case "${iface}" in + epair*a) + echo "Destroying ${iface}" + ifconfig ${iface} destroy + ;; + esac + done + + sleep ${timeout} + +done + +# end Property changes on: projects/vnet/_scripts/cleanup-epairs.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/cleanup.sh =================================================================== --- projects/vnet/_scripts/cleanup.sh (nonexistent) +++ projects/vnet/_scripts/cleanup.sh (revision 302301) @@ -0,0 +1,37 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +jls | awk '!/JID/ { print $1 }' | xargs -n1 jail -r +ifconfig -l | tr ' ' '\n' | awk '/epair.*b/ { print $1 }' | xargs -n 1 -J % ifconfig % destroy +ifconfig -l | tr ' ' '\n' | awk '/epair.*a/ { print $1 }' | xargs -n 1 -J % ifconfig % destroy + +# end Property changes on: projects/vnet/_scripts/cleanup.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/fwd/conductor.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/conductor.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/conductor.cfg (revision 302301) @@ -0,0 +1,37 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Test] +trials: 1 + +[Clients] +client1: left.cfg +client2: middle.cfg +client3: right.cfg Index: projects/vnet/_scripts/conductor/tests/fwd/conductor.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/conductor.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/conductor.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/fwd/ +conduct conductor.cfg + +# end Property changes on: projects/vnet/_scripts/conductor/tests/fwd/conductor.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/fwd/left.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/left.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/left.cfg (revision 302301) @@ -0,0 +1,50 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.0.1 +conductor: 198.18.0.2 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "Starting iperf3 -s -D" +step2:/usr/local/bin/iperf3 -s -D +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/fwd/left.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/left.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/left.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/fwd/ +player left.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/fwd/left.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/fwd/middle.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/middle.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/middle.cfg (revision 302301) @@ -0,0 +1,49 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 127.0.0.1 +conductor: 127.0.0.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "Nothing to do" +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/fwd/middle.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/middle.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/middle.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/fwd/ +player middle.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/fwd/middle.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/fwd/right.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/right.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/right.cfg (revision 302301) @@ -0,0 +1,51 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.1.2 +conductor: 198.18.1.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "Starting sleep 1; iperf3 -c 2001:200::1" +step2:sleep 1 +step3:/usr/local/bin/iperf3 -c 2001:200::1 +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/fwd/right.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/right.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/right.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/fwd/ +player right.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/fwd/right.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/fwd/start-vnet-lmr.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/fwd/start-vnet-lmr.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/fwd/start-vnet-lmr.sh (revision 302301) @@ -0,0 +1,118 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Helper(s). +# +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# +# Setup "machines". +# + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=left.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=center.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=right.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +# IANA Benchmarking prefixes: +# 198.18.0.0/15 +# 2001:0200::/48 + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 198.18.0.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:200::1/64 alias + +jexec ${ljid} route add default 198.18.0.2 +jexec ${ljid} route add -inet6 default 2001:200::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 198.18.0.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:200::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 198.18.1.1/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:200:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 198.18.1.2/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:200:1::2/64 alias + +jexec ${rjid} route add default 198.18.1.1 +jexec ${rjid} route add -inet6 default 2001:200:1::1 + +# Start conductor components and let them do everything else. +# +# Seems conductor scripts need to be run from the local directory +# thus use "startup" scripts. +# We runt he conductor on the middle node as that can reach all three. +# + +jexec ${ljid} /home/test/conductor/tests/fwd/left.sh +jexec ${mjid} /home/test/conductor/tests/fwd/middle.sh +jexec ${rjid} /home/test/conductor/tests/fwd/right.sh +sleep 3 +jexec ${mjid} /home/test/conductor/tests/fwd/conductor.sh + +jail -r ${rjid} ${ljid} ${mjid} + +# end Property changes on: projects/vnet/_scripts/conductor/tests/fwd/start-vnet-lmr.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/conductor.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/http/conductor.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/conductor.cfg (revision 302301) @@ -0,0 +1,37 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Test] +trials: 1 + +[Clients] +client1: left.cfg +client2: middle.cfg +client3: right.cfg Index: projects/vnet/_scripts/conductor/tests/http/conductor.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/conductor.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/conductor.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/http/ +conduct conductor.cfg + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/conductor.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/index.html =================================================================== --- projects/vnet/_scripts/conductor/tests/http/index.html (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/index.html (revision 302301) @@ -0,0 +1,3 @@ + + + Property changes on: projects/vnet/_scripts/conductor/tests/http/index.html ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/html \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/left.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/http/left.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/left.cfg (revision 302301) @@ -0,0 +1,52 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.0.1 +conductor: 198.18.0.2 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "Starting thttpd" +step2:env thttpd_flags="-C /home/test/conductor/tests/http/thttpd.conf" /usr/local/etc/rc.d/thttpd onestart +step3:echo "Starting varnish" +step4:env varnishd_config=/usr/local/share/doc/varnish/example.vcl /usr/local/etc/rc.d/varnishd onestart +timeout10: sleep 2 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/http/left.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/left.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/left.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/http/ +player left.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/left.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/loop.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/loop.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/loop.sh (revision 302301) @@ -0,0 +1,45 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e +set -x + +while : ; do + + sh start-vnet-lmr.sh & + p=$! + sleep 240 + kill -9 $p || true + +done + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/loop.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/middle.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/http/middle.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/middle.cfg (revision 302301) @@ -0,0 +1,49 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 127.0.0.1 +conductor: 127.0.0.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "Nothing to do" +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/http/middle.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/middle.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/middle.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/http/ +player middle.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/middle.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/pf-log.conf =================================================================== --- projects/vnet/_scripts/conductor/tests/http/pf-log.conf (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/pf-log.conf (revision 302301) @@ -0,0 +1,47 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# options +set block-policy return + +set skip on lo0 + +# scrub +scrub in + +# nat/rdr + +# filter rules +pass in log +pass out log + +antispoof quick for { lo epair } + Property changes on: projects/vnet/_scripts/conductor/tests/http/pf-log.conf ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/pf.conf =================================================================== --- projects/vnet/_scripts/conductor/tests/http/pf.conf (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/pf.conf (revision 302301) @@ -0,0 +1,47 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# options +set block-policy return + +set skip on lo0 + +# scrub +scrub in + +# nat/rdr + +# filter rules +pass in +pass out + +#antispoof quick for { lo epair } + Property changes on: projects/vnet/_scripts/conductor/tests/http/pf.conf ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/right.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/http/right.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/right.cfg (revision 302301) @@ -0,0 +1,52 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.1.2 +conductor: 198.18.1.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "Sleeping 30 to give varnish a chance to start" +step2:sleep 30 +step3:echo "Starting http bench" +step4:/usr/local/bin/wrk -c 100 -d 3m -t 2 --timeout 10s http://198.18.0.1/ +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/http/right.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/right.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/right.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/http/ +player right.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/right.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor-pf.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor-pf.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor-pf.sh (revision 302301) @@ -0,0 +1,120 @@ +#!/bin/sh + +set -x + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Helper(s). +# +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# +# Setup "machines". +# + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=pfvarn$$left.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=pfvarn$$center.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=pfvarn$$right.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +# IANA Benchmarking prefixes: +# 198.18.0.0/15 +# 2001:0200::/48 + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 198.18.0.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:200::1/64 alias + +jexec ${ljid} route add default 198.18.0.2 +jexec ${ljid} route add -inet6 default 2001:200::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 198.18.0.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:200::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 198.18.1.1/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:200:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 198.18.1.2/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:200:1::2/64 alias + +jexec ${rjid} route add default 198.18.1.1 +jexec ${rjid} route add -inet6 default 2001:200:1::1 + +jexec ${mjid} /sbin/pfctl -f /home/test/conductor/tests/http/pf.conf +jexec ${mjid} /sbin/pfctl -e + +jexec ${ljid} env thttpd_flags="-C /home/test/conductor/tests/http/thttpd.conf" /usr/local/etc/rc.d/thttpd onestart +jexec ${ljid} env varnishd_storage="file,/var/tmp,10M" varnishd_config=/usr/local/etc/varnish/example.vcl /usr/local/etc/rc.d/varnishd onestart + +sleep 3 + +jexec ${rjid} /usr/local/bin/wrk -c 100 -d 3m -t 2 --timeout 10s http://198.18.0.1/ + +echo "TEARING DOWN JAILS IN 1s" +sleep 1 + +jail -r ${rjid} ${ljid} ${mjid} + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor-pf.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor.sh (revision 302301) @@ -0,0 +1,113 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Helper(s). +# +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# +# Setup "machines". +# + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=varn$$left.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=varn$$center.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=varn$$right.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +# IANA Benchmarking prefixes: +# 198.18.0.0/15 +# 2001:0200::/48 + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 198.18.0.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:200::1/64 alias + +jexec ${ljid} route add default 198.18.0.2 +jexec ${ljid} route add -inet6 default 2001:200::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 198.18.0.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:200::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 198.18.1.1/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:200:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 198.18.1.2/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:200:1::2/64 alias + +jexec ${rjid} route add default 198.18.1.1 +jexec ${rjid} route add -inet6 default 2001:200:1::1 + + +jexec ${ljid} env thttpd_flags="-C /home/test/conductor/tests/http/thttpd.conf" /usr/local/etc/rc.d/thttpd onestart +jexec ${ljid} env varnishd_config=/usr/local/etc/varnish/example.vcl /usr/local/etc/rc.d/varnishd onestart + +sleep 3 + +jexec ${rjid} /usr/local/bin/wrk -c 100 -d 3m -t 2 --timeout 10s http://198.18.0.1/ + +jail -r ${rjid} ${ljid} ${mjid} + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/run-as-shell-not-conductor.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/start-vnet-lmr.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/http/start-vnet-lmr.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/start-vnet-lmr.sh (revision 302301) @@ -0,0 +1,118 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Helper(s). +# +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# +# Setup "machines". +# + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=left.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=center.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=right.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +# IANA Benchmarking prefixes: +# 198.18.0.0/15 +# 2001:0200::/48 + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 198.18.0.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:200::1/64 alias + +jexec ${ljid} route add default 198.18.0.2 +jexec ${ljid} route add -inet6 default 2001:200::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 198.18.0.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:200::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 198.18.1.1/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:200:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 198.18.1.2/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:200:1::2/64 alias + +jexec ${rjid} route add default 198.18.1.1 +jexec ${rjid} route add -inet6 default 2001:200:1::1 + +# Start conductor components and let them do everything else. +# +# Seems conductor scripts need to be run from the local directory +# thus use "startup" scripts. +# We runt he conductor on the middle node as that can reach all three. +# + +jexec ${ljid} /home/test/conductor/tests/http/left.sh +jexec ${mjid} /home/test/conductor/tests/http/middle.sh +jexec ${rjid} /home/test/conductor/tests/http/right.sh +sleep 3 +jexec ${mjid} /home/test/conductor/tests/http/conductor.sh + +jail -r ${rjid} ${ljid} ${mjid} + +# end Property changes on: projects/vnet/_scripts/conductor/tests/http/start-vnet-lmr.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/http/thttpd.conf =================================================================== --- projects/vnet/_scripts/conductor/tests/http/thttpd.conf (nonexistent) +++ projects/vnet/_scripts/conductor/tests/http/thttpd.conf (revision 302301) @@ -0,0 +1,2 @@ +dir=/home/test/conductor/tests/http +port=8080 Property changes on: projects/vnet/_scripts/conductor/tests/http/thttpd.conf ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/ipsec/conductor.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/conductor.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/conductor.cfg (revision 302301) @@ -0,0 +1,37 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Test] +trials: 1 + +[Clients] +client1: left.cfg +client2: middle.cfg +client3: right.cfg Index: projects/vnet/_scripts/conductor/tests/ipsec/conductor.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/conductor.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/conductor.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/ipsec/ +conduct conductor.cfg + +# end Property changes on: projects/vnet/_scripts/conductor/tests/ipsec/conductor.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.left =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.left (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.left (revision 302301) @@ -0,0 +1,42 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +spdflush; +flush; + +add 2001:200::1 2001:200::2 esp 256 -lh 4200 -ls 3600 -E 3des-cbc "444444444444444444444444"; +add 2001:200::2 2001:200::1 esp 256 -E 3des-cbc "444444444444444444444444"; + +spdadd 2001:200::/64 2001:200:1::/64 any + -P out ipsec esp/tunnel/2001:200::1-2001:200::2/require ; +spdadd 2001:200:1::/64 2001:200::/64 any + -P in ipsec esp/tunnel/2001:200::2-2001:200::1/require ; + + Index: projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.middle =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.middle (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.middle (revision 302301) @@ -0,0 +1,41 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +spdflush; +flush; + +add 2001:200::2 2001:200::1 esp 256 -lh 4200 -ls 3600 -E 3des-cbc "444444444444444444444444"; +add 2001:200::1 2001:200::2 esp 256 -E 3des-cbc "444444444444444444444444"; + +spdadd 2001:200:1::/64 2001:200::/64 any + -P out ipsec esp/tunnel/2001:200::2-2001:200::1/require ; +spdadd 2001:200::/64 2001:200:1::/64 any + -P in ipsec esp/tunnel/2001:200::1-2001:200::2/require ; + Index: projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.right =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.right (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/ipsec.conf.right (revision 302301) @@ -0,0 +1,33 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +spdflush; +flush; + Index: projects/vnet/_scripts/conductor/tests/ipsec/left.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/left.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/left.cfg (revision 302301) @@ -0,0 +1,52 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.0.1 +conductor: 198.18.0.2 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:setkey -f ipsec.conf.left + +# Run the test, each step runs in parallel +[Run] +step1:echo "running" +step2:/usr/local/bin/iperf3 -s -D +timeout10: sleep 180 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:setkey -PF +step2:setkey -DF +step3:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/ipsec/left.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/left.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/left.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/ipsec/ +player left.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/ipsec/left.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/ipsec/middle.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/middle.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/middle.cfg (revision 302301) @@ -0,0 +1,51 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 127.0.0.1 +conductor: 127.0.0.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:setkey -f ipsec.conf.middle + +# Run the test, each step runs in parallel +[Run] +step1:echo "running" +timeout10: sleep 180 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:setkey -PF +step2:setkey -DF +step3:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/ipsec/middle.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/middle.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/middle.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/ipsec/ +player middle.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/ipsec/middle.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/ipsec/right.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/right.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/right.cfg (revision 302301) @@ -0,0 +1,52 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.1.2 +conductor: 198.18.1.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:setkey -f ipsec.conf.right + +# Run the test, each step runs in parallel +[Run] +step1:echo "running" +step2:/usr/local/bin/iperf3 -c 2001:200::1 +timeout10: sleep 180 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:setkey -PF +step2:setkey -DF +step3:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/ipsec/right.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/right.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/right.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/ipsec/ +player right.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/ipsec/right.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/ipsec/start-vnet-lmr.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/ipsec/start-vnet-lmr.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/ipsec/start-vnet-lmr.sh (revision 302301) @@ -0,0 +1,118 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Helper(s). +# +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# +# Setup "machines". +# + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=left.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=center.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=right.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +# IANA Benchmarking prefixes: +# 198.18.0.0/15 +# 2001:0200::/48 + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 198.18.0.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:200::1/64 alias + +jexec ${ljid} route add default 198.18.0.2 +jexec ${ljid} route add -inet6 default 2001:200::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 198.18.0.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:200::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 198.18.1.1/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:200:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 198.18.1.2/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:200:1::2/64 alias + +jexec ${rjid} route add default 198.18.1.1 +jexec ${rjid} route add -inet6 default 2001:200:1::1 + +# Start conductor components and let them do everything else. +# +# Seems conductor scripts need to be run from the local directory +# thus use "startup" scripts. +# We runt he conductor on the middle node as that can reach all three. +# + +jexec ${ljid} /home/test/conductor/tests/ipsec/left.sh +jexec ${mjid} /home/test/conductor/tests/ipsec/middle.sh +jexec ${rjid} /home/test/conductor/tests/ipsec/right.sh +sleep 3 +jexec ${mjid} /home/test/conductor/tests/ipsec/conductor.sh + +jail -r ${rjid} ${ljid} ${mjid} + +# end Property changes on: projects/vnet/_scripts/conductor/tests/ipsec/start-vnet-lmr.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/nada/conductor.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/conductor.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/conductor.cfg (revision 302301) @@ -0,0 +1,37 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Test] +trials: 1 + +[Clients] +client1: left.cfg +client2: middle.cfg +client3: right.cfg Index: projects/vnet/_scripts/conductor/tests/nada/conductor.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/conductor.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/conductor.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/nada/ +conduct conductor.cfg + +# end Property changes on: projects/vnet/_scripts/conductor/tests/nada/conductor.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/nada/left.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/left.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/left.cfg (revision 302301) @@ -0,0 +1,49 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.0.1 +conductor: 198.18.0.2 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "running" +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/nada/left.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/left.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/left.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/nada/ +player left.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/nada/left.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/nada/middle.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/middle.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/middle.cfg (revision 302301) @@ -0,0 +1,49 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 127.0.0.1 +conductor: 127.0.0.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "running" +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/nada/middle.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/middle.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/middle.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/nada/ +player middle.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/nada/middle.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/nada/right.cfg =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/right.cfg (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/right.cfg (revision 302301) @@ -0,0 +1,49 @@ +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +[Master] +player: 198.18.1.2 +conductor: 198.18.1.1 +cmdport: 6970 +resultsport: 6971 + +[Startup] +step1:echo "Startup" + +# Run the test, each step runs in parallel +[Run] +step1:echo "running" +timeout10: sleep 1 + +[Collect] +step1:echo "collecting" + +[Reset] +step1:echo "system reset: goodbye" Index: projects/vnet/_scripts/conductor/tests/nada/right.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/right.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/right.sh (revision 302301) @@ -0,0 +1,39 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +cd /home/test/conductor/tests/nada/ +player right.cfg & + +# end Property changes on: projects/vnet/_scripts/conductor/tests/nada/right.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/conductor/tests/nada/start-vnet-lmr.sh =================================================================== --- projects/vnet/_scripts/conductor/tests/nada/start-vnet-lmr.sh (nonexistent) +++ projects/vnet/_scripts/conductor/tests/nada/start-vnet-lmr.sh (revision 302301) @@ -0,0 +1,118 @@ +#!/bin/sh + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Helper(s). +# +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# +# Setup "machines". +# + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=left.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=center.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=right.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +# IANA Benchmarking prefixes: +# 198.18.0.0/15 +# 2001:0200::/48 + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 198.18.0.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:200::1/64 alias + +jexec ${ljid} route add default 198.18.0.2 +jexec ${ljid} route add -inet6 default 2001:200::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 198.18.0.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:200::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 198.18.1.1/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:200:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 198.18.1.2/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:200:1::2/64 alias + +jexec ${rjid} route add default 198.18.1.1 +jexec ${rjid} route add -inet6 default 2001:200:1::1 + +# Start conductor components and let them do everything else. +# +# Seems conductor scripts need to be run from the local directory +# thus use "startup" scripts. +# We runt he conductor on the middle node as that can reach all three. +# + +jexec ${ljid} /home/test/conductor/tests/nada/left.sh +jexec ${mjid} /home/test/conductor/tests/nada/middle.sh +jexec ${rjid} /home/test/conductor/tests/nada/right.sh +sleep 3 +jexec ${mjid} /home/test/conductor/tests/nada/conductor.sh + +jail -r ${rjid} ${ljid} ${mjid} + +# end Property changes on: projects/vnet/_scripts/conductor/tests/nada/start-vnet-lmr.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-nada.sh =================================================================== --- projects/vnet/_scripts/jail-nada.sh (nonexistent) +++ projects/vnet/_scripts/jail-nada.sh (revision 302301) @@ -0,0 +1,41 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +while : ; do + + j=`jail -i -c host.hostname=jailnada$$ vnet persist` + jexec ${j} /bin/sh -c 'exit' + jail -r ${j} + +done + +# end Property changes on: projects/vnet/_scripts/jail-nada.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-pf-start-stop.sh =================================================================== --- projects/vnet/_scripts/jail-pf-start-stop.sh (nonexistent) +++ projects/vnet/_scripts/jail-pf-start-stop.sh (revision 302301) @@ -0,0 +1,115 @@ +#!/bin/sh + +set -x + +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Helper(s). +# +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# +# Setup "machines". +# + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=pfvarn$$left.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=pfvarn$$center.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=pfvarn$$right.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +# IANA Benchmarking prefixes: +# 198.18.0.0/15 +# 2001:0200::/48 + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 198.18.0.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:200::1/64 alias + +jexec ${ljid} route add default 198.18.0.2 +jexec ${ljid} route add -inet6 default 2001:200::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 198.18.0.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:200::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 198.18.1.1/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:200:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 198.18.1.2/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:200:1::2/64 alias + +jexec ${rjid} route add default 198.18.1.1 +jexec ${rjid} route add -inet6 default 2001:200:1::1 + +jexec ${mjid} /sbin/pfctl -f /home/test/conductor/tests/http/pf.conf +jexec ${mjid} /sbin/pfctl -e + +sleep 3 + +echo "TEARING DOWN JAILS IN 1s" +sleep 1 + +jail -r ${rjid} ${ljid} ${mjid} + +# end Property changes on: projects/vnet/_scripts/jail-pf-start-stop.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-random-stop.sh =================================================================== --- projects/vnet/_scripts/jail-random-stop.sh (nonexistent) +++ projects/vnet/_scripts/jail-random-stop.sh (revision 302301) @@ -0,0 +1,43 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +while : ; do + + t=`dd if=/dev/random bs=1 count=1 2> /dev/null | od -D | head -1 | awk '{ print $2 % 77 }'` + + echo "`date` sleeping ${t}s" + sleep ${t} + + jls | awk '/^ *[0-9]/ { print $1 }' | xargs -n 1 jail -r +done + +# end Property changes on: projects/vnet/_scripts/jail-random-stop.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-start-lmr-4.sh =================================================================== --- projects/vnet/_scripts/jail-start-lmr-4.sh (nonexistent) +++ projects/vnet/_scripts/jail-start-lmr-4.sh (revision 302301) @@ -0,0 +1,128 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +prefix=/tmp/`date +%s` + +i=0 + +ending() +{ +# vmstat -m > ${prefix}-vmstat-m-2 +# echo "diff -up ${prefix}-vmstat-m-?" +# vmstat -z > ${prefix}-vmstat-z-2 +# echo "diff -up ${prefix}-vmstat-z-?" + + exit 0 +} + +wait_enter() +{ + local line + +# echo -n "Press Enter to continue.." +# read line +} + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# Pre-start a single jail to get rid of various debugging +# output on console for the real test. Make sure not to leak zones but +# to forcefully clear them or stats are bogus. +#sysctl security.jail.vimage_debug_memory=2 + +# Private debugging. +# 0x01 == print; 0x02 destroy uma zones upon jail teardown no matter what +#sysctl security.jail.vimage_debug_memory=0 +#sysctl security.jail.vimage_debug_memory=1 +#sysctl security.jail.vimage_debug_memory=2 +#sysctl security.jail.vimage_debug_memory=3 + +#vmstat -z > ${prefix}-vmstat-z-1 +#vmstat -m > ${prefix}-vmstat-m-1 + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=left$$.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=center$$.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=right$$.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 192.0.2.1/30 up + +jexec ${ljid} route add default 192.0.2.2 + +jexec ${mjid} ifconfig lo0 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 192.0.2.2/30 up + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 192.0.2.5/30 up + +jexec ${rjid} ifconfig lo0 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 192.0.2.6/30 up + +jexec ${rjid} route add default 192.0.2.5 + +ending + +# end Property changes on: projects/vnet/_scripts/jail-start-lmr-4.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-start-lmr-6.sh =================================================================== --- projects/vnet/_scripts/jail-start-lmr-6.sh (nonexistent) +++ projects/vnet/_scripts/jail-start-lmr-6.sh (revision 302301) @@ -0,0 +1,126 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +prefix=/tmp/`date +%s` + +i=0 + +ending() +{ +# vmstat -m > ${prefix}-vmstat-m-2 +# echo "diff -up ${prefix}-vmstat-m-?" +# vmstat -z > ${prefix}-vmstat-z-2 +# echo "diff -up ${prefix}-vmstat-z-?" + + exit 0 +} + +wait_enter() +{ + local line + +# echo -n "Press Enter to continue.." +# read line +} + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# Pre-start a single jail to get rid of various debugging +# output on console for the real test. Make sure not to leak zones but +# to forcefully clear them or stats are bogus. +#sysctl security.jail.vimage_debug_memory=2 + +# Private debugging. +# 0x01 == print; 0x02 destroy uma zones upon jail teardown no matter what +#sysctl security.jail.vimage_debug_memory=0 +#sysctl security.jail.vimage_debug_memory=1 +#sysctl security.jail.vimage_debug_memory=2 +#sysctl security.jail.vimage_debug_memory=3 + +#vmstat -z > ${prefix}-vmstat-z-1 +#vmstat -m > ${prefix}-vmstat-m-1 + +# Start left (client) jail. +ljid=`jail -i -c -n lef$$ host.hostname=left$$.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c -n mid$$ host.hostname=center$$.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c -n right$$ host.hostname=right$$.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig ${lmep}a inet6 2001:db8::1/64 alias + +jexec ${ljid} route add -inet6 default 2001:db8::2 + +jexec ${mjid} ifconfig ${lmep}b inet6 2001:db8::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet6 2001:db8:1::1/64 alias + +jexec ${rjid} ifconfig ${mrep}b inet6 2001:db8:1::2/64 alias + +jexec ${rjid} route add -inet6 default 2001:db8:1::1 + +ending + +# end Property changes on: projects/vnet/_scripts/jail-start-lmr-6.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-start-lmr-ipfw.sh =================================================================== --- projects/vnet/_scripts/jail-start-lmr-ipfw.sh (nonexistent) +++ projects/vnet/_scripts/jail-start-lmr-ipfw.sh (revision 302301) @@ -0,0 +1,372 @@ +#!/bin/sh +#- +# Copyright (c) 2010, "Bjoern A. Zeeb" +# Copyright (c) 2011, Sandvine Incorporated ULC. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Test ipfw fwd for IPv4 and IPv6 using VIMAGE, testing that as well. +# For no test the packet header contents must be changed but always +# keeping the original destination. +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +debug_err() +{ + local _p + _p="$1" + + case "${DEBUG}" in + "") ;; + *) + echo " ~~ start of debug ~~" + echo " ~~ left:" + jexec ${ljid} /sbin/ipfw show + echo " ~~ middle:" + jexec ${mjid} /sbin/ipfw show + echo " ~~ right:" + jexec ${rjid} /sbin/ipfw show + echo " ~~ result file:" + cat ${_p}.1 + echo " ~~ log file:" + cat ${_p} + echo " ~~ end of debug ~~" + ;; + esac +} + +check_cleanup_result_file() +{ + local _p + _p="$1" + + if test ! -s ${_p}.1; then + echo "FAIL (output file empty)." + debug_err ${_p} + else + read line < ${_p}.1 + # Netcat adds 'X's in udp mode. + l="/${line#*/}" + if test "${l}" = "${_p}"; then + echo "PASS." + else + echo "FAIL (expected: '${_p}' got '${l}')." + debug_err ${_p} + fi + fi + + rm -f ${_p}.1 + rm -f ${_p} +} + +# Transparent proxy scenario (local address). +run_test_tp() +{ + local _descr + local _sip _dip _fip _fport _dport _p + local _nc_af _nc_p + local _lport + descr="$1" + _sip="$2" + _dip="$3" + _fip="$4" + _fport="$5" + _dport="$6" + _p="$7" + _nc_af="$8" + + _lport=${_dport} + case "${_fport}" in + "") _lport="${_dport}" ;; + *) _lport="${_fport#,}" ;; + esac + + case "${_p}" in + udp) _nc_p="-u" ;; + esac + + OUT=`mktemp -t "ipfwfwd$$-XXXXXX"` + echo -n "${descr} (${OUT}).." + ( + jexec ${ljid} /sbin/ipfw -f flush + jexec ${ljid} /sbin/ipfw -f zero + jexec ${mjid} /sbin/ipfw -f flush + jexec ${mjid} /sbin/ipfw -f zero + jexec ${rjid} /sbin/ipfw -f flush + jexec ${rjid} /sbin/ipfw -f zero + jexec ${mjid} /sbin/ipfw add 100 fwd ${_fip}${_fport} ${_p} from ${_sip} to ${_dip} + + jexec ${mjid} /bin/sh -c "nc -w 10 ${_nc_af} -n ${_nc_p} -l ${_fip} ${_lport} > ${OUT}.1 &" + jexec ${rjid} /bin/sh -c "echo '${OUT}' | nc -w 1 -v ${_nc_af} -n ${_nc_p} ${_dip} ${_dport}" + ) > ${OUT} 2>&1 + check_cleanup_result_file "${OUT}" +} + +# Transparent redirect scenario (non-local address). +run_test_nh() +{ + local _descr + local _sip _dip _fip _fport _dport _p + local _nc_af _nc_p + local _lport + descr="$1" + _sip="$2" + _dip="$3" + _fip="$4" + _fport="$5" + _dport="$6" + _p="$7" + _nc_af="$8" + + _lport=${_dport} + case "${_fport}" in + "") _lport="${_dport}" ;; + *) _lport="${_fport#,}" ;; + esac + + case "${_p}" in + udp) _nc_p="-u" ;; + esac + + OUT=`mktemp -t "ipfwfwd$$-XXXXXX"` + echo -n "${descr} (${OUT}).." + ( + jexec ${ljid} /sbin/ipfw -f flush + jexec ${ljid} /sbin/ipfw -f zero + jexec ${mjid} /sbin/ipfw -f flush + jexec ${mjid} /sbin/ipfw -f zero + jexec ${rjid} /sbin/ipfw -f flush + jexec ${rjid} /sbin/ipfw -f zero + jexec ${mjid} /sbin/ipfw add 100 fwd ${_fip} ${_p} from ${_sip} to ${_dip} + + jexec ${ljid} /bin/sh -c "nc -w 10 ${_nc_af} -n ${_nc_p} -l ${_dip} ${_lport} > ${OUT}.1 &" + jexec ${rjid} /bin/sh -c "echo '${OUT}' | nc -w 1 -v ${_nc_af} -n ${_nc_p} ${_dip} ${_dport}" + ) > ${OUT} 2>&1 + check_cleanup_result_file "${OUT}" +} + +echo "==> Setting up test network" +kldload -q ipfw > /dev/null 2>&1 + +echo "==> Make sure we can communicate" +/sbin/ipfw add 65534 allow ip from an to any + +# Start left (sender) jail. +ljid=`jail -i -c -n lef$$ host.hostname=left$$.example.net vnet persist` + +# Start middle (ipfw) jail. +mjid=`jail -i -c -n mid$$ host.hostname=center$$.example.net vnet persist` + +# Start right (non-local ip redirects go to here) jail. +rjid=`jail -i -c -n right$$ host.hostname=right$$.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${ljid} ifconfig lo0 inet 192.0.2.5/32 alias # Test 9-10 +jexec ${ljid} ifconfig lo0 inet6 2001:db8:1::1/128 alias # Test 11-12 +jexec ${ljid} ifconfig ${lmep}a inet 192.0.2.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:db8::1/64 alias + +jexec ${ljid} route add default 192.0.2.2 +jexec ${ljid} route add -inet6 default 2001:db8::2 + +jexec ${mjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${mjid} ifconfig lo0 inet 192.0.2.255/32 alias # Test 1-4 +jexec ${mjid} ifconfig lo0 inet6 2001:db8:ffff::1/128 alias # Test 5-8 +jexec ${mjid} ifconfig ${lmep}b inet 192.0.2.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:db8::2/64 alias +jexec ${mjid} route add default 192.0.2.1 + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 192.0.2.5/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:db8:1::1/64 alias + +jexec ${rjid} ifconfig lo0 inet 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 192.0.2.6/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:db8:1::2/64 alias + +jexec ${rjid} route add default 192.0.2.5 +jexec ${rjid} route add -inet6 default 2001:db8:1::1 + +# ------------------------------------------------------------------------------ +# Tests +# +# The jails are not chrooted to they all share the same base filesystem. +# This means we can put results into /tmp and just collect them from here. +# +echo "==> Running tests" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=1 +run_test_tp "TEST ${i} IPv4 UDP redirect local to other local address, same port" \ + 192.0.2.6 192.0.2.5 192.0.2.255 "" 12345 udp "-4" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv4 UDP redirect local to other local address, different port" \ + 192.0.2.6 192.0.2.5 192.0.2.255 ",65534" 12345 udp "-4" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_tp "TEST ${i} IPv4 TCP redirect local to other local address, same port" \ + 192.0.2.6 192.0.2.5 192.0.2.255 "" 12345 tcp "-4" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv4 TCP redirect local to other local address, different port" \ + 192.0.2.6 192.0.2.5 192.0.2.255 ",65534" 12345 tcp "-4" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_tp "TEST ${i} IPv4 UDP redirect foreign to local address, same port" \ + 192.0.2.6 192.0.2.1 192.0.2.255 "" 12345 udp "-4" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv4 UDP redirect foreign to local address, different port" \ + 192.0.2.6 192.0.2.1 192.0.2.255 ",65534" 12345 udp "-4" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_tp "TEST ${i} IPv4 TCP redirect foreign to local address, same port" \ + 192.0.2.6 192.0.2.1 192.0.2.255 "" 12345 tcp "-4" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv4 TCP redirect foreign to local address, different port" \ + 192.0.2.6 192.0.2.1 192.0.2.255 ",65534" 12345 tcp "-4" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 UDP redirect local to other local address, same port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 "" 12345 udp "-6" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 UDP redirect local to other local address, different port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 ",65534" 12345 udp "-6" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 TCP redirect local to other local address, same port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 "" 12345 tcp "-6" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 TCP redirect local to other local address, different port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 ",65534" 12345 tcp "-6" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 UDP redirect foreign to local address, same port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 "" 12345 udp "-6" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 UDP redirect foreign to local address, different port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 ",65534" 12345 udp "-6" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 TCP redirect foreign to local address, same port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 "" 12345 tcp "-6" + +i=$((i + 1)) +run_test_tp "TEST ${i} IPv6 TCP redirect foreign to local address, different port" \ + 2001:db8:1::2 2001:db8::1 2001:db8:ffff::1 ",65534" 12345 tcp "-6" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_nh "TEST ${i} IPv4 UDP redirect to foreign address" \ + 192.0.2.6 192.0.2.5 192.0.2.1 "" 12345 udp "-4" + +i=$((i + 1)) +run_test_nh "TEST ${i} IPv4 TCP redirect to foreign address" \ + 192.0.2.6 192.0.2.5 192.0.2.1 "" 12345 tcp "-4" + +#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +i=$((i + 1)) +run_test_nh "TEST ${i} IPv6 UDP redirect to foreign address" \ + 2001:db8:1::2 2001:db8:1::1 2001:db8::1 "" 12345 udp "-6" + +i=$((i + 1)) +run_test_nh "TEST ${i} IPv6 TCP redirect to foreign address" \ + 2001:db8:1::2 2001:db8:1::1 2001:db8::1 "" 12345 tcp "-6" + +################################################################################ +# +# Cleanup +# +echo "==> Cleaning up in 3 seconds" +# Let VIMAGE network stacks settle to avoid panics while still "experimental". +sleep 3 + +jail -r ${rjid} +jail -r ${mjid} +jail -r ${ljid} + +for jid in ${rjid} ${mjid} ${ljid}; do + while : ; do + x=`jls -as -j ${jid} jid 2>/dev/null` + case "${x}" in + jid=*) echo "Waiting for jail ${jid} to stop." >&2 + sleep 1 + continue + ;; + esac + break + done +done + +ifconfig ${lmep}a destroy +ifconfig ${mrep}a destroy + +# end Property changes on: projects/vnet/_scripts/jail-start-lmr-ipfw.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-epair-regression01.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-epair-regression01.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-epair-regression01.sh (revision 302301) @@ -0,0 +1,62 @@ +#!/bin/sh +#- +# Copyright (c) 2011, "Bjoern A. Zeeb" +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBS$ +# + +# Based on a report: +# ------------------------------------------------ +# Date: Thu, 20 Jan 2011 22:47:02 +0200 +# From: Mikolaj Golub +# To: freebsd-virtualization@FreeBSD.org +# Message-ID: <86k4hz5mm1.fsf@kopusha.home.net> + +PID=$$ + +IF_base() +{ + local _if ifname + + ifname=$1 + + _if=`ifconfig ${ifname} create` + expr ${_if} : '\(.*\).' +} + +echo "==> Running regression01.." +jid=`jail -i -c -n regression01-${PID} host.hostname=regression01-$$.example.org vnet persist` +ep=$(IF_base epair) +ifconfig ${ep} create +ifconfig ${ep}b vnet ${jid} +ifconfig ${ep}a destroy + +# This would panic. +jexec ${jid} ifconfig -an + +echo "Cleaning up." +jail -r ${jid} + +# end Property changes on: projects/vnet/_scripts/jail-vnet-epair-regression01.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-netperf.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-netperf.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-netperf.sh (revision 302301) @@ -0,0 +1,186 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +if test ! -x /usr/local/bin/netserver -o ! -x /usr/local/bin/netperf ; then + echo "ERROR: Cannot find netserver or netperf in /usr/local/bin" >&2 + exit 1 +fi + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +prefix=/tmp/`date +%s` + +i=0 + +ending() +{ +# vmstat -m > ${prefix}-vmstat-m-2 +# echo "diff -up ${prefix}-vmstat-m-?" +# vmstat -z > ${prefix}-vmstat-z-2 +# echo "diff -up ${prefix}-vmstat-z-?" + + exit 0 +} + +wait_enter() +{ + local line + +# echo -n "Press Enter to continue.." +# read line +} + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# Pre-start a single jail to get rid of various debugging +# output on console for the real test. Make sure not to leak zones but +# to forcefully clear them or stats are bogus. +#sysctl security.jail.vimage_debug_memory=2 +id=`jail -i -c vnet persist` +jail -r ${id} + + +# Private debugging. +# 0x01 == print; 0x02 destroy uma zones upon jail teardown no matter what +#sysctl security.jail.vimage_debug_memory=0 +#sysctl security.jail.vimage_debug_memory=1 +#sysctl security.jail.vimage_debug_memory=2 +#sysctl security.jail.vimage_debug_memory=3 + +#vmstat -z > ${prefix}-vmstat-z-1 +#vmstat -m > ${prefix}-vmstat-m-1 + +# Start left (client) jail. +ljid=`jail -i -c host.hostname=left$$.example.net vnet persist` + +# Start middle (forwarding) jail. +mjid=`jail -i -c host.hostname=center$$.example.net vnet persist` + +# Start right (server) jail. +rjid=`jail -i -c host.hostname=right$$.example.net vnet persist` + +echo "left ${ljid} middle ${mjid} right ${rjid}" + +# Create networking. +# +# jail: left middle right +# ifaces: lmep:a ---- lmep:b mrep:a ---- mrep:b +# + +jexec ${mjid} sysctl net.inet.ip.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.forwarding=1 +jexec ${mjid} sysctl net.inet6.ip6.accept_rtadv=0 + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ljid} +ifconfig ${lmep}b vnet ${mjid} + +jexec ${ljid} ifconfig lo0 127.0.0.1/8 +jexec ${ljid} ifconfig ${lmep}a inet 192.0.2.1/30 up +jexec ${ljid} ifconfig ${lmep}a inet6 2001:db8::1/64 alias + +jexec ${ljid} route add default 192.0.2.2 +jexec ${ljid} route add -inet6 default 2001:db8::2 + +jexec ${mjid} ifconfig lo0 127.0.0.1/8 +jexec ${mjid} ifconfig ${lmep}b inet 192.0.2.2/30 up +jexec ${mjid} ifconfig ${lmep}b inet6 2001:db8::2/64 alias + +mrep=$(epair_base) +ifconfig ${mrep}a vnet ${mjid} +ifconfig ${mrep}b vnet ${rjid} + +jexec ${mjid} ifconfig ${mrep}a inet 192.0.2.5/30 up +jexec ${mjid} ifconfig ${mrep}a inet6 2001:db8:1::1/64 alias + +jexec ${rjid} ifconfig lo0 127.0.0.1/8 +jexec ${rjid} ifconfig ${mrep}b inet 192.0.2.6/30 up +jexec ${rjid} ifconfig ${mrep}b inet6 2001:db8:1::2/64 alias + +jexec ${rjid} route add default 192.0.2.5 +jexec ${rjid} route add -inet6 default 2001:db8:1::1 + +echo "press any key to continue (some do not work)" +read line + +# Run some tests. +jexec ${ljid} ping -q -n -i 0.1 -c 3 192.0.2.1 +jexec ${ljid} ping -q -n -i 0.1 -c 3 192.0.2.2 +jexec ${ljid} ping -q -n -i 0.1 -c 3 192.0.2.5 +jexec ${ljid} ping -q -n -i 0.1 -c 3 192.0.2.6 + +jexec ${ljid} ping6 -q -n -i 0.1 -c 3 2001:db8::1 +jexec ${ljid} ping6 -q -n -i 0.1 -c 3 2001:db8::2 +jexec ${ljid} ping6 -q -n -i 0.1 -c 3 2001:db8:1::1 +jexec ${ljid} ping6 -q -n -i 0.1 -c 3 2001:db8:1::2 + +jexec ${ljid} traceroute -n 192.0.2.6 +jexec ${ljid} traceroute6 -n 2001:db8:1::2 + +# Start netservers in both middle and right. +# Use different ports; netserver is a bit picky; else we'd need to sleep. +jexec ${mjid} netserver -p 20001 -4 -L 192.0.2.2 +jexec ${mjid} netserver -p 20002 -6 -L 2001:db8::2 +jexec ${rjid} netserver -p 20003 -4 -L 192.0.2.6 +jexec ${rjid} netserver -p 20004 -6 -L 2001:db8:1::2 + +jexec ${ljid} netperf -p 20001 -H 192.0.2.2 -f m -L 192.0.2.1 -t TCP_STREAM +jexec ${ljid} netperf -p 20002 -H 2001:db8::2 -f m -L 2001:db8::1 -t TCP_STREAM +jexec ${ljid} netperf -p 20003 -H 192.0.2.6 -f m -L 192.0.2.1 -t TCP_STREAM +jexec ${ljid} netperf -p 20004 -H 2001:db8:1::2 -f m -L 2001:db8::1 -t TCP_STREAM + +jexec ${ljid} netperf -p 20001 -H 192.0.2.2 -f m -L 192.0.2.1 -t UDP_STREAM +jexec ${ljid} netperf -p 20002 -H 2001:db8::2 -f m -L 2001:db8::1 -t UDP_STREAM +jexec ${ljid} netperf -p 20003 -H 192.0.2.6 -f m -L 192.0.2.1 -t UDP_STREAM +jexec ${ljid} netperf -p 20004 -H 2001:db8:1::2 -f m -L 2001:db8::1 -t UDP_STREAM + +# Cleanup jails. +wait_enter +jail -r ${ljid} +wait_enter +jail -r ${mjid} +wait_enter +jail -r ${rjid} + +ending + +# end Property changes on: projects/vnet/_scripts/jail-vnet-netperf.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-setup-host.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-setup-host.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-setup-host.sh (revision 302301) @@ -0,0 +1,55 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +xid=`id -u` +case ${xid} in +0) ;; +*) echo "Run as superuser" + exit 1 + ;; +esac + +echo "STOPPING POWERD" +sh /etc/rc.d/powerd onestop || true + +rm -rf /boot/kernel/ +mount 192.0.2.1:/vol/users/bz/projects_vnet /mnt +cp -pr /mnt/boot/kernel /boot/ +umount /mnt +sync +#ls -l /boot/kernel/ + +kldload pf || true + +# end Property changes on: projects/vnet/_scripts/jail-vnet-setup-host.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-start-stop.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-start-stop.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-start-stop.sh (revision 302301) @@ -0,0 +1,78 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +max=$1 +case "${max}" in +"") max=9999999 + ;; +esac + +prefix=/tmp/`date +%s` + +i=0 + +ending() +{ +# vmstat -m > ${prefix}-vmstat-m-2 +# echo "diff -up ${prefix}-vmstat-m-?" +# vmstat -z > ${prefix}-vmstat-z-2 +# echo "diff -up ${prefix}-vmstat-z-?" + + exit 0 +} + +#sysctl security.jail.vimage_debug_memory=0 +#sysctl security.jail.vimage_debug_memory=2 + +#vmstat -z > ${prefix}-vmstat-z-1 +#vmstat -m > ${prefix}-vmstat-m-1 + +while : ; do + + i=$((i+1)) + x=`expr ${i} % 100` + case ${x} in + 0) echo "`date` try ${i}" ;; + esac + id=`jail -i -c vnet persist` + #echo "ID=${id}" + jail -r ${id} + + if test ${id} -ge ${max} ; then + echo "Reached max; ending.." + ending + fi +done + +ending + +# end Property changes on: projects/vnet/_scripts/jail-vnet-start-stop.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-test-10.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-test-10.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-test-10.sh (revision 302301) @@ -0,0 +1,61 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +wait_enter() +{ + local line + + echo -n "Press Enter to continue.." + read line +} + +# Private debugging. +#sysctl security.jail.vimage_debug_memory=2 + +ifconfig disc0 create +id=`jail -i -c vnet persist` +ifconfig disc0 vnet ${id} +jexec ${id} ifconfig disc0 inet 192.0.2.1/32 up +#jexec ${id} ifconfig disc0 inet6 2001:db8::1 +jexec ${id} route add -inet 192.0.2.128/25 192.0.2.1 +#jexec ${id} route add -inet6 2001:db8:1:dead::/64 2001:db8::1 +sleep 1 +jail -r ${id} +ifconfig disc0 destroy + +# end Property changes on: projects/vnet/_scripts/jail-vnet-test-10.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-test-20.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-test-20.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-test-20.sh (revision 302301) @@ -0,0 +1,99 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +ending() +{ + + exit 0 +} + +wait_enter() +{ + local line + +# echo -n "Press Enter to continue.." +# read line +} + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# Pre-start a single jail to get rid of various debugging +# output on console for the real test. Make sure not to leak zones but +# to forcefully clear them or stats are bogus. +#sysctl security.jail.vimage_debug_memory=2 +#id=`jail -i -c vnet persist` +#jail -r ${id} + + +# Private debugging. +# 0x01 == print; 0x02 destroy uma zones upon jail teardown no matter what +#sysctl security.jail.vimage_debug_memory=0 +#sysctl security.jail.vimage_debug_memory=1 +#sysctl security.jail.vimage_debug_memory=2 +#sysctl security.jail.vimage_debug_memory=3 + +# Start jail. +jid=`jail -i -c host.hostname=left$$.example.net vnet persist` + +echo "jid=${jid}" + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${jid} + +jexec ${jid} ifconfig ${lmep}a inet 192.0.2.1/24 up +ifconfig ${lmep}b inet 192.0.2.2/24 up + +for i in `jot 254 1`; do + ping -n -W 100 -i 0.1 -c 1 192.0.2.${i} +done + +# Cleanup jails. +wait_enter +jail -r ${jid} + +ifconfig ${lmep}b destroy + +ending + +# end Property changes on: projects/vnet/_scripts/jail-vnet-test-20.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-test-21.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-test-21.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-test-21.sh (revision 302301) @@ -0,0 +1,104 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +ending() +{ + + exit 0 +} + +wait_enter() +{ + local line + +# echo -n "Press Enter to continue.." +# read line +} + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# Pre-start a single jail to get rid of various debugging +# output on console for the real test. Make sure not to leak zones but +# to forcefully clear them or stats are bogus. +#sysctl security.jail.vimage_debug_memory=2 +#id=`jail -i -c vnet persist` +#jail -r ${id} + + +# Private debugging. +# 0x01 == print; 0x02 destroy uma zones upon jail teardown no matter what +#sysctl security.jail.vimage_debug_memory=0 +#sysctl security.jail.vimage_debug_memory=1 +#sysctl security.jail.vimage_debug_memory=2 +#sysctl security.jail.vimage_debug_memory=3 + +# Start jail. +jid=`jail -i -c host.hostname=left$$.example.net vnet persist` +echo "jid=${jid}" + +# Generate a prefix ID from the process ID. +pid=$(printf "%x" `expr $$ % 65535`) + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${jid} + +jexec ${jid} ifconfig ${lmep}a inet6 2001:dbe8:dead:${pid}::1/64 up +ifconfig ${lmep}b inet6 2001:dbe8:dead:${pid}::2/64 up + +ping6 -n -c 3 "2001:dbe8:dead:${pid}::1" +# Give ND/DUD a chance etc. +sleep 3 +for i in `jot 254 1`; do + ping6 -n -i 0.1 -c 1 "2001:dbe8:dead:${pid}::${i}" +done + +# Cleanup jails. +wait_enter +jail -r ${jid} + +ifconfig ${lmep}b destroy + +ending + +# end Property changes on: projects/vnet/_scripts/jail-vnet-test-21.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-test-30.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-test-30.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-test-30.sh (revision 302301) @@ -0,0 +1,96 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +ending() +{ + + exit 0 +} + +wait_enter() +{ + local line + +# echo -n "Press Enter to continue.." +# read line +} + +pid=$$ + +# Start jail. +jid=`jail -i -c host.hostname=${pid}.example.net vnet persist` +echo "jid=${jid}" + +# Generate a prefix ID from the process ID. +pid=$(printf "%d" `expr ${pid} % 65535`) + +# Create a disc interface and move it into the jail. +ifconfig disc${pid} create +ifconfig disc${pid} vnet ${jid} + +# Create another disc interface and rename it to the same name +# as the one sitting in the vnet. +pidn=$((pid + 1)) +ifconfig disc${pidn} create +ifconfig disc${pidn} name disc${pid} + +ifconfig -l +wait_enter + +# Now we could just teardown the jail but to ease debugging +# let it alive and just move the interface back to base. +ifconfig disc${pid} -vnet ${jid} +# ^^^^^^^^^^^^ this is the problem and we will "lose" the iface. + +ifconfig -l +ifconfig -a | grep disc${pid} +ifconfig -a | grep disc${pidn} +# XXX once we no longer lose the iface, clean it up here as well. + +# Now cleanup jails. +wait_enter +jail -r ${jid} + +ifconfig disc${pid} destroy +ifconfig disc${pid} destroy + +ifconfig -l + +ending + +# end Property changes on: projects/vnet/_scripts/jail-vnet-test-30.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet-test.sh =================================================================== --- projects/vnet/_scripts/jail-vnet-test.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet-test.sh (revision 302301) @@ -0,0 +1,60 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +wait_enter() +{ + local line + + echo -n "Press Enter to continue.." + read line +} + +# Private debugging. +sysctl security.jail.vimage_debug_memory=2 + +id=`jail -i -c vnet persist` +jexec ${id} ifconfig lo0 up +jexec ${id} ifconfig lo0 127.0.0.1/8 up +jexec ${id} route add 192.0.20/24 127.0.0.1 +jexec ${id} route add 10.0.0.0/8 127.0.0.1 +jexec ${id} route add 172.16.0.0/16 127.0.0.1 +jexec ${id} route add 192.168.0.0/16 127.0.0.1 +jexec ${id} ifconfig lo0 down +jail -r ${id} + +# end Property changes on: projects/vnet/_scripts/jail-vnet-test.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail-vnet.sh =================================================================== --- projects/vnet/_scripts/jail-vnet.sh (nonexistent) +++ projects/vnet/_scripts/jail-vnet.sh (revision 302301) @@ -0,0 +1,64 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +xid=`id -u` +case ${xid} in +0) ;; +*) echo "Run as superuser" + exit 1 + ;; +esac + +sh jail-vnet-setup-host.sh + +#sysctl security.jail.callout_debug=0 || true +#sysctl sysctl vm.uma_zone_nofree_ignore=0 || true +#kenv net.inet.ip.flowtable.enable=0 + +sh loop.sh cleanup-epairs.sh & +#sh loop.sh jail-vnet-netperf.sh & +sh loop.sh jail-vnet-start-stop.sh & +sh loop.sh jail-vnet-test-10.sh & +sh loop.sh jail-vnet-test-20.sh & +sh loop.sh jail-vnet-test-21.sh & +sh loop.sh jail-vnet-test-30.sh & +sh loop.sh jail-vnet-test.sh & +sh loop.sh conductor/tests/http/run-as-shell-not-conductor.sh & +sh loop.sh conductor/tests/http/run-as-shell-not-conductor-pf.sh & +sh loop.sh jail-start-lmr-ipfw.sh & + +sh loop.sh stop-netperf.sh & +sh jail-random-stop.sh + +# end Property changes on: projects/vnet/_scripts/jail-vnet.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/jail.sh =================================================================== --- projects/vnet/_scripts/jail.sh (nonexistent) +++ projects/vnet/_scripts/jail.sh (revision 302301) @@ -0,0 +1,75 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -e + +e1=`ifconfig epair create | sed -e 's/a$//'` +e2=`ifconfig epair create | sed -e 's/a$//'` +e3=`ifconfig epair create | sed -e 's/a$//'` + +cleft=`jail -i -c -n cleft$$ host.hostname=cleft$$.example.net vnet persist` +rleft=`jail -i -c -n rleft$$ host.hostname=rleft$$.example.net vnet persist` +rright=`jail -i -c -n rright$$ host.hostname=rright$$.example.net vnet persist` +cright=`jail -i -c -n cright$$ host.hostname=cright$$.example.net vnet persist` + +for jid in ${cleft} ${rleft} ${rright} ${cright}; do + jexec ${jid} ifconfig lo0 inet 127.0.0.1/8 alias + jexec ${jid} ifconfig lo0 inet6 ::1/128 alias +done + +ifconfig ${e1}a vnet ${cleft} +ifconfig ${e1}b vnet ${rleft} +jexec ${cleft} ifconfig ${e1}a inet6 2001:db8:6c::1 +jexec ${rleft} ifconfig ${e1}b inet6 2001:db8:6c::2 + +ifconfig ${e2}a vnet ${rleft} +ifconfig ${e2}b vnet ${rright} +jexec ${rleft} ifconfig ${e2}a inet6 2001:db8:6d::1 +jexec ${rright} ifconfig ${e2}b inet6 2001:db8:6d::2 + +ifconfig ${e3}a vnet ${rright} +ifconfig ${e3}b vnet ${cright} +jexec ${rright} ifconfig ${e3}a inet6 2001:db8:72::1 +jexec ${cright} ifconfig ${e3}b inet6 2001:db8:72::2 + +jexec ${rleft} sysctl net.inet.ip.forwarding=1 +jexec ${rleft} sysctl net.inet6.ip6.forwarding=1 +jexec ${rright} sysctl net.inet.ip.forwarding=1 +jexec ${rright} sysctl net.inet6.ip6.forwarding=1 + +jexec ${cleft} route add -inet6 default 2001:db8:6c::2 +jexec ${rleft} route add -inet6 default 2001:db8:6d::2 +jexec ${rright} route add -inet6 default 2001:db8:6d::1 +jexec ${cright} route add -inet6 default 2001:db8:72::1 + + +# end Property changes on: projects/vnet/_scripts/jail.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/loop-start-cleanup.sh =================================================================== --- projects/vnet/_scripts/loop-start-cleanup.sh (nonexistent) +++ projects/vnet/_scripts/loop-start-cleanup.sh (revision 302301) @@ -0,0 +1,35 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +while : ; do sh jail.sh; sh cleanup.sh; date; done + +# end Property changes on: projects/vnet/_scripts/loop-start-cleanup.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/loop.sh =================================================================== --- projects/vnet/_scripts/loop.sh (nonexistent) +++ projects/vnet/_scripts/loop.sh (revision 302301) @@ -0,0 +1,42 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + + +while : ; do + + sh $1 + echo -n "." + sleep 1 + +done + +# end Property changes on: projects/vnet/_scripts/loop.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/stop-netperf.sh =================================================================== --- projects/vnet/_scripts/stop-netperf.sh (nonexistent) +++ projects/vnet/_scripts/stop-netperf.sh (revision 302301) @@ -0,0 +1,36 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +killall netperf +sleep 120 + +# end Property changes on: projects/vnet/_scripts/stop-netperf.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/test-disc.sh =================================================================== --- projects/vnet/_scripts/test-disc.sh (nonexistent) +++ projects/vnet/_scripts/test-disc.sh (revision 302301) @@ -0,0 +1,48 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -x + +d=`ifconfig disc create` +jid=`jail -i -c -n test$$ host.hostname=test$$.example.net vnet persist` + +/sbin/ifconfig ${d} vnet ${jid} + +sleep 1 + +jail -r ${jid} + +sleep 1 + +ifconfig ${d} destroy + +# end Property changes on: projects/vnet/_scripts/test-disc.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/test-epair-destroy.sh =================================================================== --- projects/vnet/_scripts/test-epair-destroy.sh (nonexistent) +++ projects/vnet/_scripts/test-epair-destroy.sh (revision 302301) @@ -0,0 +1,83 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +case `id -u` in +0) ;; +*) echo "ERROR: Must be run as superuser." >&2 + exit 2 +esac + +prefix=/tmp/`date +%s` + +i=0 + +ending() +{ +# vmstat -m > ${prefix}-vmstat-m-2 +# echo "diff -up ${prefix}-vmstat-m-?" +# vmstat -z > ${prefix}-vmstat-z-2 +# echo "diff -up ${prefix}-vmstat-z-?" + + exit 0 +} + +wait_enter() +{ + local line + +# echo -n "Press Enter to continue.." +# read line +} + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +# Start a jail +ajid=`jail -i -c -n ajail$$ host.hostname=ajail$$.example.net vnet persist` + +lmep=$(epair_base) +ifconfig ${lmep}a vnet ${ajid} + +jexec ${ajid} ifconfig ${lmep}a inet6 2001:db8::1/64 alias + +ifconfig ${lmep}b inet6 2001:db8::2/64 alias + +ifconfig ${lmep}b destroy + +ending + +# end Property changes on: projects/vnet/_scripts/test-epair-destroy.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/test-ipv6rt.sh =================================================================== --- projects/vnet/_scripts/test-ipv6rt.sh (nonexistent) +++ projects/vnet/_scripts/test-ipv6rt.sh (revision 302301) @@ -0,0 +1,57 @@ +#!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -x + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +ep=$(epair_base) +jid=`jail -i -c -n test$$ host.hostname=test$$.example.net vnet persist` + +echo "Test just IPv6 up" +/sbin/ifconfig ${ep}b vnet ${jid} +jexec ${jid} /sbin/ifconfig ${ep}b up +jexec ${jid} /sbin/ifconfig ${ep}b inet6 2001:db8::1/64 alias +jexec ${jid} /sbin/ifconfig ${ep}b inet6 -ifdisabled +jexec ${jid} /usr/bin/netstat -rn +/sbin/ifconfig ${ep}b -vnet ${jid} +jexec ${jid} /usr/bin/netstat -rn +jail -r ${jid} +ifconfig ${ep}a destroy + +# end Property changes on: projects/vnet/_scripts/test-ipv6rt.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: projects/vnet/_scripts/test-sequence.sh =================================================================== --- projects/vnet/_scripts/test-sequence.sh (nonexistent) +++ projects/vnet/_scripts/test-sequence.sh (revision 302301) @@ -0,0 +1,76 @@ +!/bin/sh +#- +# Copyright (c) 2016 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Björn Zeeb under +# the sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#set -x + +epair_base() +{ + local ep + + ep=`ifconfig epair create` + expr ${ep} : '\(.*\).' +} + +ep=$(epair_base) +jid=`jail -i -c -n test$$ host.hostname=test$$.example.net vnet persist` + +echo "Move interface in and out." +/sbin/ifconfig ${ep}b vnet ${jid} +/sbin/ifconfig ${ep}b -vnet ${jid} + +#sleep 1 + +echo "Test just IPv4 up." +/sbin/ifconfig ${ep}b vnet ${jid} +jexec ${jid} /sbin/ifconfig ${ep}b up +jexec ${jid} /sbin/ifconfig ${ep}b inet 192.0.0.2/24 alias +#echo . +/sbin/ifconfig ${ep}b -vnet ${jid} + +#sleep 1 + +echo "Test just IPv6 up" +/sbin/ifconfig ${ep}b vnet ${jid} +jexec ${jid} /sbin/ifconfig ${ep}b up +jexec ${jid} /sbin/ifconfig ${ep}b inet6 2001:db8::1/64 alias +jexec ${jid} /sbin/ifconfig ${ep}b inet6 -ifdisabled +#jexec ${jid} /usr/bin/netstat -rn +/sbin/ifconfig ${ep}b -vnet ${jid} +#jexec ${jid} /usr/bin/netstat -rn + +#sleep 1 + +echo "Teardown" +jail -r ${jid} +ifconfig ${ep}a destroy + +# end Property changes on: projects/vnet/_scripts/test-sequence.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property