aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-05-25 12:26:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-05-25 12:26:38 +0000
commitac5635f77da7e01a4061881521528acafb726827 (patch)
tree0d2b156f9332abf5a435c4fdfdce0d3f33411471 /tests
parent640d67c119feca9999e23625a50330d02456d11a (diff)
added function for individual ftp slave kills
Diffstat (limited to 'tests')
-rw-r--r--tests/ftp.pm28
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/ftp.pm b/tests/ftp.pm
index 25d7df745..015f9f08a 100644
--- a/tests/ftp.pm
+++ b/tests/ftp.pm
@@ -30,6 +30,24 @@ sub checkserver {
}
#############################################################################
+# Kill a specific slave
+#
+sub ftpkillslave {
+ my ($id, $ext, $verbose)=@_;
+ my $base;
+ for $base (('filt', 'data')) {
+ my $f = ".sock$base$id$ext.pid";
+ my $pid = checkserver($f);
+ if($pid > 0) {
+ printf ("* kill pid for %s => %d\n", "ftp-$base$id$ext", $pid) if($verbose);
+ kill (9, $pid); # die!
+ }
+ unlink($f);
+ }
+}
+
+
+#############################################################################
# Make sure no FTP leftovers are still running. Kill all slave processes.
# This uses pidfiles since it might be used by other processes.
#
@@ -37,15 +55,7 @@ sub ftpkillslaves {
my ($versbose) = @_;
for $ext (("", "ipv6")) {
for $id (("", "2")) {
- for $base (('filt', 'data')) {
- my $f = ".sock$base$id$ext.pid";
- my $pid = checkserver($f);
- if($pid > 0) {
- printf ("* kill pid for %-5s => %-5d\n", "ftp-$base$id$ext", $pid) if($verbose);
- kill (9, $pid); # die!
- }
- unlink($f);
- }
+ ftpkillslave ($id, $ext, $verbose);
}
}
}