dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0076-tcurl-test-add-support-for-raw-output.patch

bb7cd1
From 961abf2d35e296fe2b12b2b48c5d3fc67c0bc779 Mon Sep 17 00:00:00 2001
bb7cd1
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
bb7cd1
Date: Fri, 24 Feb 2017 12:23:22 +0100
bb7cd1
Subject: [PATCH 76/90] tcurl test: add support for raw output
bb7cd1
bb7cd1
Reviewed-by: Simo Sorce <simo@redhat.com>
bb7cd1
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
bb7cd1
(cherry picked from commit 36e49a842e257ac9bde71728ee3bef4299b6e6e2)
bb7cd1
---
bb7cd1
 src/tests/tcurl_test_tool.c | 9 +++++++++
bb7cd1
 1 file changed, 9 insertions(+)
bb7cd1
bb7cd1
diff --git a/src/tests/tcurl_test_tool.c b/src/tests/tcurl_test_tool.c
bb7cd1
index e5fc9705db415650d849b89c3d18e41574b7e28b..7d3bc19f0ec7e118e251247536d25c58fe009f54 100644
bb7cd1
--- a/src/tests/tcurl_test_tool.c
bb7cd1
+++ b/src/tests/tcurl_test_tool.c
bb7cd1
@@ -36,6 +36,7 @@ struct tool_ctx {
bb7cd1
 struct tool_options {
bb7cd1
     int debug;
bb7cd1
     int verbose;
bb7cd1
+    int raw;
bb7cd1
 
bb7cd1
     enum tcurl_http_method method;
bb7cd1
     const char *socket_path;
bb7cd1
@@ -173,6 +174,13 @@ prepare_requests(TALLOC_CTX *mem_ctx,
bb7cd1
             goto done;
bb7cd1
         }
bb7cd1
 
bb7cd1
+        if (opts->raw) {
bb7cd1
+            ret = tcurl_req_enable_rawoutput(requests[i]);
bb7cd1
+            if (ret != EOK) {
bb7cd1
+                goto done;
bb7cd1
+            }
bb7cd1
+        }
bb7cd1
+
bb7cd1
         i++;
bb7cd1
     }
bb7cd1
 
bb7cd1
@@ -270,6 +278,7 @@ int main(int argc, const char *argv[])
bb7cd1
         { "put", 'p', POPT_ARG_NONE, NULL, 'p', "Perform a HTTP PUT", NULL },
bb7cd1
         { "post", 'o', POPT_ARG_NONE, NULL, 'o', "Perform a HTTP POST", NULL },
bb7cd1
         { "del", 'd', POPT_ARG_NONE, NULL, 'd', "Perform a HTTP DELETE", NULL },
bb7cd1
+        { "raw", 'r', POPT_ARG_NONE, &opts.raw, '\0', "Print raw protocol output", NULL },
bb7cd1
         { "verbose", 'v', POPT_ARG_NONE, &opts.verbose, '\0', "Print response code and body", NULL },
bb7cd1
         POPT_TABLEEND
bb7cd1
     };
bb7cd1
-- 
bb7cd1
2.9.3
bb7cd1