From f1e0627abe084fea45057f4db62bf7227d7af7ee Mon Sep 17 00:00:00 2001 From: TJ Saunders Date: Thu, 28 May 2026 13:26:12 -0700 Subject: [PATCH] Get our regression tests running regularly via a GitHub workflow. --- .github/workflows/ci.yml | 27 ----- .github/workflows/regressions.yml | 99 ++++++++++++++++ t/lib/ProFTPD/Tests/Modules/mod_vroot/sftp.pm | 110 +++++++++--------- tests.pl | 2 +- 4 files changed, 155 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/regressions.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76af13a..9674fff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,24 +104,6 @@ jobs: # for OpenSSL support apt-get install -y libssl-dev - # for integration/regression test - apt-get install -y \ - libcompress-raw-zlib-perl \ - libdata-dumper-simple-perl \ - libdatetime-perl \ - libfile-copy-recursive-perl \ - libfile-path-tiny-perl \ - libfile-spec-native-perl \ - libnet-inet6glue-perl \ - libnet-ssh2-perl \ - libnet-ssleay-perl \ - libnet-telnet-perl \ - libposix-2008-perl \ - libtest-unit-perl \ - libtime-hr-perl \ - libwww-perl - PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'install Net::FTPSSL' - # for test code coverage apt-get install -y lcov ruby gem install coveralls-lcov @@ -160,15 +142,6 @@ jobs: cd proftpd make install - - name: Run integration tests - if: ${{ matrix.compiler == 'gcc' && matrix.container == 'ubuntu:22.04' }} - env: - PROFTPD_TEST_BIN: /usr/local/sbin/proftpd - PROFTPD_TEST_DIR: ${{ github.workspace }}/proftpd - run: | - cd proftpd/contrib/mod_vroot - perl tests.pl - - name: Build as shared module env: CC: ${{ matrix.compiler }} diff --git a/.github/workflows/regressions.yml b/.github/workflows/regressions.yml new file mode 100644 index 0000000..cbdaae9 --- /dev/null +++ b/.github/workflows/regressions.yml @@ -0,0 +1,99 @@ +name: Regression Tests + +on: + push: + branches: + - master + paths-ignore: + - '*.html' + - '*.md' + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + env: + # Let's try opting into use of Nodejs v24; see: + # https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ + # GitHub runners still causing problems with NodeJS v20; see: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + + DEBIAN_FRONTEND: noninteractive + TZ: America/Los_Angeles + + strategy: + matrix: + compiler: + - gcc + container: + - ubuntu:22.04 + + container: ${{ matrix.container }} + + steps: + - name: Checkout ProFTPD + uses: actions/checkout@v6 + with: + repository: proftpd/proftpd + path: proftpd + + - name: Checkout module source code + uses: actions/checkout@v6 + with: + path: proftpd/contrib/mod_vroot + + - name: Install Ubuntu packages + run: | + apt-get update -qq + # for builds + apt-get install -y gcc git make tzdata + + # for OpenSSL support + apt-get install -y libssl-dev + + # for integration/regression tests + apt-get install -y \ + libauthen-oath-perl \ + libcompress-raw-zlib-perl \ + libdata-dumper-simple-perl \ + libdatetime-perl \ + libfile-copy-recursive-perl \ + libfile-path-tiny-perl \ + libfile-spec-native-perl \ + libmime-base32-perl \ + libnet-address-ip-local-perl \ + libnet-inet6glue-perl \ + libnet-ssh2-perl \ + libnet-ssleay-perl \ + libnet-telnet-perl \ + libposix-2008-perl \ + libtest-unit-perl \ + libtime-hr-perl \ + libwww-perl + PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'install Net::FTPSSL' + + # for debugging + gcc --version + openssl version -a + + - name: Install with static modules + # NOTE: Docker does not have good IPv6 support, hence we disable it. + run: | + cd proftpd + ./configure --enable-ctrls --disable-ipv6 --with-modules=mod_sftp:mod_vroot + make + ./proftpd -V + make install + + - name: Run integration tests + env: + PROFTPD_TEST_BIN: /usr/local/sbin/proftpd + PROFTPD_TEST_CI: github + PROFTPD_TEST_DIR: ${{ github.workspace }}/proftpd/tests + run: | + cd proftpd/contrib/mod_vroot + perl tests.pl diff --git a/t/lib/ProFTPD/Tests/Modules/mod_vroot/sftp.pm b/t/lib/ProFTPD/Tests/Modules/mod_vroot/sftp.pm index 641e4fe..9082859 100644 --- a/t/lib/ProFTPD/Tests/Modules/mod_vroot/sftp.pm +++ b/t/lib/ProFTPD/Tests/Modules/mod_vroot/sftp.pm @@ -163,8 +163,8 @@ sub set_up { # Make sure that mod_sftp does not complain about permissions on the hostkey # files. - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); unless (chmod(0400, $rsa_host_key, $dsa_host_key)) { die("Can't set perms on $rsa_host_key, $dsa_host_key: $!"); @@ -265,8 +265,8 @@ sub vroot_alias_file_sftp_read { my $dst_file = '~/bar.txt'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -407,8 +407,8 @@ sub vroot_alias_file_sftp_write_no_overwrite { my $dst_file = '~/bar.txt'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $setup->{pid_file}, @@ -533,8 +533,8 @@ sub vroot_alias_file_sftp_write { my $dst_file = '~/bar.txt'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $setup->{pid_file}, @@ -703,8 +703,8 @@ sub vroot_alias_file_sftp_stat { my $dst_file = '~/bar.txt'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -882,8 +882,8 @@ sub vroot_alias_file_sftp_lstat { my $dst_file = '~/bar.txt'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -1061,8 +1061,8 @@ sub vroot_alias_file_sftp_realpath { my $dst_file = '~/bar.txt'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -1231,8 +1231,8 @@ sub vroot_alias_file_sftp_remove { my $dst_file = '~/bar.txt'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -1416,8 +1416,8 @@ sub vroot_alias_dir_sftp_readdir { die("Can't open $test_file3: $!"); } - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -1619,8 +1619,8 @@ sub vroot_alias_dir_sftp_rmdir { my $dst_dir = '~/bar.d'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -1803,8 +1803,8 @@ sub vroot_alias_symlink_sftp_stat { my $src_symlink = File::Spec->rel2abs("$tmpdir/foo.lnk"); my $dst_file = '~/bar.lnk'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -1998,8 +1998,8 @@ sub vroot_alias_symlink_sftp_lstat { my $src_symlink = File::Spec->rel2abs("$tmpdir/foo.lnk"); my $dst_file = '~/bar.lnk'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -2193,8 +2193,8 @@ sub vroot_alias_symlink_sftp_realpath { my $src_symlink = File::Spec->rel2abs("$tmpdir/foo.lnk"); my $dst_file = '~/bar.lnk'; - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $pid_file, @@ -2325,8 +2325,8 @@ sub vroot_alias_file_scp_download { my $dst_file = '~/bar.txt'; my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $setup->{pid_file}, @@ -2445,8 +2445,8 @@ sub vroot_alias_file_scp_upload { my $dst_file = '~/bar.txt'; my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $config = { PidFile => $setup->{pid_file}, @@ -2557,8 +2557,8 @@ sub vroot_sftp_log_extlog_retr { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); if (open(my $fh, "> $test_file")) { @@ -2721,8 +2721,8 @@ sub vroot_sftp_log_xferlog_retr { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); if (open(my $fh, "> $test_file")) { @@ -2913,8 +2913,8 @@ sub vroot_sftp_log_extlog_stor { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); my $ext_log = File::Spec->rel2abs("$tmpdir/ext.log"); @@ -3061,8 +3061,8 @@ sub vroot_sftp_log_xferlog_stor { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); my $xfer_log = File::Spec->rel2abs("$tmpdir/xfer.log"); @@ -3241,11 +3241,11 @@ sub vroot_sftp_quotatab_dir_issue1764 { my $user = 'test'; my $setup = test_setup($tmpdir, 'vroot', $user); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); # Make copies of the pre-existing mod_quotatab_file tables for our use. - my $src_file = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_quotatab_file/ftpquota-all-limit.tab"); + my $src_file = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_quotatab_file/ftpquota-all-limit.tab"); my $dst_file = File::Spec->rel2abs("$tmpdir/ftpquota-limit.tab"); if ($^O eq 'darwin') { # MacOSX-specific hack, due to how it handles tmp files @@ -3256,7 +3256,7 @@ sub vroot_sftp_quotatab_dir_issue1764 { die("Can't copy $src_file to $dst_file: $!"); } - $src_file = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_quotatab_file/ftpquota-all-tally.tab"); + $src_file = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_quotatab_file/ftpquota-all-tally.tab"); $dst_file = File::Spec->rel2abs("$tmpdir/ftpquota-tally.tab"); if ($^O eq 'darwin') { # MacOSX-specific hack, due to how it handles tmp files @@ -3396,8 +3396,8 @@ sub vroot_scp_log_extlog_retr { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); if (open(my $fh, "> $test_file")) { @@ -3541,8 +3541,8 @@ sub vroot_scp_log_xferlog_retr { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); if (open(my $fh, "> $test_file")) { @@ -3714,8 +3714,8 @@ sub vroot_scp_log_extlog_stor { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); my $ext_log = File::Spec->rel2abs("$tmpdir/ext.log"); @@ -3849,8 +3849,8 @@ sub vroot_scp_log_xferlog_stor { my $tmpdir = $self->{tmpdir}; my $setup = test_setup($tmpdir, 'vroot'); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); my $test_file = File::Spec->rel2abs("$tmpdir/test.txt"); my $xfer_log = File::Spec->rel2abs("$tmpdir/xfer.log"); @@ -4026,12 +4026,12 @@ sub vroot_alias_dir_sftp_publickey_issue30 { my $test_file3 = File::Spec->rel2abs("$tmpdir/foo.d/c.txt"); create_test_file($setup, $test_file3); - my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_rsa_key"); - my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/ssh_host_dsa_key"); + my $rsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_rsa_key"); + my $dsa_host_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/ssh_host_dsa_key"); - my $rsa_priv_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/test_rsa_key"); - my $rsa_pub_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/test_rsa_key.pub"); - my $rsa_rfc4716_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/tests/t/etc/modules/mod_sftp/authorized_rsa_keys2"); + my $rsa_priv_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/test_rsa_key"); + my $rsa_pub_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/test_rsa_key.pub"); + my $rsa_rfc4716_key = File::Spec->rel2abs("$ENV{PROFTPD_TEST_DIR}/t/etc/modules/mod_sftp/authorized_rsa_keys2"); my $authorized_keys = File::Spec->rel2abs("$tmpdir/.authorized_keys"); unless (copy($rsa_rfc4716_key, $authorized_keys)) { diff --git a/tests.pl b/tests.pl index 18afeb7..bcb2aca 100644 --- a/tests.pl +++ b/tests.pl @@ -29,7 +29,7 @@ # block, and we want the module to be loaded at run-time. if ($ENV{PROFTPD_TEST_DIR}) { - push(@INC, "$ENV{PROFTPD_TEST_DIR}/tests/t/lib"); + push(@INC, "$ENV{PROFTPD_TEST_DIR}/t/lib"); } my $test_dir = (File::Spec->splitpath(abs_path(__FILE__)))[1];