[otrs-cvs] UnitTest/bin UnitTestAutoSetup.pl,1.243,1.244

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/UnitTest/bin
In directory lancelot:/tmp/cvs-serv2451/bin

Modified Files:
	UnitTestAutoSetup.pl 
Log Message:
Added vacuum feature to protect postgresql databases to fail.

Author: mh

Index: UnitTestAutoSetup.pl
===================================================================
RCS file: /home/cvs/UnitTest/bin/UnitTestAutoSetup.pl,v
retrieving revision 1.243
retrieving revision 1.244
diff -2 -u -d -r1.243 -r1.244
--- UnitTestAutoSetup.pl	11 Dec 2012 09:25:33 -0000	1.243
+++ UnitTestAutoSetup.pl	11 Dec 2012 09:30:43 -0000	1.244
@@ -836,6 +836,32 @@
         );
 
+        # stop database and wait
+        system "$Databases{$Database}->{Server} stop";
+        sleep 5;
+
+        # create drop commands
+        my $PGVacuumCommands = 'vacuum full;';
+
+        # write sql file
+        open my $FH, '>', '/var/tmp/PGVacuum.sql';
+        print $FH $PGVacuumCommands;
+        close $FH;
+
+        # vacuum databases
+        system(
+            "su - $Databases{postgresql}->{User} -c 'postgres -D $Databases{postgresql}->{ConfDir} otrs_unit_test < /var/tmp/PGVacuum.sql'"
+        );
+        sleep 1;
+        system(
+            "su - $Databases{postgresql}->{User} -c 'postgres -D $Databases{postgresql}->{ConfDir} template1 < /var/tmp/PGVacuum.sql'"
+        );
+        sleep 1;
+        system(
+            "su - $Databases{postgresql}->{User} -c 'postgres -D $Databases{postgresql}->{ConfDir} postgres < /var/tmp/PGVacuum.sql'"
+        );
+        sleep 1;
+
         # start database and wait, get ready
-        system "$Databases{$Database}->{Server} restart";
+        system "$Databases{$Database}->{Server} start";
         sleep 10;
     }
@@ -1106,26 +1132,4 @@
             sleep 5;
 
-            # create drop commands
-            my $PGVacuumCommands = 'vacuum full;';
-
-            # write sql file
-            open my $FH, '>', '/var/tmp/PGVacuum.sql';
-            print $FH $PGVacuumCommands;
-            close $FH;
-
-            # vacuum databases
-            system(
-                "su - $Databases{postgresql}->{User} -c 'postgres -D $Databases{postgresql}->{ConfDir} otrs_unit_test < /var/tmp/PGVacuum.sql'"
-            );
-            sleep 1;
-            system(
-                "su - $Databases{postgresql}->{User} -c 'postgres -D $Databases{postgresql}->{ConfDir} template1 < /var/tmp/PGVacuum.sql'"
-            );
-            sleep 1;
-            system(
-                "su - $Databases{postgresql}->{User} -c 'postgres -D $Databases{postgresql}->{ConfDir} postgres < /var/tmp/PGVacuum.sql'"
-            );
-            sleep 1;
-
             # create new database
             system(
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.