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