diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-02-19 22:04:26 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-02-19 22:04:26 +0100 |
commit | 1507b886f8093f38cf84d62236fb076395557b4d (patch) | |
tree | 6ccc3165bef279d072edee275fde2b3bcf7b7e50 | |
parent | c2941c9f0b8a48e4ab190c087b7f32c64d76aa8e (diff) | |
download | samba-1507b886f8093f38cf84d62236fb076395557b4d.tar.gz samba-1507b886f8093f38cf84d62236fb076395557b4d.tar.bz2 samba-1507b886f8093f38cf84d62236fb076395557b4d.zip |
Add VDE switch management functions.
(This used to be commit 5ad9bc7dd9b8a3b37e0acd77eaecc5ee71d7b422)
-rwxr-xr-x | source4/selftest/selftest.pl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl index 996b982e06..aa4423c7e2 100755 --- a/source4/selftest/selftest.pl +++ b/source4/selftest/selftest.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # Bootstrap Samba and run a number of tests against it. -# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org> +# Copyright (C) 2005-2008 Jelmer Vernooij <jelmer@samba.org> # Published under the GNU GPL, v3 or later. =pod @@ -455,6 +455,31 @@ if ($opt_target eq "samba4") { $target = new Kvm($opt_image, undef); } +# +# Start a Virtual Distributed Ethernet Switch +# Returns the pid of the switch. +# +sub start_vde_switch($) +{ + my ($path) = @_; + + system("vde_switch --pidfile $path/vde.pid --sock $path/vde.sock --daemon"); + + open(PID, "$path/vde.pid"); + <PID> =~ /([0-9]+)/; + my $pid = $1; + close(PID); + + return $pid; +} + +# Stop a Virtual Distributed Ethernet Switch +sub stop_vde_switch($) +{ + my ($pid) = @_; + kill 9, $pid; +} + sub read_test_regexes($) { my ($name) = @_; |