Skip to content

Commit

Permalink
30DaysOfTests: rooster file created on first run
Browse files Browse the repository at this point in the history
  • Loading branch information
conradkleinespel committed Sep 1, 2017
1 parent 4ec0179 commit 0b37881
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test-setup.sh
@@ -0,0 +1,16 @@
#!/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 'y\nxxxx\n' | docker run --rm -i -v rooster:/home/rooster rooster list || exit 1

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

# test that file need not be recreated on a new run
printf 'xxxx\n' | docker run --rm -i -v rooster:/home/rooster rooster list || exit 3

0 comments on commit 0b37881

Please sign in to comment.