Clarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_body

Unfortunately kyua does not omit the path mismatch on failure, so it must be coded
into the error message.

Cache the values, run the test(1) call, then print out the values in an atf_fail
call to emit the required diagnostics to debug why things are failing.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
This commit is contained in:
ngie 2017-03-12 03:29:49 +00:00
parent b981f4299a
commit 697ff7954c

View File

@ -283,7 +283,11 @@ symbolic_link_absolute_body() {
atf_check install -l sa testf copyf
[ testf -ef copyf ] || atf_fail "not same file"
[ -L copyf ] || atf_fail "copy is not symlink"
[ "$(readlink copyf)" = "$(pwd -P)/testf" ] || atf_fail "unexpected symlink contents"
copyf_path=$(readlink copyf)
testf_path="$(pwd -P)/testf"
if [ "$copyf_path" != "$testf_path" ]; then
atf_fail "unexpected symlink ('$copyf_path' != '$testf_path')"
fi
}
atf_test_case symbolic_link_relative
@ -292,7 +296,11 @@ symbolic_link_relative_body() {
atf_check install -l sr testf copyf
[ testf -ef copyf ] || atf_fail "not same file"
[ -L copyf ] || atf_fail "copy is not symlink"
[ "$(readlink copyf)" = "testf" ] || atf_fail "unexpected symlink contents"
copyf_path=$(readlink copyf)
testf_path="testf"
if [ "$copyf_path" != "$testf_path" ]; then
atf_fail "unexpected symlink ('$copyf_path' != '$testf_path')"
fi
}
atf_test_case mkdir_simple