report_upload.py: Fix ftps upload method and help in gooftool
This CL fix the bug in report_upload.py to upload through curl.
Currently CurlCommand will stuck forever if there is no
success_string or abort_string while upload command succeeded.
This CL fix this bug.
Also, this CL enables the function of success_string and
abort_string by passing '-v --stderr -' to enable verbose mode and
redirect stderr to stdout for string matching.
Also, fix help in gooftool report_upload to omit 'custom' as upload
method and modify curl into ftps.
BUG=chrome-os-partner:13783
TEST=1.run vsftpd for ftps server on desktop.
2,on dut with factory image do
/usr/local/factory/bin/gooftool upload_report --upload_method
'ftps://<server_ip>:<port> -u <username:password> -k'
will upload successfully.
Due to security issue I did not enable anonymous mode on my
desktop, so I have to speficy -u for username/password.
I also don't have a certified certificate on my ftps so I have to
pass -k/--insecure to curl.
3.Unplug ethernet while uploading will resulting a retry until
success.
4.set abort_string and success_string in gooftool.py to test the
function. Currently this has not been exposed to user yet.
Original Change-Id: Ic46bc378309e2b007ef0b1a1c7fc472df4b65537
Original Reviewed-on: https://gerrit.chromium.org/gerrit/32648
Original Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Original Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
(cherry picked from commit e11e664da7e898998d21526bbfcd06d2c17c66bc)
Change-Id: Ib10e6f12e72a84343006e2f045349b3ec33ce9d8
Reviewed-on: https://gerrit.chromium.org/gerrit/33597
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
diff --git a/py/gooftool/gooftool.py b/py/gooftool/gooftool.py
index a84f913..4ff7aab 100755
--- a/py/gooftool/gooftool.py
+++ b/py/gooftool/gooftool.py
@@ -677,7 +677,7 @@
_upload_method_cmd_arg = CmdArg(
'--upload_method', metavar='METHOD:PARAM',
help=('How to perform the upload. METHOD should be one of '
- '{ftp, shopfloor, curl, cpfe, custom}.'))
+ '{ftp, shopfloor, ftps, cpfe}.'))
_add_file_cmd_arg = CmdArg(
'--add_file', metavar='FILE', action='append',
help='Extra file to include in report (must be an absolute path)')