~sschwarzer/ftputil

ftputil/test_server/README.md -rw-r--r-- 1.0 KiB
77f2ca24Stefan Schwarzer Move item "Push to repository" a month ago

#Test server for ftputil integration tests

The test file test_real_ftp.py uses a local FTP server.

This Dockerfile and data provide a Docker container that contains the FTP server and the data to test against.

When in the test_server directory, build the image with

docker image build -t ftputil-test-server:0.3 .

The pre-built image is also available from the Docker Hub via

docker pull sschwarzer/ftputil-test-server:0.3

Run the container with

docker container run --rm --detach --name test-server-container \
  -p 127.0.0.1:2121:2121 -p 127.0.0.1:30000-30009:30000-30009 \
  sschwarzer/ftputil-test-server:0.3

If you run the container with Podman, you may also need the --privileged option.

The port 2121 is expected by the tests in test_real_ftp.py. If the port 2121 is already used on your computer, you can change the port in the above container creation and edit the PORT variable in test_real_ftp.py accordingly.

WARNING: The included FTP server is solely for local tests. I made no efforts to make it secure.