commit: 56a94bdfc264dfc1fe7bdd3f1913184fbfced974
parent b1bc1ccb2f435f3b054f0bcfb0552b49b5f2ac8d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 18 Sep 2024 04:12:13 +0200
test-cmd/touch: set datetime instead of sleeping
Diffstat:
1 file changed, 16 insertions(+), 32 deletions(-)
diff --git a/test-cmd/touch b/test-cmd/touch
@@ -4,10 +4,8 @@
atf_test_case noargs
noargs_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"
@@ -18,10 +16,8 @@ noargs_body() {
atf_test_case ref_noargs
ref_noargs_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"
@@ -34,10 +30,8 @@ ref_noargs_body() {
atf_test_case mtime
mtime_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"
@@ -48,10 +42,8 @@ mtime_body() {
atf_test_case ref_mtime
ref_mtime_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"
@@ -64,10 +56,8 @@ ref_mtime_body() {
atf_test_case atime
atime_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"
@@ -78,10 +68,8 @@ atime_body() {
atf_test_case ref_atime
ref_atime_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"
@@ -94,10 +82,8 @@ ref_atime_body() {
atf_test_case amtime
amtime_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"
@@ -108,10 +94,8 @@ amtime_body() {
atf_test_case ref_amtime
ref_amtime_body() {
- atf_check touch -a ./foo
- maybe_sleep
- atf_check touch -m ./foo
- maybe_sleep
+ atf_check touch -a -d 2007-11-12T10:15:30Z ./foo
+ atf_check touch -m -d 2007-11-12T10:15:30Z ./foo
atime="$(./stat_atime ./foo)"
mtime="$(./stat_mtime ./foo)"