-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvironment-checking
More file actions
executable file
·37 lines (30 loc) · 990 Bytes
/
Copy pathenvironment-checking
File metadata and controls
executable file
·37 lines (30 loc) · 990 Bytes
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
#!/bin/bash
# this shows how you can reuse the reporting format for something other
# than hierarchy-based test execution - some test suites need an OS to be
# specially prepared and some environment variables exported, ie. PCI address
# of a network card to be passed via IOMMU to a VM
. /usr/share/ptef/builtins.bash
exec {PTEF_RESULTS_FD}>env-report.log
export PTEF_RESULTS_FD
for pkg in bash basesystem mpi-libs-extra pam; do
if rpm -q "$pkg" >/dev/null; then
ptef_report -r PASS "$pkg is installed"
else
ptef_report -r FAIL "$pkg is installed"
fi
done
if [ -z "$INSTALL_DIR" ]; then
echo
echo "Cannot install the built binaries used during suite execution."
echo "Please follow README and export INSTALL_DIR appropriately."
ptef_report -r FAIL "INSTALL_DIR is exported"
else
ptef_report -r PASS "INSTALL_DIR is exported"
fi
exec {PTEF_RESULTS_FD}>&-
if grep -q '^FAIL' env-report.log; then
echo
echo "Some environment checks failed. See README."
exit 1
fi
exit 0