]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/bacula-dir.conf.testrunscript.in
regress: fix typo
[bacula/bacula] / regress / scripts / bacula-dir.conf.testrunscript.in
index 705581bfad7dd5ab399c036777b97c196b7d0de3..b23723c1c702e7b0c964a7ad84b5fc61a498ac67 100644 (file)
@@ -14,7 +14,7 @@
 
 Director {                            # define myself
   Name = @hostname@-dir
-  DIRport = 8101                # where we listen for UA connections
+  DIRPort = @dirport@                # where we listen for UA connections
   QueryFile = "@scriptdir@/query.sql"
   WorkingDirectory = "@working_dir@"
   PidDirectory = "@piddir@"
@@ -40,7 +40,7 @@ JobDefs {
 FileSet {
  Name = FS_TESTJOB
  Include {
-   File=</tmp/file-list
+   File=<@tmpdir@/file-list
  }
 }
 
@@ -57,8 +57,58 @@ Job {
   ClientRunBeforeJob = "/bin/echo ClientRunBeforeJob"
   Run After Job = "/bin/echo RunAfterJob"
   ClientRunAfterJob = "/bin/echo ClientRunAfterJob"
+  RunScript {
+    Command = "/bin/echo ClientRunBefore1"
+    Command = "/bin/echo ClientRunBefore2"
+    Command = "/bin/echo ClientRunBefore3"
+    Command = "/bin/echo ClientRunBefore4"
+    RunsWhen = Before
+  }
+}
+
+# first, you need to unzip win32/win32_runscript.zip to c:/temp
+Job {
+  Name = "RUN_WIN32"
+  JobDefs = DefaultJob
+  FileSet = FS_TESTJOB
+  RunScript {                                              # 2.4 | 2.5 | cmd /c
+     Command = "c:\\temp\\test.bat"                        # ok  | ok  | ok
+     Command = "c:\\temp\\test.bat arg1"                   # ok  | ok  | ok
+     Command = "c:/temp/test.bat"                          # ok  | ok  | ok
+     Command = "c:/temp/test.bat arg1"                     # ok  | ok  | ok
+     Command = "c:/temp/test space.bat"                    # ok  | ok  | ok
+     Command = "c:/temp/test2 space.bat"                   # ok  | ok  | ok
+     Command = "\"c:/temp/test space.bat\" arg1"           # ok  | ok  | ok
+     Command = "\"c:/temp/dir space/test.bat\" arg1"       # ok  | ok  | ok
+     Command = "c:/temp/érïc/test.bat"                     # ERR | ok  | ok
+     Command = "c:/temp/érïc/test space.bat"               # ERR | ok  | ok
+     Command = "c:/temp/testé.bat"                         # ERR | ok  | ok
+     Command = "c:/temp/érïc/testé.bat"                    # ERR | ok  | ok
+     Command = "\"c:/temp/dir space/érïc/test.bat\""       # ERR | ERR | ok 
+     Command = "\"c:/temp/dir space/érïc/test space.bat\"" # ERR | ERR | ok 
+     Command = "c:/temp/test space.bat arg1"               # ERR | ERR | ERR
+     Command = "c:/temp/test2 space.bat arg1"              # ERR | ERR | ERR
+     Command = "c:/temp/dir space/érïc/test.bat"           # ERR | ERR | ERR 
+     Command = "c:/temp/dir space/test.bat"                # ERR | ERR | ERR
+     Command = "'c:/temp/dir space/test.bat'"              # ERR | ERR | ERR
+     Command = "\"c:/temp/éric space/test.bat\""           # ERR | ERR | ERR
+     Command = "c:/temp/éric space/test.bat"               # ERR | ERR | ERR
+     RunsWhen = Before
+     FailJobOnError = no
+  }
+}
+
+Job {
+  Name = "RUN_SUBST"
+  JobDefs = DefaultJob
+  FileSet = FS_TESTJOB
+  RunBeforeJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
+  ClientRunBeforeJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
+  ClientRunAfterJob = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t"
+  Run After Job = "/bin/echo client_name=%c (@hostname@-fd) dir_name=%d (@hostname@-dir) jobid=%i job=%n type=%t vol=%v status=%e"
 }
 
+
 #After job are after before job
 Job {
   Name = "RUN_DIR_FAILED_BUG"
@@ -80,6 +130,7 @@ Job {
 
 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"
 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED2"
+#@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED3"
 #@hostname@-dir: AfterJob: run command "/bin/echo RunAfterFailedJob"
 Job {
   Name = "RUN_FD_FAILED"
@@ -87,30 +138,32 @@ Job {
   JobDefs = DefaultJob
   RunScript {
     Command = "/bin/false RUN_FD_FAILED1"
+    Command = "/bin/false RUN_FD_FAILED2"
     failjobonerror = no
     RunsWhen = Before
   }
   RunScript {
-    Command = "/bin/false RUN_FD_FAILED2"
+    Command = "/bin/false RUN_FD_FAILED3"
+    Command = "/bin/false RUN_FD_FAILED4"
     failjobonerror = yes
     RunsWhen = Before
   }
 
   Run After Failed Job = "/bin/echo RunAfterFailedJob"
   RunScript {
-    Command = "/bin/echo touching /tmp/RUN_FD_FAILED"
+    Command = "/bin/echo touching @tmpdir@/RUN_FD_FAILED"
     RunsWhen = after
     RunsOnFailure = yes
   }
   RunScript {
-    Command = "/bin/touch /tmp/RUN_FD_FAILED"
+    Command = "/bin/touch @tmpdir@/RUN_FD_FAILED"
     RunsWhen = after
     RunsOnFailure = yes
   }
 }
 
 #@hostname@-fd: ClientBeforeJob: run command "/bin/false RUN_FD_FAILED1"
-#we dont execute FAILED2 
+#we don't execute FAILED2 
 #@hostname@-dir: AfterJob: run command "/bin/echo RunAfterFailedJob"
 Job {
   Name = "RUN_FD_FAILED2"
@@ -150,36 +203,60 @@ Job {
   Run After Failed Job = "/bin/echo RunAfterFailedJob"
 }
 
-FileSet {
- Name = FS_FIFO
- Include {
-   Options { readfifo = yes }
-   File=</tmp/file-list
- }
-}
-
 Job {
-  Name = BUG_897
+  Name = "RUN_CONSOLE_CMD"
+  FileSet = FS_TESTJOB  
   JobDefs = DefaultJob
-  FileSet = FS_FIFO
-
   RunScript {
-    Command = "/bin/echo touching /tmp/RUN_BUG_897"
-    RunsWhen = after
-    RunsOnFailure = yes
-  }
-  RunScript {
-    Command = "/bin/touch /tmp/RUN_BUG_897"
-    RunsWhen = after
-    RunsOnFailure = yes
+    Console = "purge volume=TestVolume001 yes"
+    Console = "st dir"
+    RunsWhen = Before
+    failjobonerror = no
+    runsonclient = no
   }
 }
 
+Job { 
+  Name = "Restore" 
+  Type = Restore 
+  Client = @hostname@-fd 
+  FileSet = FS_TESTJOB
+  Storage = File
+  Messages = Standard
+  Pool = Default
+
+  RunScript  { 
+   RunsWhen = Before
+   RunsOnClient = Yes 
+   Command = "echo ClientBeforeRestore" 
+  } 
+
+  RunScript  { 
+   RunsOnFailure = No 
+   RunsWhen = After 
+   RunsOnClient = Yes 
+   Command = "echo ClientAfterRestore" 
+  } 
+
+  RunScript  { 
+   RunsWhen = Before
+   RunsOnClient = No
+   Command = "echo DirBeforeRestore" 
+  } 
+
+  RunScript  { 
+   RunsOnFailure = No 
+   RunsWhen = After 
+   RunsOnClient = Yes 
+   Command = "echo DirAfterRestore" 
+  } 
+} 
+
 # Client (File Services) to backup
 Client {
   Name = @hostname@-fd
   Address = @hostname@
-  FDPort = 8102
+  FDPort = @fdport@
   Catalog = MyCatalog
   Password = "xevrjURYoCHhn26RaJoWbeWXEY/a3VqGKp/37tgWiuHc"          # password for FileDaemon
   File Retention = 30d                # 30 days
@@ -192,7 +269,7 @@ Client {
 Storage {
   Name = File
   Address = @hostname@                # N.B. Use a fully qualified name here
-  SDPort = 8103
+  SDPort = @sdport@
   Password = "ccV3lVTsQRsdIUGyab0N4sMDavui2hOBkmpBU0aQKOr9"
   Device = FileStorage
   Media Type = File
@@ -202,13 +279,15 @@ Storage {
 # Generic catalog service
 Catalog {
   Name = MyCatalog
-  dbname = regress; user = regress; password = ""
+  @libdbi@
+  dbname = @db_name@; user = @db_user@; password = "@db_password@"
 }
 
 
 Messages {
   Name = Standard
   console = all, !skipped, !saved
+  catalog = all, !skipped
 }
 
 # Default pool definition