]>
git.proxmox.com Git - swtpm.git/blob - tests/test_swtpm_setup_misc
3 # For the license, see the LICENSE file in the root directory.
5 if [ "$(id -u)" -eq 0 ]; then
6 echo "Not running this test as root."
10 ROOT
=${abs_top_builddir:-$(dirname "$0")/..}
11 TESTDIR
=${abs_top_testdir:-$(dirname "$0")}
12 SRCDIR
=${abs_top_srcdir:-$(dirname "$0")/..}
14 source ${TESTDIR}/common
16 trap "cleanup" SIGTERM EXIT
23 workdir
="$(mktemp -d)" ||
exit 1
25 FILES
="swtpm-localca.conf swtpm-localca.options swtpm_setup.conf"
27 XDG_CONFIG_HOME
="${workdir}" ${SWTPM_SETUP} \
28 --create-config-files 1>/dev
/null
31 echo "Error: Could not created config files (without parameters)"
35 if ! [ -f "${workdir}/${f}" ]; then
36 echo "Error: File ${workedir}/${f} was not created"
40 if ! [ -d "${workdir}/var/lib/swtpm-localca" ]; then
41 echo "Error: Directory var/lib/swtpm-localca was not created"
45 XDG_CONFIG_HOME
="${workdir}" ${SWTPM_SETUP} \
46 --create-config-files skip-if-exist
1>/dev
/null
49 echo "Error: skip-if-exists should have exit'ed with 0."
56 workdir
="$(mktemp -d)" ||
exit 1
58 XDG_CONFIG_HOME
="${workdir}" ${SWTPM_SETUP} \
59 --create-config-files skip-if-exist
1>/dev
/null
62 echo "Error: skip-if-exists should have exit'ed with 0."
66 if ! [ -f "${workdir}/${f}" ]; then
67 echo "Error: File ${workedir}/${f} was not created"
71 if ! [ -d "${workdir}/var/lib/swtpm-localca" ]; then
72 echo "Error: Directory var/lib/swtpm-localca was not created"