From 1507b886f8093f38cf84d62236fb076395557b4d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 19 Feb 2008 22:04:26 +0100 Subject: Add VDE switch management functions. (This used to be commit 5ad9bc7dd9b8a3b37e0acd77eaecc5ee71d7b422) --- source4/selftest/selftest.pl | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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 +# Copyright (C) 2005-2008 Jelmer Vernooij # 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"); + =~ /([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) = @_; -- cgit