2020-03-09 17:53:00 +03:00
|
|
|
# SPDX-FileCopyrightText: 2020 Serokell <https://serokell.io>
|
2019-12-18 17:18:55 +03:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-04-11 13:22:26 +03:00
|
|
|
{ linux ? false, linux-static ? false, windows ? false }:
|
2019-12-09 12:38:33 +03:00
|
|
|
let
|
2021-03-11 14:37:54 +03:00
|
|
|
nixpkgs = (import ./ci.nix).pkgs;
|
|
|
|
src = (import ./ci.nix).project-src;
|
2020-04-11 13:22:26 +03:00
|
|
|
pkgs = if linux-static then nixpkgs.pkgsCross.musl64 else if windows then nixpkgs.pkgsCross.mingwW64 else nixpkgs;
|
2020-03-09 17:53:00 +03:00
|
|
|
project = pkgs.haskell-nix.stackProject {
|
2022-09-26 08:34:13 +03:00
|
|
|
src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; keepGitDir = true; };
|
2020-03-09 17:53:00 +03:00
|
|
|
modules = [{
|
2020-01-13 15:58:14 +03:00
|
|
|
packages.xrefcheck = {
|
2022-07-08 18:08:25 +03:00
|
|
|
ghcOptions =
|
|
|
|
[ "-Werror" ];
|
|
|
|
|
2021-07-08 16:22:44 +03:00
|
|
|
components.tests = {
|
2022-09-20 11:54:20 +03:00
|
|
|
ftp-tests = {
|
2021-07-08 16:22:44 +03:00
|
|
|
build-tools = [ pkgs.vsftpd ];
|
|
|
|
preCheck = ''
|
|
|
|
echo "Starting vsftpd..."
|
|
|
|
touch /tmp/vsftpd.log
|
|
|
|
vsftpd \
|
|
|
|
-orun_as_launching_user=yes \
|
|
|
|
-olisten_port=2221 \
|
|
|
|
-olisten=yes \
|
|
|
|
-oftp_username=$(whoami) \
|
2022-09-20 11:54:20 +03:00
|
|
|
-oanon_root=${./ftp-tests/ftp_root} \
|
2021-07-08 16:22:44 +03:00
|
|
|
-opasv_min_port=2222 \
|
|
|
|
-ohide_file='{.*}' \
|
|
|
|
-odeny_file='{.*}' \
|
|
|
|
-oseccomp_sandbox=no \
|
|
|
|
-olog_ftp_protocol=yes \
|
|
|
|
-oxferlog_enable=yes \
|
|
|
|
-ovsftpd_log_file=/tmp/vsftpd.log &
|
|
|
|
sleep 1
|
|
|
|
tail -f /tmp/vsftpd.log &
|
|
|
|
'';
|
|
|
|
testFlags = [ "--ftp-host" "ftp://localhost:2221" ];
|
|
|
|
};
|
2022-09-26 08:34:13 +03:00
|
|
|
xrefcheck-tests.build-tools = [ pkgs.git ];
|
2021-07-08 16:22:44 +03:00
|
|
|
};
|
2019-12-09 12:38:33 +03:00
|
|
|
};
|
|
|
|
}];
|
|
|
|
};
|
2022-07-08 18:08:25 +03:00
|
|
|
in
|
|
|
|
project.xrefcheck
|