Browse Source

fix tests

pull/1780/head
Ethan Buchman 9 years ago
parent
commit
aa3e87450a
2 changed files with 10 additions and 5 deletions
  1. +2
    -2
      tests/test_counter.sh
  2. +8
    -3
      tests/test_dummy.sh

+ 2
- 2
tests/test_counter.sh View File

@ -17,7 +17,7 @@ if [[ "$?" != 0 ]]; then
fi fi
sleep 1 sleep 1
OUTPUT=`(tmsp batch) <<STDIN
OUTPUT=`(tmsp-cli batch) <<STDIN
set_option serial on set_option serial on
get_hash get_hash
append_tx abc append_tx abc
@ -38,7 +38,7 @@ if [[ "${HASH1}" != "" ]]; then
exit 1 exit 1
fi fi
OUTPUT=`(tmsp batch) <<STDIN
OUTPUT=`(tmsp-cli batch) <<STDIN
set_option serial on set_option serial on
append_tx 0x00 append_tx 0x00
get_hash get_hash


+ 8
- 3
tests/test_dummy.sh View File

@ -5,7 +5,7 @@ echo "Dummy test ..."
dummy &> /dev/null & dummy &> /dev/null &
PID=`echo $!` PID=`echo $!`
sleep 1 sleep 1
RESULT_HASH=`tmsp get_hash`
RESULT_HASH=`tmsp-cli get_hash`
if [[ "$RESULT_HASH" != "" ]]; then if [[ "$RESULT_HASH" != "" ]]; then
echo "Expected nothing but got: $RESULT_HASH" echo "Expected nothing but got: $RESULT_HASH"
exit 1 exit 1
@ -16,7 +16,7 @@ echo ""
# Add a tx, get hash, commit, get hash # Add a tx, get hash, commit, get hash
# hashes should be non-empty and identical # hashes should be non-empty and identical
echo "Dummy batch test ..." echo "Dummy batch test ..."
OUTPUT=`(tmsp batch) <<STDIN
OUTPUT=`(tmsp-cli batch) <<STDIN
append_tx abc append_tx abc
get_hash get_hash
commit commit
@ -31,6 +31,11 @@ if [[ "$HASH1" == "" ]]; then
exit 1 exit 1
fi fi
if [[ "$HASH1" == "EOF" ]]; then
echo "Expected hash not broken connection!"
exit 1
fi
if [[ "$HASH1" != "$HASH2" ]]; then if [[ "$HASH1" != "$HASH2" ]]; then
echo "Expected hashes before and after commit to match: $HASH1, $HASH2" echo "Expected hashes before and after commit to match: $HASH1, $HASH2"
exit 1 exit 1
@ -40,7 +45,7 @@ echo ""
# Start a new connection and ensure the hash is the same # Start a new connection and ensure the hash is the same
echo "New connection test ..." echo "New connection test ..."
RESULT_HASH=`tmsp get_hash`
RESULT_HASH=`tmsp-cli get_hash`
if [[ "$HASH1" != "$RESULT_HASH" ]]; then if [[ "$HASH1" != "$RESULT_HASH" ]]; then
echo "Expected hash to persist as $HASH1 for new connection. Got $RESULT_HASH" echo "Expected hash to persist as $HASH1 for new connection. Got $RESULT_HASH"
exit 1 exit 1


Loading…
Cancel
Save