Fix: pass `inputs` parameter to implicit `src.ctf.lttng-live`, not `url`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 16 Aug 2019 22:06:41 +0000 (18:06 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 17 Aug 2019 05:31:12 +0000 (01:31 -0400)
Since the `src.ctf.lttng-live` component class started to handle the
`babeltrace.support-info` query object, its component accepts the
`inputs` array parameter, not the `url` string parameter.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I5d74a16c50ba16518a12be9064afd604c456e3fb
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1959
Tested-by: jenkins <jenkins@lttng.org>
src/cli/babeltrace2-cfg-cli-args.c
tests/cli/convert/test_convert_args

index 1bc0aade21ea532c25e8c511cbde92d3b067e858..1246fe8889457ff1727627084e9c7d9e0860f977 100644 (file)
@@ -3174,6 +3174,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
        struct bt_argpar_parse_ret argpar_parse_ret = { 0 };
        GString *name_gstr = NULL;
        GString *component_arg_for_run = NULL;
+       bt_value *live_inputs_array_val = NULL;
 
        /*
         * Array of `struct implicit_component_args *` created for the sources
@@ -3998,9 +3999,22 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                goto end;
                        }
 
-                       ret = append_implicit_component_extra_param(
-                               &implicit_lttng_live_args, "url",
-                               bt_value_string_get(bt_val_non_opt));
+                       live_inputs_array_val = bt_value_array_create();
+                       if (!live_inputs_array_val) {
+                               BT_CLI_LOGE_APPEND_CAUSE_OOM();
+                               goto error;
+                       }
+
+                       if (bt_value_array_append_string_element(
+                                       live_inputs_array_val,
+                                       bt_value_string_get(bt_val_non_opt))) {
+                               BT_CLI_LOGE_APPEND_CAUSE_OOM();
+                               goto error;
+                       }
+
+                       ret = append_parameter_to_args(
+                               implicit_lttng_live_args.extra_params,
+                               "inputs", live_inputs_array_val);
                        if (ret) {
                                goto error;
                        }
@@ -4339,6 +4353,7 @@ end:
                g_string_free(name_gstr, TRUE);
        }
 
+       bt_value_put_ref(live_inputs_array_val);
        bt_value_put_ref(run_args);
        bt_value_put_ref(all_names);
        destroy_glist_of_gstring(source_names);
index 50ef0936512082107470b1df420b40399a128310..c59e41a7612788e185d38334424bf8a6284a7483 100755 (executable)
@@ -134,7 +134,7 @@ test_bt_convert_run_args 'path non-option arg + --names=all' "--names=all $path_
 test_bt_convert_run_args 'path non-option arg + --no-delta' "$path_to_trace --no-delta" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --params no-delta=yes --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path non-option arg + --output' "$path_to_trace --output $output_path" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --params 'path=\"$output_path\"' --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path non-option arg + -i ctf' "$path_to_trace -i ctf" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
-test_bt_convert_run_args 'URL non-option arg + -i lttng-live' 'net://some-host/host/target/session -i lttng-live' "--component lttng-live:source.ctf.lttng-live --params 'url=\"net://some-host/host/target/session\"' --params 'session-not-found-action=\"end\"' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --connect lttng-live:muxer --connect muxer:pretty"
+test_bt_convert_run_args 'URL non-option arg + -i lttng-live' 'net://some-host/host/target/session -i lttng-live' "--component lttng-live:source.ctf.lttng-live --params 'inputs=[\"net://some-host/host/target/session\"]' --params 'session-not-found-action=\"end\"' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --connect lttng-live:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path non-option arg + -o dummy' "$path_to_trace -o dummy" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component dummy:sink.utils.dummy --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:dummy"
 test_bt_convert_run_args 'path non-option arg + -o ctf + --output' "$path_to_trace -o ctf --output $output_path" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component sink-ctf-fs:sink.ctf.fs --params 'path=\"$output_path\"' --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:sink-ctf-fs"
 test_bt_convert_run_args 'path non-option arg + user sink with log level' "$path_to_trace -c sink.mein.sink -lW" "--component sink.mein.sink:sink.mein.sink --log-level W --component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect 'muxer:sink\.mein\.sink'"
This page took 0.027952 seconds and 4 git commands to generate.