| 1 | #!/usr/bin/env python3 |
| 2 | # Python rewrite of testsuite/daemon-gzip-download.test. |
| 3 | # |
| 4 | # Download a file tree over a compressed connection from a test daemon. |
| 5 | # Exercises (exorcises?) a bug in 2.5.3 that mis-handled doubly-compressed |
| 6 | # transfers. Uses the secure stdio-pipe transport by default; --use-tcp |
| 7 | # runs it against a real loopback rsyncd. |
| 8 | |
| 9 | from rsyncfns import ( |
| 10 | CHKDIR, FROMDIR, TODIR, |
| 11 | build_rsyncd_conf, checkit, hands_setup, run_rsync, start_test_daemon, |
| 12 | ) |
| 13 | |
| 14 | |
| 15 | DAEMON_PORT = 12879 |
| 16 | |
| 17 | conf = build_rsyncd_conf() |
| 18 | hands_setup() |
| 19 | |
| 20 | # chkdir: vanilla copy minus the daemon's global "foobar.baz" exclude. |
| 21 | run_rsync('-av', '--exclude=foobar.baz', f'{FROMDIR}/', f'{CHKDIR}/') |
| 22 | |
| 23 | url = start_test_daemon(conf, DAEMON_PORT) |
| 24 | |
| 25 | checkit( |
| 26 | ['-avvvvzz', f'{url}test-from/', f'{TODIR}/'], |
| 27 | CHKDIR, TODIR, |
| 28 | allowed_codes=(0, 23), |
| 29 | ) |