Browse Source

Print logs if failing tests

master
ViViDboarder 2 months ago
parent
commit
f153d3d638
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      tests/test.sh

+ 7
- 7
tests/test.sh View File

@@ -22,10 +22,10 @@ else
22 22
     mkdir -p /data && echo Test > /data/test.txt
23 23
 
24 24
     echo "Making backup..."
25
-    /cron-exec.sh /backup.sh
25
+    /cron-exec.sh /backup.sh || { cat /cron.log && exit 1; }
26 26
 
27 27
     echo "Verify backup..."
28
-    /cron-exec.sh /verify.sh
28
+    /cron-exec.sh /verify.sh || { cat /cron.log && exit 1; }
29 29
 
30 30
     echo "Delete test data..."
31 31
     rm -fr /data/*
@@ -34,15 +34,15 @@ else
34 34
     test -f /data/test.txt && exit 1 || echo "Gone"
35 35
 
36 36
     echo "Restore backup..."
37
-    /cron-exec.sh /restore.sh
38
-    /healthcheck.sh
37
+    /cron-exec.sh /restore.sh || { cat /cron.log && exit 1; }
38
+    /healthcheck.sh || { cat /cron.log && exit 1; }
39 39
 
40 40
     echo "Verify restore..."
41 41
     test -f /data/test.txt
42 42
     cat /data/test.txt
43 43
 
44 44
     echo "Verify backup..."
45
-    /verify.sh
45
+    /cron-exec.sh /verify.sh || { cat /cron.log && exit 1; }
46 46
 
47 47
     echo "Delete test data again..."
48 48
     rm -fr /data/*
@@ -51,8 +51,8 @@ else
51 51
     test -f /data/test.txt && exit 1 || echo "Gone"
52 52
 
53 53
     echo "Simulate a restart with RESTORE_ON_EMPTY_START..."
54
-    RESTORE_ON_EMPTY_START=true /start.sh
55
-    /healthcheck.sh
54
+    RESTORE_ON_EMPTY_START=true /start.sh || { cat /cron.log && exit 1; }
55
+    /healthcheck.sh || { cat /cron.log && exit 1; }
56 56
 
57 57
     echo "Verify restore happened..."
58 58
     test -f /data/test.txt

Loading…
Cancel
Save