Permalink
Browse files

30DaysOfTests: regenerate command

  • Loading branch information...
conradkdotcom committed Sep 13, 2017
1 parent e291085 commit 6aeb1e74990af61589807d272eb2a917040c98b1
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/test-command-regenerate.sh
@@ -0,0 +1,21 @@
#!/bin/bash
# create a new empty volume for tests
docker volume rm rooster >& /dev/null
docker volume create rooster >& /dev/null
# create the file
printf 'y\nxxxx\n' | docker run --rm -i -v rooster:/home/rooster rooster generate YouTube yt@example.com || exit 1
# get initial password
out1="`printf 'xxxx\n' | docker run --rm -i -v rooster:/home/rooster rooster get -s youtube 2>&1`"
# regenerate it
printf 'xxxx\n' | docker run --rm -i -v rooster:/home/rooster rooster regenerate YouTube || exit 1
# check that it has changed
out2="`printf 'xxxx\n' | docker run --rm -i -v rooster:/home/rooster rooster get -s youtube 2>&1`"
if [ "$out1" = "$out2" ]; then
exit 1
fi

0 comments on commit 6aeb1e7

Please sign in to comment.