svn commit: r315098 - head/usr.bin/xinstall/tests
Ngie Cooper
ngie at FreeBSD.org
Sun Mar 12 03:29:51 UTC 2017
Author: ngie
Date: Sun Mar 12 03:29:49 2017
New Revision: 315098
URL: https://svnweb.freebsd.org/changeset/base/315098
Log:
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
Modified:
head/usr.bin/xinstall/tests/install_test.sh
Modified: head/usr.bin/xinstall/tests/install_test.sh
==============================================================================
--- head/usr.bin/xinstall/tests/install_test.sh Sun Mar 12 03:29:23 2017 (r315097)
+++ head/usr.bin/xinstall/tests/install_test.sh Sun Mar 12 03:29:49 2017 (r315098)
@@ -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
More information about the svn-src-all
mailing list