mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-25 22:27:34 +00:00
Add base tests
This commit is contained in:
parent
bdebb6af32
commit
e99a0350fb
18
extras/test/00_create.sh
Normal file
18
extras/test/00_create.sh
Normal 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
|
24
extras/test/10_operations.sh
Normal file
24
extras/test/10_operations.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user