Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jul 2017 15:58:23 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r320680 - in stable/11: bin/ln bin/ln/tests etc/mtree
Message-ID:  <201707051558.v65FwNRp076970@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Wed Jul  5 15:58:23 2017
New Revision: 320680
URL: https://svnweb.freebsd.org/changeset/base/320680

Log:
  MFC r319714, r319854
  
  r319714:
  Add tests for ln(1)
  
  * Verify that when creating a hard link to a symbolic link, '-L' option
    creates a hard link to the target of the symbolic link
  * Verify that when creating a hard link to a symbolic link, '-P' option
    creates a hard link to the symbolic link itself
  * Verify that if the target file already exists, '-f' option unlinks it so
    that link may occur
  * Verify that if the target file or directory is a symbolic link, '-shf'
    option prevents following the link
  * Verify that if the target file or directory is a symbolic link, '-snf'
    option prevents following the link
  * Verify that '-s' option creates a symbolic link
  * Verify that '-w' option produces a warning if the source of a symbolic
    link does not currently exist
  
  Submitted by:	shivansh
  Reviewed by:	asomers, ngie
  Sponsored by:	Google, Inc (GSoC 2017)
  Differential Revision:	https://reviews.freebsd.org/D11084
  
  r319854:
  bin/ln: Set umask appropriately before creating files for testing
  
  These changes were missed in D11084
  
  Submitted by:	shivansh
  Reviewed by:	asomers
  X-MFC-With:	319714
  Sponsored by:	Google, Inc (GSoC 2017)
  Differential Revision:	https://reviews.freebsd.org/D11158

Added:
  stable/11/bin/ln/tests/
     - copied from r319714, head/bin/ln/tests/
Modified:
  stable/11/bin/ln/Makefile
  stable/11/bin/ln/tests/ln_test.sh
  stable/11/etc/mtree/BSD.tests.dist
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/ln/Makefile
==============================================================================
--- stable/11/bin/ln/Makefile	Wed Jul  5 15:50:41 2017	(r320679)
+++ stable/11/bin/ln/Makefile	Wed Jul  5 15:58:23 2017	(r320680)
@@ -1,11 +1,17 @@
 #	@(#)Makefile	8.2 (Berkeley) 5/31/93
 # $FreeBSD$
 
+.include <src.opts.mk>
+
 PACKAGE=runtime
 PROG=	ln
 MAN=	ln.1 symlink.7
 
 LINKS=	${BINDIR}/ln ${BINDIR}/link
 MLINKS=	ln.1 link.1
+
+.if ${MK_TESTS} != "no"
+SUBDIR+= 	tests
+.endif
 
 .include <bsd.prog.mk>

Modified: stable/11/bin/ln/tests/ln_test.sh
==============================================================================
--- head/bin/ln/tests/ln_test.sh	Thu Jun  8 19:09:55 2017	(r319714)
+++ stable/11/bin/ln/tests/ln_test.sh	Wed Jul  5 15:58:23 2017	(r320680)
@@ -98,6 +98,7 @@ target_exists_hard_head()
 
 target_exists_hard_body()
 {
+        set_umask
         atf_check touch A B
         atf_check -s exit:1 -e inline:'ln: B: File exists\n' \
                 ln A B
@@ -112,6 +113,7 @@ target_exists_symbolic_head()
 
 target_exists_symbolic_body()
 {
+        set_umask
         atf_check touch A B
         atf_check -s exit:1 -e inline:'ln: B: File exists\n' \
                 ln -s A B
@@ -155,6 +157,7 @@ sf_flag_head()
 
 sf_flag_body()
 {
+        set_umask
         atf_check touch A B
         atf_check ln -sf A B
         atf_check -o inline:'B: symbolic link to A\n' file B

Modified: stable/11/etc/mtree/BSD.tests.dist
==============================================================================
--- stable/11/etc/mtree/BSD.tests.dist	Wed Jul  5 15:50:41 2017	(r320679)
+++ stable/11/etc/mtree/BSD.tests.dist	Wed Jul  5 15:58:23 2017	(r320680)
@@ -16,6 +16,8 @@
         ..
         expr
         ..
+        ln
+        ..
         ls
         ..
         mv



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