diff options
author | Raimo Niskanen <[email protected]> | 2016-03-07 11:13:53 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2016-03-07 11:13:53 +0100 |
commit | c5ef73b4a587bf8f2e7b7b3d74fe917fdbe6153f (patch) | |
tree | a60204b6111e70f6de7460045e6988653a1d4f62 /lib/inets/test | |
parent | 2de2dfd3e18eaba3f994a0cfa490957ee8a49686 (diff) | |
parent | dda67a46e848196fc8603e696a1e2dd55b69e75b (diff) | |
download | otp-c5ef73b4a587bf8f2e7b7b3d74fe917fdbe6153f.tar.gz otp-c5ef73b4a587bf8f2e7b7b3d74fe917fdbe6153f.tar.bz2 otp-c5ef73b4a587bf8f2e7b7b3d74fe917fdbe6153f.zip |
Merge branch 'msantos/tftp-wrap-block-counter/PR-965' into maint
* msantos/tftp-wrap-block-counter/PR-965:
tftp: support transfer of files > 65535 blocks
Diffstat (limited to 'lib/inets/test')
-rw-r--r-- | lib/inets/test/tftp_SUITE.erl | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/lib/inets/test/tftp_SUITE.erl b/lib/inets/test/tftp_SUITE.erl index d29d210d7d..497a50e654 100644 --- a/lib/inets/test/tftp_SUITE.erl +++ b/lib/inets/test/tftp_SUITE.erl @@ -76,7 +76,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [simple, extra, reuse_connection, resend_client, - resend_server]. + resend_server, large_file]. groups() -> []. @@ -902,6 +902,41 @@ reuse_connection(Config) when is_list(Config) -> ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Large file: transfer > 65535 blocks +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +large_file(doc) -> + ["Start the daemon and test transfer of files greater than 32M."]; +large_file(suite) -> + []; +large_file(Config) when is_list(Config) -> + ?VERIFY(ok, application:start(inets)), + + {Port, DaemonPid} = ?IGNORE(?START_DAEMON(0, [{debug, brief}])), + + %% Read fail + RemoteFilename = "tftp_temporary_large_file_remote_test_file.txt", + LocalFilename = "tftp_temporary_large_file_local_test_file.txt", + + {ok, FH} = file:open(LocalFilename, [write,exclusive]), + {ok, Size} = file:position(FH, {eof, 2*512*65535}), + ok = file:truncate(FH), + ?IGNORE(file:close(FH)), + + %% Write and read + ?VERIFY({ok, Size}, tftp:write_file(RemoteFilename, LocalFilename, [{port, Port}])), + ?IGNORE(file:delete(LocalFilename)), + ?VERIFY({ok, Size}, tftp:read_file(RemoteFilename, LocalFilename, [{port, Port}])), + + %% Cleanup + unlink(DaemonPid), + exit(DaemonPid, kill), + ?VERIFY(ok, file:delete(LocalFilename)), + ?VERIFY(ok, file:delete(RemoteFilename)), + ?VERIFY(ok, application:stop(inets)), + ok. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Goodies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |