xref: /spdk/test/interrupt/reap_unregistered_poller.sh (revision 0098e636761237b77c12c30c2408263a5d2260cc)
1#!/usr/bin/env bash
2
3testdir=$(readlink -f $(dirname $0))
4rootdir=$(readlink -f $testdir/../..)
5source $rootdir/test/common/autotest_common.sh
6source $testdir/interrupt_common.sh
7
8export PYTHONPATH=$PYTHONPATH:$rootdir/examples/interrupt_tgt
9
10# Set reactors with intr_tgt in intr mode
11start_intr_tgt
12
13# Record names of native created pollers.
14app_thread=$(rpc_cmd thread_get_pollers | jq -r '.threads[0]')
15native_pollers=$(jq -r '.active_pollers[].name' <<< $app_thread)
16native_pollers+=" "
17native_pollers+=$(jq -r '.timed_pollers[].name' <<< $app_thread)
18
19# Create one aio_bdev.
20# During the creation, vbdev examine process will get bdev_aio create
21# pollers like bdev_aio_group_poll poller, and then unregister it.
22setup_bdev_aio
23
24# Record names of remaining pollers.
25app_thread=$(rpc_cmd thread_get_pollers | jq -r '.threads[0]')
26remaining_pollers=$(jq -r '.active_pollers[].name' <<< $app_thread)
27remaining_pollers+=" "
28remaining_pollers+=$(jq -r '.timed_pollers[].name' <<< $app_thread)
29
30# Since bdev_aio created pollers were already unregistered, so
31# remaining_pollers should be same with native_pollers.
32[[ "$remaining_pollers" == "$native_pollers" ]]
33
34trap - SIGINT SIGTERM EXIT
35killprocess $intr_tgt_pid
36cleanup
37