]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: Add cleanup/start/stop functions to functions.pm
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 11 Mar 2010 14:22:24 +0000 (15:22 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:39 +0000 (16:49 +0200)
regress/scripts/functions.pm

index 37d11eab69fe2faed5f324e665369bf5983cec68..337074791d4d2e50ea410de3cb4546a31c6a12d4 100644 (file)
@@ -39,7 +39,7 @@ use Exporter;
 our @ISA = qw(Exporter);
 our @EXPORT =  qw(update_some_files create_many_files check_multiple_copies
                   update_client $HOST $BASEPORT add_to_backup_list check_volume_size
-                  create_many_dirs
+                  create_many_dirs cleanup start_bacula stop_bacula
                   check_min_volume_size check_max_volume_size $estat $bstat $rstat $zstat
                   $cwd $bin $scripts $conf $rscripts $tmp $working extract_resource
                   $db_name $db_user $db_password $src $tmpsrc);
@@ -92,6 +92,26 @@ BEGIN {
     $estat = $rstat = $bstat = $zstat = 0;
 }
 
+sub cleanup
+{
+    system("$rscripts/cleanup");
+    return $? == 0;
+}
+
+sub start_bacula
+{
+    $ENV{LANG}='C';
+    system("$bin/bacula start");
+    return $? == 0;
+}
+
+sub stop_bacula
+{
+    $ENV{LANG}='C';
+    system("$bin/bacula stop");
+    return $? == 0;
+}
+
 sub extract_resource
 {
     my ($file, $type, $name) = @_;