Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Mar 2017 03:29:49 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315098 - head/usr.bin/xinstall/tests
Message-ID:  <201703120329.v2C3TnKO016829@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703120329.v2C3TnKO016829>