Skip to content

Commit

Permalink
30DaysOfTests: rooster file is not created if not wanted
Browse files Browse the repository at this point in the history
  • Loading branch information
conradkleinespel committed Sep 1, 2017
1 parent 04789c8 commit 4ec0179
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test-setup-no-file.sh
@@ -0,0 +1,15 @@
#!/bin/bash

# create a new empty volume for tests
docker volume rm rooster >& /dev/null
docker volume create rooster >& /dev/null

# don't create the file
printf 'n\n' | docker run --rm -i -v rooster:/home/rooster \
rooster list >& /dev/null
# rooster should return an error code
test "$?" = 1 || exit 1

# test that the file is not there
docker run --rm -v rooster:/data --entrypoint /bin/sh \
busybox -c 'test "`ls -a1 /data | grep .passwords.rooster | wc -l`" = 0' || exit 2

0 comments on commit 4ec0179

Please sign in to comment.