engine: resources: file: Add shell test for source field

This commit is contained in:
Jonathan Gold
2018-12-06 06:19:27 -05:00
committed by James Shubin
parent b902e2d30b
commit 56db31ca43
3 changed files with 32 additions and 0 deletions

22
test/shell/file-source.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash -e
# vim: noet:ts=8:sts=8:sw=8
set -x
if ! timeout 1s sudo -A true; then
echo "sudo disabled: not checking file owner and group"
exit
fi
# run till completion
$timeout --kill-after=30s 25s sudo -A "$MGMT" run --lang file-source.mcl --converged-timeout=5 --no-watch --tmp-prefix &
pid=$!
wait $pid # get exit status
e=$?
ls -l /tmp/mgmt
test -e /tmp/mgmt/file-source.txt
cmp --silent file-source.txt /tmp/mgmt/file-source.txt || exit 1
exit $e