diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-18 10:40:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-18 10:40:18 +0200 |
commit | ed93e07b1b7a9e0ba99609a9223e43247ff4224e (patch) | |
tree | aa203bdab5a5fc4f5fd8af16baf6903a7ee3dde0 /tests/curl/testscript | |
parent | 4408607c51a7c6e293adae41403b21d4a2c9a429 (diff) |
Implement curl process
Diffstat (limited to 'tests/curl/testscript')
-rw-r--r-- | tests/curl/testscript | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/curl/testscript b/tests/curl/testscript new file mode 100644 index 0000000..e41aeb6 --- /dev/null +++ b/tests/curl/testscript @@ -0,0 +1,57 @@ +# file : tests/curl/testscript +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +#\ + +TFTP server (tftp-hpa) setup: from the test out_base, run (sudo is required +for --secure/chroot): + +sudo /usr/sbin/in.tftpd \ + --foreground \ + --address 127.0.0.1:55123 \ + --user "$(whoami)" \ + --permissive \ + --create \ + --secure \ + "$(pwd)" + +#\ + +: tftp +: +{ + echo 'foo' >=foo-src; + + $* 'tftp' &foo &bar 2>>EOE; + + curl -s -S tftp://localhost:55123/test-driver/tftp/foo + curl: (68) TFTP: File Not Found + + curl -s -S --upload-file foo-src tftp://localhost:55123/test-driver/tftp/foo + + curl -s -S --upload-file - tftp://localhost:55123/test-driver/tftp/bar + + curl -s -S tftp://localhost:55123/test-driver/tftp/foo + + curl -s -S tftp://localhost:55123/test-driver/tftp/foo + EOE + + diff -u foo-src foo; + diff -u - bar <'bar' +} + +: http +: +{ + $* 'http' 2>>EOE + + curl -s -S --fail --location https://build2.org/bogus + curl: (22) The requested URL returned error: 404 Not Found + + curl -s -S --fail --location https://build2.org + + curl -s -S --fail --location --data-binary @- https://build2.org/bogus + curl: (22) The requested URL returned error: 404 Not Found + EOE +} |