mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Add VDE switch management functions.
(This used to be commit 5ad9bc7dd9
)
This commit is contained in:
parent
c2941c9f0b
commit
1507b886f8
@ -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) = @_;
|
||||
|
Loading…
Reference in New Issue
Block a user