File: test-m_f_j

package info (click to toggle)
systemd-cron 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 636 kB
  • sloc: cpp: 2,599; sh: 962; makefile: 239; ansic: 133
file content (26 lines) | stat: -rwxr-xr-x 563 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
#!/bin/sh
# needs to run as root of a UTS namespace to set hostname
# uses fake "systemctl"/"sendmail" programs to validate the output
set -u
M_F_J="${M_F_J:-"$PWD/out/build/bin/mail_for_job"}"
trap 'rm -rf "$tmpdir"' EXIT INT
tmpdir="$(mktemp -d)/"

if [ $# -eq 0 ]
then
    read -r V < VERSION
else
    V="$1"
fi

cd test/m_f_j || exit
hostname tarta

PATH=".:$PATH"
err=0
for f in *.service; do
    of="${f%.service}.output"
    sed "s#@VERSION@#${V}#" < "$of" > "${tmpdir}$of"
    "$M_F_J" "$f":verbose 2>&1 | diff -u "${tmpdir}$of" - || err=1
done
exit $err