1 import ./make-test-python.nix ({ pkgs, ... }: {
10 userlist = [ "ftp-test-user" ];
14 networking.firewall.enable = false;
17 users.ftp-test-user = {
19 password = "ftp-test-password";
20 group = "ftp-test-group";
22 groups.ftp-test-group = {};
31 server.wait_for_unit("vsftpd")
32 server.wait_for_open_port(21)
34 client.succeed("curl -u ftp-test-user:ftp-test-password ftp://server")
35 client.succeed('echo "this is a test" > /tmp/test.file.up')
36 client.succeed("curl -v -T /tmp/test.file.up -u ftp-test-user:ftp-test-password ftp://server")
37 client.succeed("curl -u ftp-test-user:ftp-test-password ftp://server/test.file.up > /tmp/test.file.down")
38 client.succeed("diff /tmp/test.file.up /tmp/test.file.down")
39 assert client.succeed("cat /tmp/test.file.up") == server.succeed("cat /tmp/test.file.up")
40 assert client.succeed("cat /tmp/test.file.down") == server.succeed("cat /tmp/test.file.up")