Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ebiggers committed Nov 7, 2020
1 parent abd8756 commit 437f88d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ run_test()
echo 1>&2 "FAILED: $t [exited with failure status $status]"
if [ -s "$t.out.actual" ]; then
if (( $(wc -l "$t.out.actual" | cut -f1 -d' ') > 10 )); then
echo 1>&2 "Last 10 lines of test output:"
tail -n10 "$t.out.actual" | sed 1>&2 's/^/ /'
echo 1>&2 "Last 500 lines of test output:"
tail -n500 "$t.out.actual" | sed 1>&2 's/^/ /'
echo 1>&2
echo 1>&2 "See $t.out.actual for the full output."
else
Expand Down
5 changes: 5 additions & 0 deletions cli-tests/t_change_passphrase.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ mkdir: cannot create directory 'MNT/dir/subdir': Required key not available

# Unlock with new passphrase

# Debug
/dev/pts/0
spawn readlink /proc/self/fd/0
/dev/pts/1

# Try to change passphrase (interactively, mismatch)
spawn fscrypt metadata change-passphrase --protector=MNT:desc1
Enter old custom passphrase for protector "prot":
Expand Down
7 changes: 7 additions & 0 deletions cli-tests/t_change_passphrase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ echo pass2 | fscrypt unlock --quiet "$dir"
mkdir "$dir/subdir"
rmdir "$dir/subdir"

_print_header "Debug"
readlink /proc/self/fd/0
expect << EOF
spawn readlink /proc/self/fd/0
expect eof
EOF

_print_header "Try to change passphrase (interactively, mismatch)"
expect << EOF
spawn fscrypt metadata change-passphrase --protector=$MNT:$protector
Expand Down

0 comments on commit 437f88d

Please sign in to comment.