tests: make test_intersection use bt_cli, test error cases
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 19 Sep 2019 19:45:53 +0000 (15:45 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 15 Oct 2019 18:09:56 +0000 (14:09 -0400)
commit064b8bc4ef30f6fc307827e0e9a18c82caa0c17f
tree929cbe1399b637288cdff1f93755f6aab768e96b
parent27a1afa74b56f211aa0a44acf268501b73c15aa9
tests: make test_intersection use bt_cli, test error cases

The way test_intersection is written doesn't make it check whether the
babeltrace2 binary exits with success or failure.  In two cases
(nointersect and nostream), the babeltrace2 binary errors out, but it
isn't explicitly validated by the test, so it's unclear whether this is
the behavior we want.  The test just validates that nothing is output on
stdout, but that could happen because the process prints nothing and
exits with success, or because it prints an error on stderr and exits
with a failure status code.

This patch improves the test by making it use bt_cli instead of running
the babeltrace2 binary directly.  This helps when troubleshooting the
test, since bt_cli prints the full command line with which it invokes
babeltrace2.

Then, it makes the test check the exit status of babeltrace2.  In the
cases nointersect and nostream, we validate that it exits with a
non-zero status code, and that it prints an expected error string on
stderr.  It adds a relatively trivial call to
BT_COMP_CLASS_LOGE_APPEND_CAUSE in the src.ctf.fs query code to make the
error message clearer in the nostream case.

I don't know if the current behavior of babeltrace2 in these two cases
is the one we want, but the goal of this patch is merely to update the
test to better test the current behavior.  If we'd like a different
behavior, we can always modify babeltrace2 and the test later.

Change-Id: I1d6e616005369e397c98bdb1e40407e4e3959cc9
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2068
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/fs-src/query.c
tests/cli/test_intersection
This page took 0.02422 seconds and 4 git commands to generate.