Skip to content

Commit

Permalink
Added unit tests for FeatherDuster commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Crowley authored and Daniel Crowley committed Apr 3, 2017
1 parent 8da7249 commit 1af1c3a
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/analyze.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo 'Testing FeatherDuster analyze command...'
python ./featherduster.py <<EOF
import manualentry
12345678
n
analyze
exit
EOF

10 changes: 10 additions & 0 deletions tests/export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo 'Testing FeatherDuster export command...'
python ./featherduster.py << EOF
import manualentry
gdkkn
use alpha_shift
run
export
/tmp/fd_output
EOF
grep hello /tmp/fd_output
10 changes: 10 additions & 0 deletions tests/import_clear.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo 'Testing import clear command...'
python featherduster.py <<EOF | grep -v badger
import manualentry
Badger badger badger badger badger badger badger badger badger badger badger
import manualentry
MUSHroom MUSHroom
import clear
samples
exit
EOF
6 changes: 6 additions & 0 deletions tests/import_manualentry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo 'Testing manual entry import command...'
python ./featherduster.py <<EOF | grep 'apple pen'
import manualentry
I have a pen, I have an apple, UH, apple pen
samples
EOF
6 changes: 6 additions & 0 deletions tests/import_multifile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo 'Testing multi-ciphertext file import...'
python ./featherduster.py << EOF | egrep "^'c7629149911e324e0322913e2e35c3b0fcea5180608a3f74cef73a010a6f71f49f346442f524a06578bfdfece04af86e8b8ad38bdb1cac4d6602fa4f2e'\$"
import multifile
examples/manytimepad.ciphertexts
samples
EOF
15 changes: 15 additions & 0 deletions tests/import_results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
echo 'Testing result import command...'
python ./featherduster.py <<EOF | egrep "^'hello'$"
import manualentry
Z2Rra24=
analyze
Y
use alpha_shift
run
import clear
import results
all
samples
exit
EOF

7 changes: 7 additions & 0 deletions tests/import_singlefile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
echo 'Testing single ciphertext file import command...'
python ./featherduster.py <<EOF | egrep "^'XUEGTZFZARLMOWPAQRNUPLQKWPRJABVURBFBAWYEEYPILJRZMPCJAPRXANSGZZZAPNTFOJLRIBNCLBGOWGABWJRXXVASZCAJEADVDMQGQRTBWKVVLRRETAPZSFWJEKUHIGWFPVPOTUESLTCNEOEUDIYHIETJDALYXRMPYTLYAVTDSMQGPCHBMMGYESTFCARBIEAMHWEJWNNEDEVZGUETHMEKMADJNIGKHOYXCQGORTTIPTRZXRRPQBUKGBRSPACURQIORIYVLNBFEQAZLRCJAPRXXRXU'$"
import singlefile
examples/vigenere.ciphertext
samples
exit
EOF
5 changes: 5 additions & 0 deletions tests/modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo 'Testing modules command...'
python ./featherduster.py <<EOF
modules
EOF

9 changes: 9 additions & 0 deletions tests/options.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo 'Testing options command...'
python ./featherduster.py <<EOF
options
use alpha_shift
options
use vigenere
options
exit
EOF
9 changes: 9 additions & 0 deletions tests/results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo 'Testing results command...'
python ./featherduster.py <<EOF | egrep "^0: 'hello' *$"
import manualentry
gdkkn
use alpha_shift
run
results
exit
EOF
12 changes: 12 additions & 0 deletions tests/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
echo 'Testing run command...'
python ./featherduster.py <<EOF
run
use alpha_shift
run
import manualentry
gdkkn
run
import clear
run
exit
EOF
10 changes: 10 additions & 0 deletions tests/samples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
echo 'Testing samples command...'
python ./featherduster.py <<EOF
samples
import manualentry
gdkkn
samples
import clear
samples
exit
EOF
7 changes: 7 additions & 0 deletions tests/search.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
echo 'Testing search command...'
python ./featherduster.py <<EOF
search alpha
search
search thisshouldneverreturnresultsmostlikely
exit
EOF
8 changes: 8 additions & 0 deletions tests/set.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo 'Testing set command...'
python ./featherduster.py <<EOF
set foo=bar
use alpha_shift
set foo=bar
use vigenere
set num_answers=3
EOF
9 changes: 9 additions & 0 deletions tests/unset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo 'Testing unset command...'
python ./featherduster.py <<EOF
unset
unset foo
use vigenere
set foo=bar
unset foo
exit
EOF
6 changes: 6 additions & 0 deletions tests/use.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo 'Testing use command...'
python ./featherduster.py <<EOF
use thisisnotarealmodule
use alpha_shift
exit
EOF

0 comments on commit 1af1c3a

Please sign in to comment.