From patchwork Wed Jan 24 12:33:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 136103 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4938D439B5; Wed, 24 Jan 2024 13:33:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AA0740294; Wed, 24 Jan 2024 13:33:50 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id D3C7C4026F for ; Wed, 24 Jan 2024 13:33:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706099628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rzCZ831oMRsqGZkjQxsenNfwWfnzNllTJbBrD291fzw=; b=QaWzHdDcHS1N6jWZ/oo0kPeHxJ1raSthv+YYb4CHQXXQMBzX0izIAXyI8AsEsLnXRfhkd4 zTuIeLUmf+AJSLVWtq9fX5+QHp0pltjAqCUoU2gd4/mbUDVyC3w80VLpTyVPoss9Naa6Oz PhREnVERlcIkK0MzUtv73zHnqZC0TYA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-n10CTJ4PPgqfWvewTks76w-1; Wed, 24 Jan 2024 07:33:47 -0500 X-MC-Unique: n10CTJ4PPgqfWvewTks76w-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D30921C07F24; Wed, 24 Jan 2024 12:33:46 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2CE8492BFA; Wed, 24 Jan 2024 12:33:45 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: alosadag@redhat.com, stable@dpdk.org, Jerin Jacob , Bruce Richardson Subject: [PATCH] test/event: skip test if no driver is present Date: Wed, 24 Jan 2024 13:33:38 +0100 Message-ID: <20240124123338.551436-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Align eventdev with what other device abstraction libraries do: if no driver is present, skip the tests. Fixes: f8f9d233ea0e ("test/eventdev: add unit tests") Cc: stable@dpdk.org Signed-off-by: David Marchand --- app/test/test_eventdev.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c index 71de947ce4..e4e234dc98 100644 --- a/app/test/test_eventdev.c +++ b/app/test/test_eventdev.c @@ -33,9 +33,15 @@ testsuite_setup(void) uint8_t count; count = rte_event_dev_count(); if (!count) { + int ret; + printf("Failed to find a valid event device," - " testing with event_skeleton device\n"); - return rte_vdev_init("event_skeleton", NULL); + " trying with event_skeleton device\n"); + ret = rte_vdev_init("event_skeleton", NULL); + if (ret != 0) { + printf("No event device, skipping\n"); + return TEST_SKIPPED; + } } return TEST_SUCCESS; }