Add base tests

This commit is contained in:
Alexandre Pujol 2017-05-01 21:11:28 +01:00
parent bdebb6af32
commit e99a0350fb
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
2 changed files with 42 additions and 0 deletions

18
extras/test/00_create.sh Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env zsh
export test_description="Testing tomb creation"
source ./setup
test_cleanup
test_export "test"
test_expect_success 'Testing tomb creation: dig, forge and lock' '
tt_dig -s 20 &&
tt_forge --tomb-pwd $DUMMYPASS &&
print $DUMMYPASS \
| gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key \
| hexdump -C &&
tt_lock --tomb-pwd $DUMMYPASS
'
test_done

View File

@ -0,0 +1,24 @@
#!/usr/bin/env zsh
export test_description="Testing common operations on tomb"
source ./setup
test_export "test" # Using already generated tomb
test_expect_success 'Testing open with wrong password ' '
test_must_fail tt_open --tomb-pwd wrongpassword
'
test_expect_success 'Testing open with good password ' '
tt_open --tomb-pwd $DUMMYPASS &&
tt_close
'
test_expect_success 'Testing open in read only mode' '
chmod -w $tomb &&
tt_open --tomb-pwd $DUMMYPASS -o ro,noatime,nodev &&
tt_close &&
chmod +w $tomb
'
test_done