]> git.sur5r.net Git - bacula/bacula/commitdiff
regress: cleanup bweb tables when starting bacula
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 11 Mar 2010 17:14:48 +0000 (18:14 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:39 +0000 (16:49 +0200)
regress/scripts/functions.pm

index 337074791d4d2e50ea410de3cb4546a31c6a12d4..5838a090a764f0b684f8842cf3b01083feb976a5 100644 (file)
@@ -100,9 +100,15 @@ sub cleanup
 
 sub start_bacula
 {
+    my $ret;
     $ENV{LANG}='C';
     system("$bin/bacula start");
-    return $? == 0;
+    $ret = $? == 0;
+    open(FP, ">$tmp/bcmd");
+    print FP "sql\ntruncate client_group;\ntruncate client_group_member;\nupdate Media set LocationId=0;\ntruncate location;\n\n";
+    close(FP);
+    system("cat $tmp/bcmd | $bin/bconsole >/dev/null");
+    return $ret;
 }
 
 sub stop_bacula