resources: augeas: New resource

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto
2017-02-09 16:30:53 +01:00
parent f160db2032
commit bdb8368e89
9 changed files with 373 additions and 0 deletions

30
test/shell/augeas-1.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash -e
if env | grep -q -e '^TRAVIS=true$'; then
# inotify doesn't seem to work properly on travis
echo "Travis and Jenkins give wonky results here, skipping test!"
exit
fi
mkdir -p "${MGMT_TMPDIR}"
> "${MGMT_TMPDIR}"sshd_config
# run empty graph, with prometheus support
timeout --kill-after=20s 15s ./mgmt run --tmp-prefix --yaml=augeas-1.yaml &
pid=$!
sleep 5s # let it converge
grep "X11Forwarding no" "${MGMT_TMPDIR}"sshd_config
sed -i "s/no/yes/" "${MGMT_TMPDIR}"sshd_config
grep "X11Forwarding yes" "${MGMT_TMPDIR}"sshd_config
sleep 3 # Augeas is slow
grep "X11Forwarding no" "${MGMT_TMPDIR}"sshd_config
killall -SIGINT mgmt # send ^C to exit mgmt
wait $pid # get exit status
exit $?

11
test/shell/augeas-1.yaml Normal file
View File

@@ -0,0 +1,11 @@
---
graph: mygraph
resources:
augeas:
- name: sshd_test
lens: Sshd.lns
file: "/tmp/mgmt/sshd_config"
sets:
- path: X11Forwarding
value: no
edges: