Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple test to validate -H break reported in #702 #703

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

rosorio
Copy link
Contributor

@rosorio rosorio commented Jan 15, 2025

@ncopa
Copy link
Contributor

ncopa commented Jan 15, 2025

The test appears to fail also on v3.3.0:

ncopa-desktop:~/src/rsync ((no branch, bisect started on master))$ whichtests=preserve-symlink.test ./runtests.sh
============================================================
./runtests.sh running in /home/ncopa/src/rsync
    rsync_bin=/home/ncopa/src/rsync/rsync 
    srcdir=/home/ncopa/src/rsync
    TLS_ARGS= -l -L
    testuser=ncopa
    os=Linux ncopa-desktop 6.12.9-0-lts #1-Alpine SMP PREEMPT_DYNAMIC 2025-01-09 15:42:50 x86_64 GNU/Linux
    preserve_scratch=no
    scratchbase=/home/ncopa/src/rsync/testtmp
----- preserve-symlink log follows
Testing for symlinks using 'test -h'
        makepath /home/ncopa/src/rsync/testtmp/preserve-symlink/from/sym
        makepath /home/ncopa/src/rsync/testtmp/preserve-symlink/to
Running: "/home/ncopa/src/rsync/rsync  -aH '/home/ncopa/src/rsync/testtmp/preserve-symlink/from/sym' '/home/ncopa/src/rsync/testtmp/preserve-symlink/to'"
-------------
check how the directory listings compare with diff:

--- /home/ncopa/src/rsync/testtmp/preserve-symlink/ls-from	2025-01-15 11:28:02.499318382 +0100
+++ /home/ncopa/src/rsync/testtmp/preserve-symlink/ls-to	2025-01-15 11:28:02.512652013 +0100
@@ -346,9 +346,10 @@
 drwxr-xr-x               0   1000.1000        4 2025-01-15 10:28:02 ./testtmp/preserve-symlink
 drwxr-xr-x               0   1000.1000        3 2025-01-15 10:28:02 ./testtmp/preserve-symlink/from
 drwxr-xr-x               0   1000.1000        2 2025-01-15 10:28:02 ./testtmp/preserve-symlink/from/sym
--rw-r--r--          28,932   1000.1000        1 2025-01-15 10:28:02 ./testtmp/preserve-symlink/ls-from
+-rw-r--r--          35,672   1000.1000        1 2025-01-15 10:28:02 ./testtmp/preserve-symlink/ls-from
+-rw-r--r--          29,969   1000.1000        1 2025-01-15 10:28:02 ./testtmp/preserve-symlink/ls-to
 l---------               0   1000.1000        1 2025-01-15 10:28:02 ./testtmp/preserve-symlink/src -> /home/ncopa/src/rsync
--rw-r--r--             331   1000.1000        1 2025-01-15 10:28:02 ./testtmp/preserve-symlink/test.log
+-rw-r--r--             398   1000.1000        1 2025-01-15 10:28:02 ./testtmp/preserve-symlink/test.log
 drwxr-xr-x               0   1000.1000        3 2025-01-15 10:28:02 ./testtmp/preserve-symlink/to
 drwxr-xr-x               0   1000.1000        2 2025-01-15 10:28:02 ./testtmp/preserve-symlink/to/sym
 -rwxr-xr-x          91,072   1000.1000        1 2025-01-15 09:29:59 ./tls
-------------
check how the files compare with diff:

diff: : No such file or directory
diff: : No such file or directory
-------------
Failed:  dir-diff file-diff
----- preserve-symlink log ends
FAIL    preserve-symlink
------------------------------------------------------------
----- overall results:
      0 passed
      1 failed
------------------------------------------------------------
overall result is 1


. "$suitedir/rsync.fns"

makepath "$fromdir/sym" "$todir"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
makepath "$fromdir/sym" "$todir"
makepath "$fromdir/sym" "$todir" "$fromdir" "$todir"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ncopa
Copy link
Contributor

ncopa commented Jan 15, 2025

I think the name of this test is misleading.

--hard-links, -H         preserve hard links

Maybe the test could be added to testsuite/hardlinks.test?

@rosorio
Copy link
Contributor Author

rosorio commented Jan 15, 2025

Move the test inside hardlink.test, but I can't easily test under FreeBSD, popt has to be first unbroken.
This will be my future task :p
Can you test it for me ?

