From nobody Thu Jan 29 15:52:19 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f23Yc0zpJz6Qshb for ; Thu, 29 Jan 2026 15:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f23Yb66vVz46Tk for ; Thu, 29 Jan 2026 15:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769701939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yAgC/Rr9nktWGMfaR225HVeAnQzC6EXGwDoAy3vyFnc=; b=S9dpMOcdOdn7nyLAcza308Gecak8+X3PdQ4N8KG2DbSuMYrXlBkWWL4Scue5nX76A0qQHJ N2TM7+G4+WqYG7gtQggTS08PloIEj38awWcH3Cg0yBvLiJZDSn1RJhoQSNfNrQppdZTZXu KnVCEISZxjwVgzmksO2Iw4FXPtKJEClaYEIFTDgbXoWxHsWCDul8H81+KIawU5h+bzAdIs GXxKXbZVf2zreKNlyMYQVj9xDg9sjfUNbymNFBvT/RAHxlzZNnKLtxaF9FAtVqQ4HK2byu fpfov+26JEh4+r8S9AUmDRO+U0haydp/sKj1ltEA6D0xHipGm9i7UAihtMsm+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769701939; a=rsa-sha256; cv=none; b=rI50gbBkZfo3+Ejui97IoOwhQ9PFmxLVpBNoYAxtSg8tajaiXiNi9cK9573/H4EWceHBy+ JxRd00R8Y7C2/167ud++wRvftmWGuR/B9Q0LA14mCXRPMITSaWRA9oKYbtNQY9Ml2FjzYV l5/NIS7xaRk/BFGRkKlh5HAGkwey+EAPE34tRmdZBmj9vK87qQc4FLk3PEidlNo1djOkHA CjTcRPeDy/lxPnyGvLK0dDiMNg1YMqgb2/uSEs9SziR5CzCdDWyjqgP8kEhsfnpLaTgdDC ffYgTLQvkrUMI0jdtNJAebi3nRFqfUbeteVrg1+NMxledpwOmYqxZpoculmk5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769701939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yAgC/Rr9nktWGMfaR225HVeAnQzC6EXGwDoAy3vyFnc=; b=VvjyaWcA2yb4Itqene99y0guk3Tsg7F9f4M7oeyV5A3KOsbxu8u8+FCtcnfrQCGT7RVZ3G ZQFIPRHT/9VgLcvWlojrVzmLlUrTCMlMRshV7on26yT1TiyOljy0DYNWhlWGk6INbgw3vW GH4SbMa2khVX43rPhe8fXipu37AZ0FxzRl7ktVd1XZ6n/YYULN00ApwurzOq57K+539zI3 AZwQaYeEH6DvGaeynHYGK+8YQ5JgydoFP8SAVJ0saLe3jGNNS/53ndlxIFEkrslXFOj6Ma PmqUlcIC6X4JkTplviCIxG+3gNMcUxa09vWaxDW7Q09Z9/GyI0u/8cBtk96R1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f23Yb5gzPzlKY for ; Thu, 29 Jan 2026 15:52:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39cf3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Jan 2026 15:52:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: 21efed6cd844 - main - touch: Tests for -h flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21efed6cd8442ba9abb6c8a7e54a2433de9bfc60 Auto-Submitted: auto-generated Date: Thu, 29 Jan 2026 15:52:19 +0000 Message-Id: <697b8233.39cf3.5491e563@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=21efed6cd8442ba9abb6c8a7e54a2433de9bfc60 commit 21efed6cd8442ba9abb6c8a7e54a2433de9bfc60 Author: Aymeric Wibo AuthorDate: 2026-01-23 17:48:13 +0000 Commit: Aymeric Wibo CommitDate: 2026-01-29 15:49:28 +0000 touch: Tests for -h flag Reviewed by: kevans Approved by: kevans Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D54836 --- usr.bin/touch/tests/touch_test.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/usr.bin/touch/tests/touch_test.sh b/usr.bin/touch/tests/touch_test.sh index da39abef622e..619f81e0e7c3 100644 --- a/usr.bin/touch/tests/touch_test.sh +++ b/usr.bin/touch/tests/touch_test.sh @@ -144,6 +144,35 @@ touch_nocreate_body() atf_check -s exit:1 test -f bar } +atf_test_case touch_symlink_h_flag +touch_symlink_h_flag_head() +{ + atf_set descr "Update time of symlink but not file pointed to" +} +touch_symlink_h_flag_body() +{ + atf_check touch -t 200406151337 pointed + atf_check ln -s pointed symlink + atf_check touch -t 197209071337 -h symlink + atf_check_mtime 1087306620 pointed + atf_check_mtime 84721020 symlink +} + +atf_test_case touch_symlink_no_h_flag +touch_symlink_no_h_flag_head() +{ + atf_set descr "Update time of file pointed to but not symlink" +} +touch_symlink_no_h_flag_body() +{ + atf_check touch -t 200406151337 pointed + atf_check ln -s pointed symlink + local orig_mtime=$(stat -f %m symlink) + atf_check touch -t 197209071337 symlink + atf_check_mtime 84721020 pointed + atf_check_mtime $orig_mtime symlink +} + atf_init_test_cases() { atf_add_test_case touch_none @@ -153,5 +182,7 @@ atf_init_test_cases() atf_add_test_case touch_relative atf_add_test_case touch_copy atf_add_test_case touch_nocreate - # TODO: add test cases for -a, -h, -m + atf_add_test_case touch_symlink_h_flag + atf_add_test_case touch_symlink_no_h_flag + # TODO: add test cases for -a, -m }