File: 0004-tests.sh-skip-tests-exec-fds-tests-exec-simple-if-HOM.diff

package info (click to toggle)
bcron 0.11-19
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 760 kB
  • sloc: sh: 3,138; ansic: 2,416; makefile: 32
file content (54 lines) | stat: -rw-r--r-- 1,145 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: Gerrit Pape <pape@smarden.org>
Date: Mon, 11 Aug 2014 19:05:49 +0000
Subject: [PATCH] tests.sh: skip tests/exec-fds,
 tests/exec-simple if $HOME does not exist

This fixes FTBFS on Debian autobuilders, which run the package build
process as user with non-existng home directory /sbuild-nonexistent.

E.g.:
https://buildd.debian.org/status/fetch.php?pkg=bcron&arch=amd64&ver=0.10-1&stamp=1407686613
---
 tests.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests.sh b/tests.sh
index c4f3990..54e63d6 100644
--- a/tests.sh
+++ b/tests.sh
@@ -557,6 +557,8 @@ END_OF_TEST_RESULTS
 
 ##### Test tests/exec-fds #####
 
+if test -d "$HOME"; then
+
 runtest() {
 echo 'exec 2>/dev/null' >$tmp/echo-all.sh
 fd=4
@@ -597,6 +599,8 @@ Subject: Cron <USER@HOST> sleep 1; echo all done
 all done
 END_OF_TEST_RESULTS
 
+fi
+
 
 ##### Test tests/sched-dump #####
 
@@ -636,6 +640,8 @@ END_OF_TEST_RESULTS
 
 ##### Test tests/exec-simple #####
 
+if test -d "$HOME"; then
+
 runtest() {
 doexec 'echo yes'
 }
@@ -651,6 +657,8 @@ Subject: Cron <USER@HOST> echo yes
 yes
 END_OF_TEST_RESULTS
 
+fi
+
 
 ##### Test tests/spool-submit #####