On Mon, Jun 09, 2025 at 12:34:19PM GMT, Frank Li wrote:
> Add doorbell test case.
> 

This also warrants a documentation change.

- Mani

> Signed-off-by: Frank Li <frank...@nxp.com>
> ---
> change from v14 to v16
> - Add set IRQ type
> 
> change from v13 to v14
> - merge to selftests framework
> ---
>  .../selftests/pci_endpoint/pci_endpoint_test.c     | 28 
> ++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c 
> b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
> index ac26481d29d9d..da0db0e7c9693 100644
> --- a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
> +++ b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c
> @@ -229,4 +229,32 @@ TEST_F(pci_ep_data_transfer, COPY_TEST)
>                                        test_size[i]);
>       }
>  }
> +
> +FIXTURE(pcie_ep_doorbell)
> +{
> +     int fd;
> +};
> +
> +FIXTURE_SETUP(pcie_ep_doorbell)
> +{
> +     self->fd = open(test_device, O_RDWR);
> +
> +     ASSERT_NE(-1, self->fd) TH_LOG("Can't open PCI Endpoint Test device");
> +};
> +
> +FIXTURE_TEARDOWN(pcie_ep_doorbell)
> +{
> +     close(self->fd);
> +};
> +
> +TEST_F(pcie_ep_doorbell, DOORBELL_TEST)
> +{
> +     int ret;
> +
> +     pci_ep_ioctl(PCITEST_SET_IRQTYPE, PCITEST_IRQ_TYPE_AUTO);
> +     ASSERT_EQ(0, ret) TH_LOG("Can't set AUTO IRQ type");
> +
> +     pci_ep_ioctl(PCITEST_DOORBELL, 0);
> +     EXPECT_FALSE(ret) TH_LOG("Test failed for Doorbell\n");
> +}
>  TEST_HARNESS_MAIN
> 
> -- 
> 2.34.1
> 

-- 
மணிவண்ணன் சதாசிவம்

Reply via email to