resources: file: Implement file attributes
Add owner which must be username or uid of the file owner, group which is the group name or gid of the file, and mode which is the octal unix file permissions. Add separate implementation for Go 1.6 and lower.
This commit is contained in:
committed by
James Shubin
parent
b9976cf693
commit
8c2c552164
19
test/shell/file-mode.sh
Executable file
19
test/shell/file-mode.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
set -x
|
||||
|
||||
# run till completion
|
||||
timeout --kill-after=20s 15s ./mgmt run --yaml file-mode.yaml --converged-timeout=5 --no-watch --tmp-prefix &
|
||||
pid=$!
|
||||
wait $pid # get exit status
|
||||
e=$?
|
||||
|
||||
ls -l /tmp/mgmt
|
||||
|
||||
test -e /tmp/mgmt/f1
|
||||
test -e /tmp/mgmt/f2
|
||||
test -e /tmp/mgmt/f3
|
||||
test $(stat -c%a /tmp/mgmt/f2) = 741
|
||||
test $(stat -c%a /tmp/mgmt/f3) = 614
|
||||
|
||||
exit $e
|
||||
Reference in New Issue
Block a user