test: file: test the behaviour of inotify on parent dir moves

This is a test for #124. It is disabled until #124 is fixed, so it can
already me merged.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto
2017-02-09 14:17:52 +01:00
parent de1810ba68
commit 72873abe05
2 changed files with 40 additions and 0 deletions

9
examples/deep-dirs.yaml Normal file
View File

@@ -0,0 +1,9 @@
---
graph: mygraph
resources:
file:
- name: file1
path: "/tmp/mgmt/a/b/c/f1"
content: |
i am f1
state: exists

View File

@@ -0,0 +1,31 @@
#!/bin/bash -e
# FIXME: test for #124 --- Disabled for now
exit 0
mkdir -p /tmp/mgmt/a/b/c/
# run empty graph, with prometheus support
timeout --kill-after=20s 15s ./mgmt run --tmp-prefix --yaml=examples/deep-dirs.yaml &
pid=$!
sleep 5s # let it converge
grep f1 /tmp/mgmt/a/b/c/f1
echo 'f2!' > /tmp/mgmt/a/b/c/f1
grep f1 /tmp/mgmt/a/b/c/f1
rm -rf /tmp/mgmt/a/b/C/ || true
mv /tmp/mgmt/a/b/c /tmp/mgmt/a/b/C/
mkdir -p /tmp/mgmt/a/b/c
echo 'f2!' > /tmp/mgmt/a/b/c/f1
grep f1 /tmp/mgmt/a/b/c/f1
killall -SIGINT mgmt # send ^C to exit mgmt
wait $pid # get exit status
exit $?