2021-04-18 10:06:04 -04:00
|
|
|
#!/usr/bin/expect
|
|
|
|
|
|
|
|
source ./test.exp
|
|
|
|
|
|
|
|
set passphrase "asdasd"
|
|
|
|
set secret "foo\nbar"
|
|
|
|
|
|
|
|
test_label "Should backup secret using 2-of-3 Shamir Secret Sharing"
|
|
|
|
|
|
|
|
source ./tests/helpers/shamir-2-of-3-backup.exp
|
|
|
|
|
|
|
|
test_ok
|
|
|
|
|
|
|
|
test_label "Should restore secret using 2-of-3 Shamir Secret Sharing"
|
|
|
|
|
|
|
|
source ./tests/helpers/shamir-2-of-3-restore.exp
|
|
|
|
|
2021-04-19 13:43:55 -04:00
|
|
|
regsub -all {\033\[[0-9]*m(\017)?} $restored_secret {} restored_secret
|
2021-04-18 10:06:04 -04:00
|
|
|
regsub -all {\r} $restored_secret {} restored_secret
|
|
|
|
|
|
|
|
if { "$restored_secret" != "$secret" } {
|
|
|
|
test_failed
|
|
|
|
} else {
|
|
|
|
test_ok
|
|
|
|
}
|