investtools-ftpd 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +5 -0
- data/.yardopts +7 -0
- data/Changelog.md +310 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +93 -0
- data/LICENSE.md +9 -0
- data/README.md +371 -0
- data/Rakefile +14 -0
- data/VERSION +1 -0
- data/doc/benchmarks.md +82 -0
- data/doc/references.md +66 -0
- data/doc/rfc-compliance.md +292 -0
- data/examples/example.rb +275 -0
- data/examples/example_spec.rb +93 -0
- data/examples/hello_world.rb +32 -0
- data/features/example/eplf.feature +14 -0
- data/features/example/example.feature +18 -0
- data/features/example/read_only.feature +63 -0
- data/features/example/step_definitions/example_server.rb +11 -0
- data/features/ftp_server/abort.feature +13 -0
- data/features/ftp_server/allo.feature +33 -0
- data/features/ftp_server/append.feature +94 -0
- data/features/ftp_server/cdup.feature +36 -0
- data/features/ftp_server/command_errors.feature +13 -0
- data/features/ftp_server/concurrent_sessions.feature +14 -0
- data/features/ftp_server/delay_after_failed_login.feature +23 -0
- data/features/ftp_server/delete.feature +60 -0
- data/features/ftp_server/directory_navigation.feature +59 -0
- data/features/ftp_server/disconnect_after_failed_logins.feature +25 -0
- data/features/ftp_server/eprt.feature +55 -0
- data/features/ftp_server/epsv.feature +36 -0
- data/features/ftp_server/features.feature +38 -0
- data/features/ftp_server/file_structure.feature +43 -0
- data/features/ftp_server/get.feature +80 -0
- data/features/ftp_server/get_ipv6.feature +43 -0
- data/features/ftp_server/get_tls.feature +23 -0
- data/features/ftp_server/help.feature +21 -0
- data/features/ftp_server/implicit_tls.feature +23 -0
- data/features/ftp_server/invertability.feature +15 -0
- data/features/ftp_server/list.feature +94 -0
- data/features/ftp_server/list_tls.feature +29 -0
- data/features/ftp_server/logging.feature +11 -0
- data/features/ftp_server/login_auth_level_account.feature +51 -0
- data/features/ftp_server/login_auth_level_password.feature +59 -0
- data/features/ftp_server/login_auth_level_user.feature +31 -0
- data/features/ftp_server/max_connections.feature +39 -0
- data/features/ftp_server/mdtm.feature +53 -0
- data/features/ftp_server/mkdir.feature +70 -0
- data/features/ftp_server/mode.feature +43 -0
- data/features/ftp_server/name_list.feature +77 -0
- data/features/ftp_server/name_list_tls.feature +30 -0
- data/features/ftp_server/noop.feature +17 -0
- data/features/ftp_server/options.feature +17 -0
- data/features/ftp_server/pasv.feature +23 -0
- data/features/ftp_server/port.feature +49 -0
- data/features/ftp_server/put.feature +79 -0
- data/features/ftp_server/put_tls.feature +23 -0
- data/features/ftp_server/put_unique.feature +56 -0
- data/features/ftp_server/quit.feature +23 -0
- data/features/ftp_server/reinitialize.feature +13 -0
- data/features/ftp_server/rename.feature +97 -0
- data/features/ftp_server/rmdir.feature +71 -0
- data/features/ftp_server/site.feature +13 -0
- data/features/ftp_server/size.feature +69 -0
- data/features/ftp_server/status.feature +18 -0
- data/features/ftp_server/step_definitions/logging.rb +8 -0
- data/features/ftp_server/step_definitions/test_server.rb +65 -0
- data/features/ftp_server/structure_mount.feature +13 -0
- data/features/ftp_server/syntax_errors.feature +18 -0
- data/features/ftp_server/syst.feature +18 -0
- data/features/ftp_server/timeout.feature +26 -0
- data/features/ftp_server/type.feature +59 -0
- data/features/step_definitions/append.rb +15 -0
- data/features/step_definitions/client.rb +24 -0
- data/features/step_definitions/client_and_server_files.rb +24 -0
- data/features/step_definitions/client_files.rb +14 -0
- data/features/step_definitions/command.rb +5 -0
- data/features/step_definitions/connect.rb +37 -0
- data/features/step_definitions/delete.rb +15 -0
- data/features/step_definitions/directory_navigation.rb +26 -0
- data/features/step_definitions/error_replies.rb +115 -0
- data/features/step_definitions/features.rb +21 -0
- data/features/step_definitions/file_structure.rb +16 -0
- data/features/step_definitions/generic_send.rb +9 -0
- data/features/step_definitions/get.rb +16 -0
- data/features/step_definitions/help.rb +18 -0
- data/features/step_definitions/invalid_commands.rb +11 -0
- data/features/step_definitions/line_endings.rb +7 -0
- data/features/step_definitions/list.rb +73 -0
- data/features/step_definitions/login.rb +82 -0
- data/features/step_definitions/mkdir.rb +9 -0
- data/features/step_definitions/mode.rb +15 -0
- data/features/step_definitions/mtime.rb +23 -0
- data/features/step_definitions/noop.rb +15 -0
- data/features/step_definitions/options.rb +9 -0
- data/features/step_definitions/passive.rb +3 -0
- data/features/step_definitions/pending.rb +3 -0
- data/features/step_definitions/port.rb +5 -0
- data/features/step_definitions/put.rb +29 -0
- data/features/step_definitions/quit.rb +15 -0
- data/features/step_definitions/rename.rb +11 -0
- data/features/step_definitions/rmdir.rb +9 -0
- data/features/step_definitions/server_files.rb +61 -0
- data/features/step_definitions/server_title.rb +12 -0
- data/features/step_definitions/size.rb +20 -0
- data/features/step_definitions/status.rb +9 -0
- data/features/step_definitions/success_replies.rb +7 -0
- data/features/step_definitions/system.rb +7 -0
- data/features/step_definitions/timing.rb +19 -0
- data/features/step_definitions/type.rb +15 -0
- data/features/support/env.rb +4 -0
- data/features/support/example_server.rb +67 -0
- data/features/support/file_templates/ascii_unix +4 -0
- data/features/support/file_templates/ascii_windows +4 -0
- data/features/support/file_templates/binary +0 -0
- data/features/support/test_client.rb +250 -0
- data/features/support/test_file_templates.rb +33 -0
- data/features/support/test_server.rb +293 -0
- data/features/support/test_server_files.rb +57 -0
- data/ftpd.gemspec +283 -0
- data/insecure-test-cert.pem +29 -0
- data/investtools-ftpd.gemspec +284 -0
- data/lib/ftpd.rb +86 -0
- data/lib/ftpd/auth_levels.rb +9 -0
- data/lib/ftpd/cmd_abor.rb +13 -0
- data/lib/ftpd/cmd_allo.rb +20 -0
- data/lib/ftpd/cmd_appe.rb +24 -0
- data/lib/ftpd/cmd_auth.rb +21 -0
- data/lib/ftpd/cmd_cdup.rb +16 -0
- data/lib/ftpd/cmd_cwd.rb +20 -0
- data/lib/ftpd/cmd_dele.rb +21 -0
- data/lib/ftpd/cmd_eprt.rb +23 -0
- data/lib/ftpd/cmd_epsv.rb +30 -0
- data/lib/ftpd/cmd_feat.rb +44 -0
- data/lib/ftpd/cmd_help.rb +29 -0
- data/lib/ftpd/cmd_list.rb +33 -0
- data/lib/ftpd/cmd_login.rb +60 -0
- data/lib/ftpd/cmd_mdtm.rb +27 -0
- data/lib/ftpd/cmd_mkd.rb +23 -0
- data/lib/ftpd/cmd_mode.rb +27 -0
- data/lib/ftpd/cmd_nlst.rb +27 -0
- data/lib/ftpd/cmd_noop.rb +14 -0
- data/lib/ftpd/cmd_opts.rb +14 -0
- data/lib/ftpd/cmd_pasv.rb +28 -0
- data/lib/ftpd/cmd_pbsz.rb +23 -0
- data/lib/ftpd/cmd_port.rb +28 -0
- data/lib/ftpd/cmd_prot.rb +34 -0
- data/lib/ftpd/cmd_pwd.rb +15 -0
- data/lib/ftpd/cmd_quit.rb +18 -0
- data/lib/ftpd/cmd_rein.rb +13 -0
- data/lib/ftpd/cmd_rename.rb +32 -0
- data/lib/ftpd/cmd_rest.rb +13 -0
- data/lib/ftpd/cmd_retr.rb +24 -0
- data/lib/ftpd/cmd_rmd.rb +22 -0
- data/lib/ftpd/cmd_site.rb +13 -0
- data/lib/ftpd/cmd_size.rb +29 -0
- data/lib/ftpd/cmd_smnt.rb +13 -0
- data/lib/ftpd/cmd_stat.rb +15 -0
- data/lib/ftpd/cmd_stor.rb +25 -0
- data/lib/ftpd/cmd_stou.rb +25 -0
- data/lib/ftpd/cmd_stru.rb +27 -0
- data/lib/ftpd/cmd_syst.rb +16 -0
- data/lib/ftpd/cmd_type.rb +28 -0
- data/lib/ftpd/command_handler.rb +90 -0
- data/lib/ftpd/command_handler_factory.rb +51 -0
- data/lib/ftpd/command_handlers.rb +60 -0
- data/lib/ftpd/command_loop.rb +80 -0
- data/lib/ftpd/command_sequence_checker.rb +58 -0
- data/lib/ftpd/config.rb +13 -0
- data/lib/ftpd/connection_throttle.rb +56 -0
- data/lib/ftpd/connection_tracker.rb +82 -0
- data/lib/ftpd/data_connection_helper.rb +123 -0
- data/lib/ftpd/disk_file_system.rb +434 -0
- data/lib/ftpd/error.rb +21 -0
- data/lib/ftpd/exception_translator.rb +32 -0
- data/lib/ftpd/exceptions.rb +62 -0
- data/lib/ftpd/file_info.rb +115 -0
- data/lib/ftpd/file_system_helper.rb +67 -0
- data/lib/ftpd/ftp_server.rb +214 -0
- data/lib/ftpd/gets_peer_address.rb +41 -0
- data/lib/ftpd/insecure_certificate.rb +16 -0
- data/lib/ftpd/list_format/eplf.rb +74 -0
- data/lib/ftpd/list_format/ls.rb +154 -0
- data/lib/ftpd/list_path.rb +28 -0
- data/lib/ftpd/null_logger.rb +22 -0
- data/lib/ftpd/protocols.rb +60 -0
- data/lib/ftpd/read_only_disk_file_system.rb +22 -0
- data/lib/ftpd/server.rb +139 -0
- data/lib/ftpd/session.rb +220 -0
- data/lib/ftpd/session_config.rb +111 -0
- data/lib/ftpd/stream.rb +80 -0
- data/lib/ftpd/telnet.rb +114 -0
- data/lib/ftpd/temp_dir.rb +22 -0
- data/lib/ftpd/tls_server.rb +111 -0
- data/lib/ftpd/translate_exceptions.rb +68 -0
- data/rake_tasks/cucumber.rake +9 -0
- data/rake_tasks/default.rake +1 -0
- data/rake_tasks/jeweler.rake +52 -0
- data/rake_tasks/spec.rake +3 -0
- data/rake_tasks/test.rake +2 -0
- data/rake_tasks/yard.rake +3 -0
- data/spec/command_sequence_checker_spec.rb +83 -0
- data/spec/connection_throttle_spec.rb +99 -0
- data/spec/connection_tracker_spec.rb +97 -0
- data/spec/disk_file_system_spec.rb +320 -0
- data/spec/exception_translator_spec.rb +36 -0
- data/spec/file_info_spec.rb +59 -0
- data/spec/ftp_server_error_spec.rb +13 -0
- data/spec/list_format/eplf_spec.rb +61 -0
- data/spec/list_format/ls_spec.rb +270 -0
- data/spec/list_path_spec.rb +21 -0
- data/spec/null_logger_spec.rb +24 -0
- data/spec/protocols_spec.rb +139 -0
- data/spec/server_spec.rb +81 -0
- data/spec/spec_helper.rb +15 -0
- data/spec/telnet_spec.rb +75 -0
- data/spec/translate_exceptions_spec.rb +40 -0
- metadata +404 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
Feature: Delay After Failed Login
|
2
|
+
|
3
|
+
As an administrator
|
4
|
+
I want to make brute force attacks less efficient
|
5
|
+
So that an attacker doesn't gain access
|
6
|
+
|
7
|
+
Scenario: Failed login attempts
|
8
|
+
Given the test server has a failed login delay of 0.2 seconds
|
9
|
+
And the test server is started
|
10
|
+
Given the client connects
|
11
|
+
And the client logs in with bad user
|
12
|
+
And the client logs in with bad user
|
13
|
+
And the client logs in
|
14
|
+
Then it should take at least 0.4 seconds
|
15
|
+
|
16
|
+
Scenario: Failed login attempts
|
17
|
+
Given the test server has a failed login delay of 0.0 seconds
|
18
|
+
And the test server is started
|
19
|
+
Given the client connects
|
20
|
+
And the client logs in with bad user
|
21
|
+
And the client logs in with bad user
|
22
|
+
And the client logs in
|
23
|
+
Then it should take less than 0.4 seconds
|
@@ -0,0 +1,60 @@
|
|
1
|
+
Feature: Delete
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to delete files
|
5
|
+
So that nobody can fetch them from the server
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is started
|
9
|
+
|
10
|
+
Scenario: Delete a file
|
11
|
+
Given a successful login
|
12
|
+
And the server has file "foo"
|
13
|
+
When the client successfully deletes "foo"
|
14
|
+
Then the server should not have file "foo"
|
15
|
+
|
16
|
+
Scenario: Delete a file in a subdirectory
|
17
|
+
Given a successful login
|
18
|
+
And the server has file "foo/bar"
|
19
|
+
When the client successfully deletes "foo/bar"
|
20
|
+
Then the server should not have file "foo/bar"
|
21
|
+
|
22
|
+
Scenario: Change current directory
|
23
|
+
Given a successful login
|
24
|
+
And the server has file "foo/bar"
|
25
|
+
And the client successfully cd's to "foo"
|
26
|
+
When the client successfully deletes "bar"
|
27
|
+
Then the server should not have file "foo/bar"
|
28
|
+
|
29
|
+
Scenario: Missing path
|
30
|
+
Given a successful login
|
31
|
+
And the server has file "foo"
|
32
|
+
When the client deletes with no path
|
33
|
+
Then the server returns a path required error
|
34
|
+
|
35
|
+
Scenario: not found
|
36
|
+
Given a successful login
|
37
|
+
When the client deletes "foo"
|
38
|
+
Then the server returns a not found error
|
39
|
+
|
40
|
+
Scenario: Access denied
|
41
|
+
Given a successful login
|
42
|
+
When the client deletes "forbidden"
|
43
|
+
Then the server returns an access denied error
|
44
|
+
|
45
|
+
Scenario: File system error
|
46
|
+
Given a successful login
|
47
|
+
When the client deletes "unable"
|
48
|
+
Then the server returns an action not taken error
|
49
|
+
|
50
|
+
Scenario: Not logged in
|
51
|
+
Given a successful connection
|
52
|
+
When the client deletes "foo"
|
53
|
+
Then the server returns a not logged in error
|
54
|
+
|
55
|
+
Scenario: Delete not enabled
|
56
|
+
Given the test server lacks delete
|
57
|
+
And a successful login
|
58
|
+
And the server has file "foo"
|
59
|
+
When the client deletes "foo"
|
60
|
+
Then the server returns an unimplemented command error
|
@@ -0,0 +1,59 @@
|
|
1
|
+
Feature: Change Directory
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to change the current directory
|
5
|
+
So that I can use shorter paths
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is started
|
9
|
+
|
10
|
+
Scenario: Down to subdir
|
11
|
+
Given a successful login
|
12
|
+
And the server has file "subdir/bar"
|
13
|
+
When the client successfully cd's to "subdir"
|
14
|
+
Then the current directory should be "/subdir"
|
15
|
+
|
16
|
+
Scenario: Up from subdir
|
17
|
+
Given a successful login
|
18
|
+
And the server has file "subdir/bar"
|
19
|
+
And the client successfully cd's to "subdir"
|
20
|
+
When the client successfully cd's to ".."
|
21
|
+
Then the current directory should be "/"
|
22
|
+
|
23
|
+
Scenario: Up from root
|
24
|
+
Given a successful login
|
25
|
+
When the client successfully cd's to ".."
|
26
|
+
Then the current directory should be "/"
|
27
|
+
|
28
|
+
Scenario: XPWD
|
29
|
+
Given a successful login
|
30
|
+
And the server has directory "subdir"
|
31
|
+
When the client successfully cd's to "subdir"
|
32
|
+
Then the XPWD directory should be "/subdir"
|
33
|
+
|
34
|
+
Scenario: XCWD
|
35
|
+
Given a successful login
|
36
|
+
And the server has directory "subdir"
|
37
|
+
When the client successfully sends "XCWD subdir"
|
38
|
+
Then the current directory should be "/subdir"
|
39
|
+
|
40
|
+
Scenario: Change to file
|
41
|
+
Given a successful login
|
42
|
+
And the server has file "baz"
|
43
|
+
When the client cd's to "baz"
|
44
|
+
Then the server returns a not a directory error
|
45
|
+
|
46
|
+
Scenario: No such directory
|
47
|
+
Given a successful login
|
48
|
+
When the client cd's to "subdir"
|
49
|
+
Then the server returns a not found error
|
50
|
+
|
51
|
+
Scenario: Access denied
|
52
|
+
Given a successful login
|
53
|
+
When the client cd's to "forbidden"
|
54
|
+
Then the server returns an access denied error
|
55
|
+
|
56
|
+
Scenario: Not logged in
|
57
|
+
Given a successful connection
|
58
|
+
When the client cd's to "subdir"
|
59
|
+
Then the server returns a not logged in error
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Feature: Disconnect After Failed Logins
|
2
|
+
|
3
|
+
As an administrator
|
4
|
+
I want to make brute force attacks less efficient
|
5
|
+
So that an attacker doesn't gain access
|
6
|
+
|
7
|
+
Scenario: Disconnected after maximum failed attempts
|
8
|
+
Given the test server has a max of 3 failed login attempts
|
9
|
+
And the test server is started
|
10
|
+
Given the client connects
|
11
|
+
And the client logs in with bad user
|
12
|
+
And the client logs in with bad user
|
13
|
+
When the client logs in with bad user
|
14
|
+
Then the server returns a server unavailable error
|
15
|
+
And the client should not be connected
|
16
|
+
|
17
|
+
Scenario: No maximum configured
|
18
|
+
Given the test server has no max failed login attempts
|
19
|
+
And the test server is started
|
20
|
+
Given the client connects
|
21
|
+
And the client logs in with bad user
|
22
|
+
And the client logs in with bad user
|
23
|
+
And the client logs in with bad user
|
24
|
+
Then the server returns a login incorrect error
|
25
|
+
And the client should be connected
|
@@ -0,0 +1,55 @@
|
|
1
|
+
Feature: EPRT
|
2
|
+
|
3
|
+
As a programmer
|
4
|
+
I want good error messages
|
5
|
+
So that I can correct problems
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is bound to "::"
|
9
|
+
Given the test server is started
|
10
|
+
|
11
|
+
Scenario: Port 1024
|
12
|
+
Given a successful login
|
13
|
+
Then the client successfully sends "EPRT |1|1.2.3.4|1024|"
|
14
|
+
|
15
|
+
Scenario: Port 1023; low ports disallowed
|
16
|
+
Given the test server disallows low data ports
|
17
|
+
And a successful login
|
18
|
+
When the client sends "EPRT |1|2.3.4.3|255|"
|
19
|
+
Then the server returns an unimplemented parameter error
|
20
|
+
|
21
|
+
Scenario: Port out of range
|
22
|
+
Given a successful login
|
23
|
+
When the client sends "EPRT |1|2.3.4.5|65536|"
|
24
|
+
Then the server returns an unimplemented parameter error
|
25
|
+
|
26
|
+
Scenario: Port 1023; low ports allowed
|
27
|
+
Given the test server allows low data ports
|
28
|
+
And a successful login
|
29
|
+
Then the client successfully sends "EPRT |1|2.3.4.3|255|"
|
30
|
+
|
31
|
+
Scenario: Not logged in
|
32
|
+
Given a successful connection
|
33
|
+
When the client sends "EPRT |1|2.3.4.5|6|"
|
34
|
+
Then the server returns a not logged in error
|
35
|
+
|
36
|
+
Scenario: Too few parts
|
37
|
+
Given a successful login
|
38
|
+
When the client sends "EPRT |1|2.3.4|"
|
39
|
+
Then the server returns a syntax error
|
40
|
+
|
41
|
+
Scenario: Too many parts
|
42
|
+
Given a successful login
|
43
|
+
When the client sends "EPRT |1|2.3.4|5|6|"
|
44
|
+
Then the server returns a syntax error
|
45
|
+
|
46
|
+
Scenario: Unknown network protocol
|
47
|
+
Given a successful login
|
48
|
+
When the client sends "EPRT |3|2.3.4.5|6|"
|
49
|
+
Then the server returns a network protocol not supported error
|
50
|
+
|
51
|
+
Scenario: After "EPSV ALL"
|
52
|
+
Given a successful login
|
53
|
+
Given the client successfully sends "EPSV ALL"
|
54
|
+
When the client sends "EPRT |1|2.3.4.5|6|"
|
55
|
+
Then the server sends a not allowed after epsv all error
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Feature: EPSV
|
2
|
+
|
3
|
+
As a programmer
|
4
|
+
I want good error messages
|
5
|
+
So that I can correct problems
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is bound to "::"
|
9
|
+
And the test server is started
|
10
|
+
|
11
|
+
Scenario: No argument
|
12
|
+
Given a successful login
|
13
|
+
Then the client successfully sends "EPSV"
|
14
|
+
|
15
|
+
Scenario: Explicit IPV4
|
16
|
+
Given a successful login
|
17
|
+
Then the client successfully sends "EPSV 1"
|
18
|
+
|
19
|
+
Scenario: Explicit IPV6
|
20
|
+
Given a successful login
|
21
|
+
Then the client successfully sends "EPSV 2"
|
22
|
+
|
23
|
+
Scenario: After "EPSV ALL"
|
24
|
+
Given a successful login
|
25
|
+
Given the client successfully sends "EPSV ALL"
|
26
|
+
Then the client successfully sends "EPSV"
|
27
|
+
|
28
|
+
Scenario: Not logged in
|
29
|
+
Given a successful connection
|
30
|
+
When the client sends "EPSV"
|
31
|
+
Then the server returns a not logged in error
|
32
|
+
|
33
|
+
Scenario: Unknown network protocol
|
34
|
+
Given a successful login
|
35
|
+
When the client sends "EPSV 99"
|
36
|
+
Then the server returns a network protocol not supported error
|
@@ -0,0 +1,38 @@
|
|
1
|
+
Feature: Features
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to know what FTP extension the server supports
|
5
|
+
So that I can use them without trial-and-error
|
6
|
+
|
7
|
+
Background:
|
8
|
+
|
9
|
+
Scenario: TLS Disabled
|
10
|
+
Given the test server is started
|
11
|
+
And the client connects
|
12
|
+
When the client successfully requests features
|
13
|
+
Then the response should not include TLS features
|
14
|
+
|
15
|
+
Scenario: TLS Enabled
|
16
|
+
Given the test server has TLS mode "explicit"
|
17
|
+
And the test server is started
|
18
|
+
And the client connects
|
19
|
+
When the client successfully requests features
|
20
|
+
Then the response should include TLS features
|
21
|
+
|
22
|
+
Scenario: Argument given
|
23
|
+
Given the test server is started
|
24
|
+
And the client connects
|
25
|
+
When the client sends "FEAT FOO"
|
26
|
+
Then the server returns a syntax error
|
27
|
+
|
28
|
+
Scenario: IPV6 Extensions
|
29
|
+
Given the test server is started
|
30
|
+
When the client successfully requests features
|
31
|
+
Then the response should include feature "EPRT"
|
32
|
+
And the response should include feature "EPSV"
|
33
|
+
|
34
|
+
Scenario: RFC 3659 Extensions
|
35
|
+
Given the test server is started
|
36
|
+
When the client successfully requests features
|
37
|
+
Then the response should include feature "SIZE"
|
38
|
+
Then the response should include feature "MDTM"
|
@@ -0,0 +1,43 @@
|
|
1
|
+
Feature: File Structure
|
2
|
+
|
3
|
+
As a server
|
4
|
+
I want to accept the obsolute file structure (STRU) command
|
5
|
+
For compatability
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is started
|
9
|
+
|
10
|
+
Scenario: File
|
11
|
+
Given a successful login
|
12
|
+
And the server has file "ascii_unix"
|
13
|
+
When the client successfully sets file structure "F"
|
14
|
+
And the client successfully gets text "ascii_unix"
|
15
|
+
Then the remote file "ascii_unix" should match the local file
|
16
|
+
|
17
|
+
Scenario: Record
|
18
|
+
Given a successful login
|
19
|
+
And the server has file "ascii_unix"
|
20
|
+
When the client sets file structure "R"
|
21
|
+
Then the server returns a file structure not implemented error
|
22
|
+
|
23
|
+
Scenario: Page
|
24
|
+
Given a successful login
|
25
|
+
And the server has file "ascii_unix"
|
26
|
+
When the client sets file structure "P"
|
27
|
+
Then the server returns a file structure not implemented error
|
28
|
+
|
29
|
+
Scenario: Invalid
|
30
|
+
Given a successful login
|
31
|
+
And the server has file "ascii_unix"
|
32
|
+
When the client sets file structure "*"
|
33
|
+
Then the server returns an invalid file structure error
|
34
|
+
|
35
|
+
Scenario: Not logged in
|
36
|
+
Given a successful connection
|
37
|
+
When the client sets file structure "F"
|
38
|
+
Then the server returns a not logged in error
|
39
|
+
|
40
|
+
Scenario: Missing parameter
|
41
|
+
Given a successful login
|
42
|
+
When the client sets file structure with no parameter
|
43
|
+
Then the server returns a syntax error
|
@@ -0,0 +1,80 @@
|
|
1
|
+
Feature: Get
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to securely get a file
|
5
|
+
So that I have it on my computer
|
6
|
+
But nobody else can
|
7
|
+
|
8
|
+
Background:
|
9
|
+
Given the test server is started
|
10
|
+
|
11
|
+
Scenario: ASCII file with *nix line endings
|
12
|
+
Given a successful login
|
13
|
+
And the server has file "ascii_unix"
|
14
|
+
When the client successfully gets text "ascii_unix"
|
15
|
+
Then the local file "ascii_unix" should match the remote file
|
16
|
+
And the local file "ascii_unix" should have unix line endings
|
17
|
+
|
18
|
+
Scenario: ASCII file with windows line endings
|
19
|
+
Given a successful login
|
20
|
+
And the server has file "ascii_windows"
|
21
|
+
When the client successfully gets text "ascii_windows"
|
22
|
+
Then the local file "ascii_windows" should match the remote file
|
23
|
+
And the local file "ascii_windows" should have unix line endings
|
24
|
+
|
25
|
+
Scenario: Binary file
|
26
|
+
Given a successful login
|
27
|
+
And the server has file "binary"
|
28
|
+
When the client successfully gets binary "binary"
|
29
|
+
Then the local file "binary" should exactly match the remote file
|
30
|
+
|
31
|
+
Scenario: Passive
|
32
|
+
Given a successful login
|
33
|
+
And the server has file "ascii_unix"
|
34
|
+
And the client is in passive mode
|
35
|
+
When the client successfully gets text "ascii_unix"
|
36
|
+
Then the local file "ascii_unix" should match the remote file
|
37
|
+
|
38
|
+
Scenario: File in subdirectory
|
39
|
+
Given a successful login
|
40
|
+
And the server has file "foo/ascii_unix"
|
41
|
+
Then the client successfully gets text "foo/ascii_unix"
|
42
|
+
|
43
|
+
Scenario: Non-root working directory
|
44
|
+
Given a successful login
|
45
|
+
And the server has file "foo/ascii_unix"
|
46
|
+
And the client successfully cd's to "foo"
|
47
|
+
When the client successfully gets text "ascii_unix"
|
48
|
+
Then the remote file "foo/ascii_unix" should match the local file
|
49
|
+
|
50
|
+
Scenario: Access denied
|
51
|
+
Given a successful login
|
52
|
+
When the client gets text "forbidden"
|
53
|
+
Then the server returns an access denied error
|
54
|
+
|
55
|
+
Scenario: Missing file
|
56
|
+
Given a successful login
|
57
|
+
When the client gets text "foo"
|
58
|
+
Then the server returns a not found error
|
59
|
+
|
60
|
+
Scenario: Not logged in
|
61
|
+
Given a successful connection
|
62
|
+
When the client gets text "foo"
|
63
|
+
Then the server returns a not logged in error
|
64
|
+
|
65
|
+
Scenario: Missing path
|
66
|
+
Given a successful login
|
67
|
+
When the client gets with no path
|
68
|
+
Then the server returns a syntax error
|
69
|
+
|
70
|
+
Scenario: File system error
|
71
|
+
Given a successful login
|
72
|
+
When the client gets text "unable"
|
73
|
+
Then the server returns an action not taken error
|
74
|
+
|
75
|
+
Scenario: Read not enabled
|
76
|
+
Given the test server lacks read
|
77
|
+
And a successful login
|
78
|
+
And the server has file "foo"
|
79
|
+
When the client gets text "foo"
|
80
|
+
Then the server returns an unimplemented command error
|
@@ -0,0 +1,43 @@
|
|
1
|
+
Feature: Get IPV6
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to get a file
|
5
|
+
So that I have it on my computer
|
6
|
+
|
7
|
+
Scenario: Active
|
8
|
+
Given the test server is bound to "::1"
|
9
|
+
And the test server is started
|
10
|
+
And a successful login
|
11
|
+
And the server has file "ascii_unix"
|
12
|
+
And the client is in active mode
|
13
|
+
When the client successfully gets text "ascii_unix"
|
14
|
+
Then the local file "ascii_unix" should match the remote file
|
15
|
+
|
16
|
+
Scenario: Passive
|
17
|
+
Given the test server is bound to "::1"
|
18
|
+
And the test server is started
|
19
|
+
And a successful login
|
20
|
+
And the server has file "ascii_unix"
|
21
|
+
And the client is in passive mode
|
22
|
+
When the client successfully gets text "ascii_unix"
|
23
|
+
Then the local file "ascii_unix" should match the remote file
|
24
|
+
|
25
|
+
Scenario: Active, TLS
|
26
|
+
Given the test server is bound to "::1"
|
27
|
+
And the test server has TLS mode "explicit"
|
28
|
+
And the test server is started
|
29
|
+
And a successful login
|
30
|
+
And the server has file "ascii_unix"
|
31
|
+
And the client is in active mode
|
32
|
+
When the client successfully gets text "ascii_unix"
|
33
|
+
Then the local file "ascii_unix" should match the remote file
|
34
|
+
|
35
|
+
Scenario: Passive, TLS
|
36
|
+
Given the test server is bound to "::1"
|
37
|
+
And the test server has TLS mode "explicit"
|
38
|
+
And the test server is started
|
39
|
+
And a successful login
|
40
|
+
And the server has file "ascii_unix"
|
41
|
+
And the client is in passive mode
|
42
|
+
When the client successfully gets text "ascii_unix"
|
43
|
+
Then the local file "ascii_unix" should match the remote file
|