engine: resources: file: Add shell test for source field
This commit is contained in:
committed by
James Shubin
parent
b902e2d30b
commit
56db31ca43
4
test/shell/file-source.mcl
Normal file
4
test/shell/file-source.mcl
Normal file
@@ -0,0 +1,4 @@
|
||||
file "/tmp/mgmt/file-source.txt" {
|
||||
source => "file-source.txt",
|
||||
state => "exists",
|
||||
}
|
||||
22
test/shell/file-source.sh
Executable file
22
test/shell/file-source.sh
Executable 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
|
||||
6
test/shell/file-source.txt
Normal file
6
test/shell/file-source.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
|
||||
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
|
||||
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
|
||||
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
||||
culpa qui officia deserunt mollit anim id est laborum.
|
||||
Reference in New Issue
Block a user