@ncopa
Copy link
Contributor

ncopa commented Jan 15, 2025

It correctly triggers the error:

https://github.com/RsyncProject/rsync/actions/runs/12791679571/job/35660352351?pr=703#step:8:4163

But does not pass with the fix:

Running: "/home/ncopa/src/rsync/rsync  -aH '/home/ncopa/src/rsync/testtmp/hardlinks/from/sym' '/home/ncopa/src/rsync/testtmp/hardlinks/to'"
-------------
check how the directory listings compare with diff:

--- /home/ncopa/src/rsync/testtmp/hardlinks/ls-from	2025-01-15 16:46:04.448514957 +0100
+++ /home/ncopa/src/rsync/testtmp/hardlinks/ls-to	2025-01-15 16:46:04.488515847 +0100
@@ -2961,11 +2961,11 @@
 -rw-r--r--               0   1000.1000        1 2025-01-15 15:46:03 ./testtmp/hardlinks/from/subdir/zz
 drwxr-xr-x               0   1000.1000        2 2025-01-15 15:46:04 ./testtmp/hardlinks/from/sym
 -rw-r--r--       1,006,013   1000.1000        1 2025-01-15 15:46:03 ./testtmp/hardlinks/from/text
--rw-r--r--         297,311   1000.1000        1 2025-01-15 15:46:04 ./testtmp/hardlinks/ls-from
--rw-r--r--         104,471   1000.1000        1 2025-01-15 15:46:04 ./testtmp/hardlinks/ls-to
+-rw-r--r--         304,865   1000.1000        1 2025-01-15 15:46:04 ./testtmp/hardlinks/ls-from
+-rw-r--r--         297,311   1000.1000        1 2025-01-15 15:46:04 ./testtmp/hardlinks/ls-to
 -rw-r--r--             783   1000.1000        1 2025-01-15 15:46:04 ./testtmp/hardlinks/rsync.out
 l---------               0   1000.1000        1 2025-01-15 15:46:03 ./testtmp/hardlinks/src -> /home/ncopa/src/rsync
--rw-r--r--          94,260   1000.1000        1 2025-01-15 15:46:04 ./testtmp/hardlinks/test.log
+-rw-r--r--          94,327   1000.1000        1 2025-01-15 15:46:04 ./testtmp/hardlinks/test.log
 drwxr-xr-x               0   1000.1000        3 2025-01-15 15:46:04 ./testtmp/hardlinks/to
 -rw-r--r--              17   1000.1000        1 2025-01-15 15:46:03 ./testtmp/hardlinks/to/name1
 drwxr-xr-x               0   1000.1000        2 2025-01-15 15:46:04 ./testtmp/hardlinks/to/sym
-------------
check how the files compare with diff:

diff: : No such file or directory
diff: : No such file or directory
-------------
Failed:  dir-diff file-diff
----- hardlinks log ends
FAIL    hardlinks
------------------------------------------------------------
----- overall results:
      0 passed
      1 failed
------------------------------------------------------------
overall result is 1

@ncopa
Copy link
Contributor

ncopa commented Jan 15, 2025

Try this:

diff --git a/testsuite/hardlinks.test b/testsuite/hardlinks.test
index 7e5219d3..299be24e 100644
--- a/testsuite/hardlinks.test
+++ b/testsuite/hardlinks.test
@@ -79,8 +79,9 @@ diff $diffopt "$name1" "$todir" || test_fail "solo copy of name1 failed"
 
 # Make sure there's nothing wrong with sending a single directory with -H
 # enabled (this has broken in 3.4.0 so far, so we need this test).
-makepath "$fromdir/sym" "$todir" "$fromdir" "$todir"
-checkit "$RSYNC -aH '$fromdir/sym' '$todir'"
+rm -rf "$fromdir" "$todir"
+makepath "$fromdir/sym" "$todir"
+checkit "$RSYNC -aH '$fromdir/sym' '$todir'" "$fromdir" "$todir"
 
 # The script would have aborted on error, so getting here means we've won.
 exit 0

@ncopa
Copy link
Contributor

ncopa commented Jan 15, 2025

Works! 👍

Ensure this still working after 3.4.0 breakage

RsyncProject#702
@tridge
Copy link
Member

tridge commented Jan 15, 2025

rebased this PR after the fix from @ncopa

@tridge tridge merged commit dc34990 into RsyncProject:master Jan 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants