libtracefs: Fix tracefs_tracing_dir() mount test

The tracefs_tracing_dir() test was broken. The pre-test setup already
called tracing_tracing_dir() and cached the value. When the mounting test
ran, it unmounted the tracefs directory, and then called the
tracefs_tracing_dir() again, which just returned the cached value, leaving
the tracefs file system unmounted. This had the test incorrectly pass, but
then broke the tests after that.

Add a check to make sure that the content in both the mounted tracefs
directory and the debugfs directory exists.

Link: https://lore.kernel.org/linux-trace-devel/20221210191034.26a1b156@gandalf.local.home

Fixes: e6daa60cca ("libtracefs: Add unit test to test mounting of tracefs_{tracing,debug}_dir()")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed