| #!/bin/sh |
| # SPDX-License-Identifier: GPL-2.0 |
| # description: Test trace remote unloading |
| # requires: remotes/test |
| |
| . $TEST_DIR/remotes/functions |
| |
| test_unloading() |
| { |
| # No reader, writing |
| assert_loaded |
| |
| # No reader, no writing |
| echo 0 > tracing_on |
| assert_unloaded |
| |
| # 1 reader, no writing |
| cat trace_pipe & |
| pid=$! |
| sleep 1 |
| assert_loaded |
| kill $pid |
| assert_unloaded |
| |
| # No reader, no writing, events |
| echo 1 > tracing_on |
| echo 1 > write_event |
| echo 0 > tracing_on |
| assert_loaded |
| |
| # Test reset |
| clear_trace |
| assert_unloaded |
| } |
| |
| if [ -z "$SOURCE_REMOTE_TEST" ]; then |
| set -e |
| |
| setup_remote_test |
| test_unloading |
| fi |