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: Get TLS
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to get a file
|
5
|
+
So that I have it on my computer
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server has TLS mode "explicit"
|
9
|
+
And the test server is started
|
10
|
+
|
11
|
+
Scenario: Active
|
12
|
+
Given a successful login with explicit TLS
|
13
|
+
And the server has file "ascii_unix"
|
14
|
+
And the client is in active mode
|
15
|
+
When the client successfully gets text "ascii_unix"
|
16
|
+
Then the local file "ascii_unix" should match the remote file
|
17
|
+
|
18
|
+
Scenario: Passive
|
19
|
+
Given a successful login with explicit TLS
|
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
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Feature: Help
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to ask for help
|
5
|
+
So that I can know which commands are supported
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is started
|
9
|
+
And a successful connection
|
10
|
+
|
11
|
+
Scenario: No argument
|
12
|
+
When the client successfully asks for help
|
13
|
+
Then the server should return a list of commands
|
14
|
+
|
15
|
+
Scenario: Known command
|
16
|
+
When the client successfully asks for help for "NOOP"
|
17
|
+
Then the server should return help for "NOOP"
|
18
|
+
|
19
|
+
Scenario: Unknown command
|
20
|
+
When the client successfully asks for help for "FOO"
|
21
|
+
Then the server should return no help for "FOO"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Feature: Implicit TLS
|
2
|
+
|
3
|
+
As a server
|
4
|
+
I want to use implicit TLS
|
5
|
+
Because I must serve out-of-date clients
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server has TLS mode "implicit"
|
9
|
+
And the test server is started
|
10
|
+
|
11
|
+
Scenario: Active
|
12
|
+
Given a successful login with implicit TLS
|
13
|
+
And the client has file "ascii_unix"
|
14
|
+
And the client is in active mode
|
15
|
+
When the client successfully puts text "ascii_unix"
|
16
|
+
Then the remote file "ascii_unix" should match the local file
|
17
|
+
|
18
|
+
Scenario: Passive
|
19
|
+
Given a successful login with implicit TLS
|
20
|
+
And the client has file "ascii_unix"
|
21
|
+
And the client is in passive mode
|
22
|
+
When the client successfully puts text "ascii_unix"
|
23
|
+
Then the remote file "ascii_unix" should match the local file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Feature: Get
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want a file to be the same when I get it as it was when I put it
|
5
|
+
So that I can use the FTP server for storage
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is started
|
9
|
+
|
10
|
+
Scenario: Binary file
|
11
|
+
Given a successful login
|
12
|
+
And the client has file "binary"
|
13
|
+
When the client successfully puts binary "binary"
|
14
|
+
And the client successfully gets binary "binary"
|
15
|
+
Then the local file "binary" should match its template
|
@@ -0,0 +1,94 @@
|
|
1
|
+
Feature: List
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to list files
|
5
|
+
So that I can see what file to transfer
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is started
|
9
|
+
|
10
|
+
Scenario: Implicit
|
11
|
+
Given a successful login
|
12
|
+
And the server has file "foo"
|
13
|
+
And the server has file "bar"
|
14
|
+
When the client successfully lists the directory
|
15
|
+
Then the file list should be in long form
|
16
|
+
And the file list should contain "foo"
|
17
|
+
And the file list should contain "bar"
|
18
|
+
|
19
|
+
Scenario: Root
|
20
|
+
Given a successful login
|
21
|
+
And the server has file "foo"
|
22
|
+
And the server has file "bar"
|
23
|
+
When the client successfully lists the directory "/"
|
24
|
+
Then the file list should be in long form
|
25
|
+
And the file list should contain "foo"
|
26
|
+
And the file list should contain "bar"
|
27
|
+
|
28
|
+
Scenario: Parent of root
|
29
|
+
Given a successful login
|
30
|
+
And the server has file "foo"
|
31
|
+
And the server has file "bar"
|
32
|
+
When the client successfully lists the directory "/.."
|
33
|
+
Then the file list should be in long form
|
34
|
+
And the file list should contain "foo"
|
35
|
+
And the file list should contain "bar"
|
36
|
+
|
37
|
+
Scenario: Subdir
|
38
|
+
Given a successful login
|
39
|
+
And the server has file "subdir/foo"
|
40
|
+
When the client successfully lists the directory "subdir"
|
41
|
+
Then the file list should be in long form
|
42
|
+
And the file list should contain "foo"
|
43
|
+
|
44
|
+
Scenario: After CWD
|
45
|
+
Given a successful login
|
46
|
+
And the server has file "subdir/foo"
|
47
|
+
And the client successfully cd's to "subdir"
|
48
|
+
When the client successfully lists the directory
|
49
|
+
Then the file list should be in long form
|
50
|
+
And the file list should contain "foo"
|
51
|
+
|
52
|
+
Scenario: Glob
|
53
|
+
Given a successful login
|
54
|
+
And the server has file "foo"
|
55
|
+
And the server has file "bar"
|
56
|
+
When the client successfully lists the directory "f*"
|
57
|
+
Then the file list should be in long form
|
58
|
+
And the file list should contain "foo"
|
59
|
+
And the file list should not contain "bar"
|
60
|
+
|
61
|
+
Scenario: Passive
|
62
|
+
Given a successful login
|
63
|
+
And the server has file "foo"
|
64
|
+
And the server has file "bar"
|
65
|
+
And the client is in passive mode
|
66
|
+
When the client successfully lists the directory
|
67
|
+
Then the file list should be in long form
|
68
|
+
And the file list should contain "foo"
|
69
|
+
And the file list should contain "bar"
|
70
|
+
|
71
|
+
Scenario: -a
|
72
|
+
Given a successful login
|
73
|
+
And the server has file "foo"
|
74
|
+
And the server has file "bar"
|
75
|
+
When the client successfully lists the directory "-a"
|
76
|
+
Then the file list should be in long form
|
77
|
+
And the file list should contain "foo"
|
78
|
+
And the file list should contain "bar"
|
79
|
+
|
80
|
+
Scenario: Missing directory
|
81
|
+
Given a successful login
|
82
|
+
When the client successfully lists the directory "missing/file"
|
83
|
+
Then the file list should be empty
|
84
|
+
|
85
|
+
Scenario: Not logged in
|
86
|
+
Given a successful connection
|
87
|
+
When the client lists the directory
|
88
|
+
Then the server returns a not logged in error
|
89
|
+
|
90
|
+
Scenario: List not enabled
|
91
|
+
Given the test server lacks list
|
92
|
+
And a successful login
|
93
|
+
When the client lists the directory
|
94
|
+
Then the server returns an unimplemented command error
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Feature: List TLS
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to list files
|
5
|
+
So that I can see what file to transfer
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server has TLS mode "explicit"
|
9
|
+
And the test server is started
|
10
|
+
|
11
|
+
Scenario: Active
|
12
|
+
Given a successful login with explicit TLS
|
13
|
+
And the server has file "foo"
|
14
|
+
And the server has file "bar"
|
15
|
+
And the client is in active mode
|
16
|
+
When the client successfully lists the directory
|
17
|
+
Then the file list should be in long form
|
18
|
+
And the file list should contain "foo"
|
19
|
+
And the file list should contain "bar"
|
20
|
+
|
21
|
+
Scenario: Passive
|
22
|
+
Given a successful login with explicit TLS
|
23
|
+
And the server has file "foo"
|
24
|
+
And the server has file "bar"
|
25
|
+
And the client is in passive mode
|
26
|
+
When the client successfully lists the directory
|
27
|
+
Then the file list should be in long form
|
28
|
+
And the file list should contain "foo"
|
29
|
+
And the file list should contain "bar"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Feature: Logging
|
2
|
+
|
3
|
+
As a programmer
|
4
|
+
I want to see logging output
|
5
|
+
So that I can fix FTP protocol problems
|
6
|
+
|
7
|
+
Scenario: Logging enabled
|
8
|
+
Given the test server has logging enabled
|
9
|
+
And the test server is started
|
10
|
+
And a successful login
|
11
|
+
Then the server should have written log output
|
@@ -0,0 +1,51 @@
|
|
1
|
+
Feature: Login
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to log in
|
5
|
+
So that I can transfer files
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server has auth level "AUTH_ACCOUNT"
|
9
|
+
And the test server is started
|
10
|
+
|
11
|
+
Scenario: Normal connection
|
12
|
+
Given a successful login
|
13
|
+
Then the server returns no error
|
14
|
+
And the client should be logged in
|
15
|
+
|
16
|
+
Scenario: Bad user
|
17
|
+
Given the client connects
|
18
|
+
When the client logs in with bad user
|
19
|
+
Then the server returns a login incorrect error
|
20
|
+
And the client should not be logged in
|
21
|
+
|
22
|
+
Scenario: Bad password
|
23
|
+
Given a successful connection
|
24
|
+
When the client logs in with bad password
|
25
|
+
Then the server returns a login incorrect error
|
26
|
+
And the client should not be logged in
|
27
|
+
|
28
|
+
Scenario: Bad account
|
29
|
+
Given a successful connection
|
30
|
+
When the client logs in with bad account
|
31
|
+
Then the server returns a login incorrect error
|
32
|
+
And the client should not be logged in
|
33
|
+
|
34
|
+
Scenario: ACCT without parameter
|
35
|
+
Given a successful connection
|
36
|
+
And the client sends a user
|
37
|
+
And the client sends a password
|
38
|
+
When the client sends "ACCT"
|
39
|
+
Then the server returns a syntax error
|
40
|
+
|
41
|
+
Scenario: PASS not followed by ACCT
|
42
|
+
Given a successful connection
|
43
|
+
And the client sends a user
|
44
|
+
And the client sends a password
|
45
|
+
When the client sends "NOOP"
|
46
|
+
Then the server returns a bad sequence error
|
47
|
+
|
48
|
+
Scenario: ACCT out of sequence
|
49
|
+
Given a successful connection
|
50
|
+
When the client sends "ACCT"
|
51
|
+
Then the server returns a bad sequence error
|
@@ -0,0 +1,59 @@
|
|
1
|
+
Feature: Login
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to log in
|
5
|
+
So that I can transfer files
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server has auth level "AUTH_PASSWORD"
|
9
|
+
And the test server is started
|
10
|
+
|
11
|
+
Scenario: Normal connection
|
12
|
+
Given a successful login
|
13
|
+
Then the server returns no error
|
14
|
+
And the client should be logged in
|
15
|
+
|
16
|
+
Scenario: Bad user
|
17
|
+
Given the client connects
|
18
|
+
When the client logs in with bad user
|
19
|
+
Then the server returns a login incorrect error
|
20
|
+
And the client should not be logged in
|
21
|
+
|
22
|
+
Scenario: Bad password
|
23
|
+
Given a successful connection
|
24
|
+
When the client logs in with bad password
|
25
|
+
Then the server returns a login incorrect error
|
26
|
+
And the client should not be logged in
|
27
|
+
|
28
|
+
Scenario: Already logged in
|
29
|
+
Given a successful login
|
30
|
+
When the client logs in
|
31
|
+
Then the server returns a bad sequence error
|
32
|
+
And the client should be logged in
|
33
|
+
|
34
|
+
Scenario: PASS when already logged in
|
35
|
+
Given a successful login
|
36
|
+
When the client sends a password
|
37
|
+
Then the server returns a bad sequence error
|
38
|
+
|
39
|
+
Scenario: PASS after failed login
|
40
|
+
Given a failed login
|
41
|
+
When the client sends a password
|
42
|
+
Then the server returns a bad sequence error
|
43
|
+
|
44
|
+
Scenario: PASS without USER
|
45
|
+
Given a successful connection
|
46
|
+
And the client sends a password
|
47
|
+
Then the server returns a bad sequence error
|
48
|
+
|
49
|
+
Scenario: PASS without parameter
|
50
|
+
Given a successful connection
|
51
|
+
And the client sends a user
|
52
|
+
When the client sends a password with no parameter
|
53
|
+
Then the server returns a syntax error
|
54
|
+
|
55
|
+
Scenario: USER not followed by PASS
|
56
|
+
Given a successful connection
|
57
|
+
And the client sends a user
|
58
|
+
When the client sends "NOOP"
|
59
|
+
Then the server returns a bad sequence error
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Feature: Login
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to log in
|
5
|
+
So that I can transfer files
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server has auth level "AUTH_USER"
|
9
|
+
And the test server is started
|
10
|
+
|
11
|
+
Scenario: Normal connection
|
12
|
+
Given a successful login
|
13
|
+
Then the server returns no error
|
14
|
+
And the client should be logged in
|
15
|
+
|
16
|
+
Scenario: Bad user
|
17
|
+
Given the client connects
|
18
|
+
When the client logs in with bad user
|
19
|
+
Then the server returns a login incorrect error
|
20
|
+
And the client should not be logged in
|
21
|
+
|
22
|
+
Scenario: Already logged in
|
23
|
+
Given a successful login
|
24
|
+
When the client logs in
|
25
|
+
Then the server returns a bad sequence error
|
26
|
+
And the client should be logged in
|
27
|
+
|
28
|
+
Scenario: USER without parameter
|
29
|
+
Given a successful connection
|
30
|
+
And the client sends a user with no parameter
|
31
|
+
Then the server returns a syntax error
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Feature: Max Connections
|
2
|
+
|
3
|
+
As an administrator
|
4
|
+
I want to limit the number of connections
|
5
|
+
To prevent overload
|
6
|
+
|
7
|
+
Scenario: Total connections
|
8
|
+
Given the test server has max_connections set to 2
|
9
|
+
And the test server is started
|
10
|
+
And the 1st client connects
|
11
|
+
And the 2nd client connects
|
12
|
+
When the 3rd client tries to connect
|
13
|
+
Then the server returns a too many connections error
|
14
|
+
|
15
|
+
Scenario: Connections per user
|
16
|
+
And the test server has max_connections_per_ip set to 1
|
17
|
+
And the test server is started
|
18
|
+
And the 1st client connects from 127.0.0.1
|
19
|
+
And the 2nd client connects from 127.0.0.2
|
20
|
+
When the 3rd client tries to connect from 127.0.0.2
|
21
|
+
Then the server returns a too many connections error
|
22
|
+
|
23
|
+
Scenario: TLS
|
24
|
+
Given the test server has max_connections set to 2
|
25
|
+
And the test server has TLS mode "explicit"
|
26
|
+
And the test server is started
|
27
|
+
And the 1st client connects
|
28
|
+
And the 2nd client connects
|
29
|
+
When the 3rd client tries to connect
|
30
|
+
Then the server returns a too many connections error
|
31
|
+
|
32
|
+
Scenario: Connections per user, TLS
|
33
|
+
And the test server has max_connections_per_ip set to 1
|
34
|
+
And the test server has TLS mode "explicit"
|
35
|
+
And the test server is started
|
36
|
+
And the 1st client connects from 127.0.0.1
|
37
|
+
And the 2nd client connects from 127.0.0.2
|
38
|
+
When the 3rd client tries to connect from 127.0.0.2
|
39
|
+
Then the server returns a too many connections error
|
@@ -0,0 +1,53 @@
|
|
1
|
+
Feature: MDTM
|
2
|
+
|
3
|
+
As a client
|
4
|
+
I want to get a file's modification time
|
5
|
+
So that I can detect when it changes
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given the test server is started
|
9
|
+
|
10
|
+
Scenario: File in current directory
|
11
|
+
Given a successful login
|
12
|
+
And the server has file "ascii_unix"
|
13
|
+
And the file "ascii_unix" has mtime "2014-01-02 13:14:15.123456"
|
14
|
+
When the client successfully gets mtime of "ascii_unix"
|
15
|
+
Then the reported mtime should be "20140102131415"
|
16
|
+
|
17
|
+
Scenario: File in subdirectory
|
18
|
+
Given a successful login
|
19
|
+
And the server has file "foo/ascii_unix"
|
20
|
+
Then the client successfully gets mtime of "foo/ascii_unix"
|
21
|
+
|
22
|
+
Scenario: Non-root working directory
|
23
|
+
Given a successful login
|
24
|
+
And the server has file "foo/ascii_unix"
|
25
|
+
And the client successfully cd's to "foo"
|
26
|
+
Then the client successfully gets mtime of "ascii_unix"
|
27
|
+
|
28
|
+
Scenario: Access denied
|
29
|
+
Given a successful login
|
30
|
+
When the client gets mtime of "forbidden"
|
31
|
+
Then the server returns an access denied error
|
32
|
+
|
33
|
+
Scenario: Missing file
|
34
|
+
Given a successful login
|
35
|
+
When the client gets mtime of "foo"
|
36
|
+
Then the server returns a not found error
|
37
|
+
|
38
|
+
Scenario: Not logged in
|
39
|
+
Given a successful connection
|
40
|
+
When the client gets mtime of "foo"
|
41
|
+
Then the server returns a not logged in error
|
42
|
+
|
43
|
+
Scenario: Missing path
|
44
|
+
Given a successful login
|
45
|
+
When the client gets mtime with no path
|
46
|
+
Then the server returns a syntax error
|
47
|
+
|
48
|
+
Scenario: List not enabled
|
49
|
+
Given the test server lacks list
|
50
|
+
And a successful login
|
51
|
+
And the server has file "foo"
|
52
|
+
When the client gets mtime of "foo"
|
53
|
+
Then the server returns an unimplemented command error
|