get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2230822/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2230822,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230822/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/ltp/patch/20260501151420.1042995-1-priyama2@linux.ibm.com/",
    "project": {
        "id": 59,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/59/?format=api",
        "name": "Linux Test Project development",
        "link_name": "ltp",
        "list_id": "ltp.lists.linux.it",
        "list_email": "ltp@lists.linux.it",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260501151420.1042995-1-priyama2@linux.ibm.com>",
    "date": "2026-05-01T15:14:20",
    "name": "[v3] testcases/kernel/device-drivers/nvme: Add NVMe device discovery test",
    "commit_ref": null,
    "pull_url": null,
    "state": "needs-review-ack",
    "archived": false,
    "hash": "e729e38cc0076389e9194ecf78892fb657941d65",
    "submitter": {
        "id": 93267,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93267/?format=api",
        "name": "priyama2",
        "email": "priyama2@linux.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ltp/patch/20260501151420.1042995-1-priyama2@linux.ibm.com/mbox/",
    "series": [
        {
            "id": 502197,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502197/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/ltp/list/?series=502197",
            "date": "2026-05-01T15:14:20",
            "name": "[v3] testcases/kernel/device-drivers/nvme: Add NVMe device discovery test",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/502197/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2230822/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/2230822/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ltp@lists.linux.it"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ltp@picard.linux.it"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=p80o3jae;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=213.254.12.146; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from picard.linux.it (picard.linux.it [213.254.12.146])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5j116p0dz1yGq\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 15:10:29 +1000 (AEST)",
            "from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id 513B23E1A52\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 07:10:26 +0200 (CEST)",
            "from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 743143E0E7A\n for <ltp@lists.linux.it>; Thu, 30 Apr 2026 07:10:22 +0200 (CEST)",
            "from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n [148.163.158.5])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 9AAE9600749\n for <ltp@lists.linux.it>; Thu, 30 Apr 2026 07:10:21 +0200 (CEST)",
            "from pps.filterd (m0356516.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63THKaJR2036575; Thu, 30 Apr 2026 05:10:19 GMT",
            "from ppma11.dal12v.mail.ibm.com\n (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4drk1jvgpe-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 30 Apr 2026 05:10:19 +0000 (GMT)",
            "from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1])\n by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 63U58w8l013487;\n Thu, 30 Apr 2026 05:10:18 GMT",
            "from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6])\n by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4dsamyh8c5-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 30 Apr 2026 05:10:18 +0000 (GMT)",
            "from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com\n [10.39.53.232])\n by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 63U5AH8e64749908\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 30 Apr 2026 05:10:17 GMT",
            "from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 84C9058043;\n Thu, 30 Apr 2026 05:10:17 +0000 (GMT)",
            "from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 2A63658053;\n Thu, 30 Apr 2026 05:10:17 +0000 (GMT)",
            "from botlp69.isst.tadn.ibm.com (unknown [9.5.7.36])\n by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTP;\n Thu, 30 Apr 2026 05:10:17 +0000 (GMT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n :content-transfer-encoding:date:from:in-reply-to:message-id\n :mime-version:references:subject:to; s=pp1; bh=en6c89Ng9NQdeXySa\n gZOxmvAHvFEo+srAzzrw4eNqyY=; b=p80o3jaeZPpQ4WS2yPwCcoKEij4WOFV1J\n SqaXhBY8rIF4hidLHzYPyST92jSPR8SCQtg9nzg3yV1NLrSF2DWQjVk0yfaTCcID\n OK+prKfi8C9qKokFA3Hu1Hr0bqh9kQRoIqE4huu58K3uVHSPaZaqwiGcHRPMLmiD\n QKZY97Knxuwm+OtCN2u8N1YDLnh2GFIQMC+qHAwx0jZbXwcMBC3L0Yrub2oq89nG\n DtELR7HsH+kEn3u/PxZOb/kQOWoOEHpVjkL2p2mTAcnp2uLafyER4T9cl1NL4JBO\n 2NFQgEJ41h96tEDW7EC62rUpCSvMBQmKCsFCfZwJd0qOb7JqEIXaA==",
        "From": "priyama2@linux.ibm.com",
        "To": "ltp@lists.linux.it",
        "Date": "Fri,  1 May 2026 15:14:20 +0000",
        "Message-ID": "<20260501151420.1042995-1-priyama2@linux.ibm.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260428075302.7320ef7e3@imap1.dmz-prg2.suse.org>",
        "References": "<20260428075302.7320ef7e3@imap1.dmz-prg2.suse.org>",
        "MIME-Version": "1.0",
        "X-TM-AS-GCONF": "00",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDMwMDA0NSBTYWx0ZWRfX2/JDwTnLiYZ9\n 8VrOnpu9sdkIhUVNbbq/mUeA9tj7NLFMWS85C4LfrRuk9QSUQZJsfHDzXZ3P9kpIqknnWDtncKC\n gxUQ4tfSmkE+b94IBS6gWEs6JT18mXN45PF/JF7eaCvtYH0z89vS0BClhpDaRtW/tVZuuDrmY5U\n SOeYKXh68v8BPiDrFrCIMekYc+rpGR7UGoG/hwfFC5scrOmjGYhZh4heEQO/rG/H2wHg1nF4emh\n VorIsyKhXXVwDDNtQXsI1vJS5GBGhIYkoDH2YJQ3zWx6qArAwItwk9aW8qBEHVXBbYzet+G+pNb\n L32mfxwfB5zZ5BM/XX1TNn7cfNSgrMFju0jTqAi9AdPJOJU2JyxzWILtUmqLOSqdEtwto601l95\n Z/5tSJpPB3neySZ2kqSr/HgM/aFN1ItCAXVULtUXJPeHo3n7y1CW66WRQE5ss75ELNSBi3bvqbC\n ItspFgcBvjIc1K6W3mQ==",
        "X-Proofpoint-GUID": "9zi4XND94uTnvnPs2xcZxblBp3M2vF_8",
        "X-Proofpoint-ORIG-GUID": "9zi4XND94uTnvnPs2xcZxblBp3M2vF_8",
        "X-Authority-Analysis": "v=2.4 cv=MohiLWae c=1 sm=1 tr=0 ts=69f2e43b cx=c_pps\n a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VnNF1IyMAAAA:8 a=_TXCIjpbKOfXyxnRZMsA:9",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n phishscore=0 adultscore=0 suspectscore=0 bulkscore=0 spamscore=0\n priorityscore=1501 malwarescore=0 clxscore=1015 lowpriorityscore=0\n impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000\n definitions=main-2604300045",
        "X-Spam-Status": "No, score=1.3 required=7.0 tests=DATE_IN_FUTURE_24_48,\n DKIM_SIGNED,DKIM_VALID,SPF_HELO_NONE,SPF_PASS shortcircuit=no\n autolearn=disabled version=4.0.1",
        "X-Spam-Level": "*",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on in-5.smtp.seeweb.it",
        "X-Virus-Scanned": "clamav-milter 1.0.9 at in-5.smtp.seeweb.it",
        "X-Virus-Status": "Clean",
        "Subject": "[LTP] [PATCH v3] testcases/kernel/device-drivers/nvme: Add NVMe\n device discovery test",
        "X-BeenThere": "ltp@lists.linux.it",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Linux Test Project <ltp.lists.linux.it>",
        "List-Unsubscribe": "<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>",
        "List-Archive": "<http://lists.linux.it/pipermail/ltp/>",
        "List-Post": "<mailto:ltp@lists.linux.it>",
        "List-Help": "<mailto:ltp-request@lists.linux.it?subject=help>",
        "List-Subscribe": "<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it",
        "Sender": "\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"
    },
    "content": "From: priyama2 <priyama2@linux.ibm.com>\n\nThis test fills a gap in NVMe test coverage by validating basic device\nenumeration and driver binding, which are fundamental prerequisites for\nany NVMe functionality testing.\n\nThe test verifies:\n- Detection of NVMe controllers in /dev\n- Enumeration of namespaces for detected controllers\n- PCI enumeration (class code 0x010802)\n- NVMe driver binding\n\nChanges in v3:\n- Fix subject prefix to match directory path\n- Update copyright year to 2026\n- Add nvme to SUBDIRS in testcases/kernel/device-drivers/Makefile\n- Reset static variables at start of run() for -i support\n- Remove .needs_root (all operations are world-readable)\n- Use SAFE_FOPEN/SAFE_FCLOSE for PCI class file access\n- Use SAFE_READLINK for driver symlink reading\n- Add .gitignore entry for nvme01 binary\n- Add runtest/device-drivers entry for nvme01\n- Fix author field to use priyama2\n\nChanges in v2:\n- Use LTP buildsystem instead of standalone Makefile\n- Remove README file (use doc comments instead)\n- Add proper LTP documentation comment format\n- Use SAFE_OPENDIR() and SAFE_CLOSEDIR() macros\n- Remove obvious and redundant comments\n- Code cleanup and style improvements\n\nSigned-off-by: priyama2 <priyama2@linux.ibm.com>\n---\n runtest/device-drivers                        |   1 +\n testcases/kernel/device-drivers/Makefile      |   1 +\n .../kernel/device-drivers/nvme/.gitignore     |   1 +\n testcases/kernel/device-drivers/nvme/Makefile |   7 +\n testcases/kernel/device-drivers/nvme/nvme01.c | 205 ++++++++++++++++++\n 5 files changed, 215 insertions(+)\n create mode 100644 runtest/device-drivers\n create mode 100644 testcases/kernel/device-drivers/nvme/.gitignore\n create mode 100644 testcases/kernel/device-drivers/nvme/Makefile\n create mode 100644 testcases/kernel/device-drivers/nvme/nvme01.c",
    "diff": "diff --git a/runtest/device-drivers b/runtest/device-drivers\nnew file mode 100644\nindex 000000000..a7295584e\n--- /dev/null\n+++ b/runtest/device-drivers\n@@ -0,0 +1 @@\n+nvme01 nvme01\ndiff --git a/testcases/kernel/device-drivers/Makefile b/testcases/kernel/device-drivers/Makefile\nindex 229a50683..664f4cd18 100644\n--- a/testcases/kernel/device-drivers/Makefile\n+++ b/testcases/kernel/device-drivers/Makefile\n@@ -9,6 +9,7 @@ SUBDIRS\t\t:= acpi \\\n \t\t   block \\\n \t\t   cpufreq \\\n \t\t   locking \\\n+\t\t   nvme \\\n \t\t   pci \\\n \t\t   rcu \\\n \t\t   rtc \\\ndiff --git a/testcases/kernel/device-drivers/nvme/.gitignore b/testcases/kernel/device-drivers/nvme/.gitignore\nnew file mode 100644\nindex 000000000..c60bc210c\n--- /dev/null\n+++ b/testcases/kernel/device-drivers/nvme/.gitignore\n@@ -0,0 +1 @@\n+nvme01\ndiff --git a/testcases/kernel/device-drivers/nvme/Makefile b/testcases/kernel/device-drivers/nvme/Makefile\nnew file mode 100644\nindex 000000000..d47e99e6a\n--- /dev/null\n+++ b/testcases/kernel/device-drivers/nvme/Makefile\n@@ -0,0 +1,7 @@\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (c) 2024 IBM Corporation\n+\n+top_srcdir\t?= ../../../..\n+\n+include $(top_srcdir)/include/mk/env_pre.mk\n+include $(top_srcdir)/include/mk/generic_trunk_target.mk\ndiff --git a/testcases/kernel/device-drivers/nvme/nvme01.c b/testcases/kernel/device-drivers/nvme/nvme01.c\nnew file mode 100644\nindex 000000000..3c3cb92ce\n--- /dev/null\n+++ b/testcases/kernel/device-drivers/nvme/nvme01.c\n@@ -0,0 +1,205 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/*\n+ * Copyright (c) 2026 IBM Corporation\n+ * Author: priyama2 <priyama2@linux.ibm.com>\n+ */\n+\n+/* * [Description]\n+ *\n+ * Verify NVMe device discovery and identification.\n+ *\n+ * This test fills a gap in NVMe test coverage by validating basic device\n+ * enumeration and driver binding, which are fundamental prerequisites for\n+ * any NVMe functionality testing.\n+ *\n+ * - Detect NVMe controllers in /dev\n+ * - Enumerate namespaces for detected controllers\n+ * - Verify PCI enumeration (class code 0x010802)\n+ * - Check NVMe driver binding\n+ */\n+\n+#define _GNU_SOURCE\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <unistd.h>\n+#include <fcntl.h>\n+#include <sys/types.h>\n+#include <sys/stat.h>\n+#include <dirent.h>\n+#include <errno.h>\n+\n+#include \"tst_test.h\"\n+#include \"tst_safe_stdio.h\"\n+\n+#define NVME_DEV_PATH \"/dev\"\n+#define NVME_SYS_PATH \"/sys/class/nvme\"\n+#define PCI_DEVICES_PATH \"/sys/bus/pci/devices\"\n+\n+static int nvme_device_found;\n+static char nvme_dev_name[256];\n+\n+static void test_detect_nvme_controllers(void)\n+{\n+\tDIR *dir;\n+\tstruct dirent *entry;\n+\tint found = 0;\n+\n+\tdir = SAFE_OPENDIR(NVME_DEV_PATH);\n+\n+\ttst_res(TINFO, \"Scanning for NVMe devices in %s\", NVME_DEV_PATH);\n+\n+\twhile ((entry = readdir(dir)) != NULL) {\n+\t\tif (strncmp(entry->d_name, \"nvme\", 4) == 0 &&\n+\t\t    strlen(entry->d_name) == 5) {\n+\t\t\ttst_res(TINFO, \"Found NVMe controller: %s\", entry->d_name);\n+\t\t\tstrncpy(nvme_dev_name, entry->d_name, sizeof(nvme_dev_name) - 1);\n+\t\t\tfound = 1;\n+\t\t\tnvme_device_found = 1;\n+\t\t}\n+\t}\n+\n+\tSAFE_CLOSEDIR(dir);\n+\n+\tif (found)\n+\t\ttst_res(TPASS, \"NVMe controller(s) detected successfully\");\n+\telse\n+\t\ttst_res(TCONF, \"No NVMe controllers found in system\");\n+}\n+\n+static void test_enumerate_namespaces(void)\n+{\n+\tDIR *dir;\n+\tstruct dirent *entry;\n+\tint ns_count = 0;\n+\tchar search_pattern[32];\n+\n+\tif (!nvme_device_found) {\n+\t\ttst_res(TCONF, \"No NVMe device found, skipping namespace enumeration\");\n+\t\treturn;\n+\t}\n+\n+\tsnprintf(search_pattern, sizeof(search_pattern), \"%sn\", nvme_dev_name);\n+\n+\tdir = SAFE_OPENDIR(NVME_DEV_PATH);\n+\n+\ttst_res(TINFO, \"Enumerating namespaces for %s\", nvme_dev_name);\n+\n+\twhile ((entry = readdir(dir)) != NULL) {\n+\t\tif (strncmp(entry->d_name, search_pattern, strlen(search_pattern)) == 0) {\n+\t\t\ttst_res(TINFO, \"Found namespace: %s\", entry->d_name);\n+\t\t\tns_count++;\n+\t\t}\n+\t}\n+\n+\tSAFE_CLOSEDIR(dir);\n+\n+\tif (ns_count > 0)\n+\t\ttst_res(TPASS, \"Enumerated %d namespace(s) successfully\", ns_count);\n+\telse\n+\t\ttst_res(TPASS, \"No namespaces found for %s (device may not have namespaces configured)\", nvme_dev_name);\n+}\n+\n+static void test_verify_pci_enumeration(void)\n+{\n+\tDIR *dir;\n+\tstruct dirent *entry;\n+\tint found = 0;\n+\tchar class_path[512];\n+\tFILE *fp;\n+\tchar class_id[16];\n+\n+\tif (!nvme_device_found) {\n+\t\ttst_res(TCONF, \"No NVMe device found, skipping PCI enumeration check\");\n+\t\treturn;\n+\t}\n+\n+\tdir = SAFE_OPENDIR(PCI_DEVICES_PATH);\n+\n+\ttst_res(TINFO, \"Checking PCI enumeration for NVMe devices\");\n+\n+\twhile ((entry = readdir(dir)) != NULL) {\n+\t\tif (entry->d_name[0] == '.')\n+\t\t\tcontinue;\n+\n+\t\tsnprintf(class_path, sizeof(class_path), \"%s/%s/class\",\n+\t\t\t PCI_DEVICES_PATH, entry->d_name);\n+\n+\t\tfp = SAFE_FOPEN(class_path, \"r\");\n+\n+\t\tif (fgets(class_id, sizeof(class_id), fp)) {\n+\t\t\tif (strncmp(class_id, \"0x010802\", 8) == 0) {\n+\t\t\t\ttst_res(TINFO, \"Found NVMe PCI device: %s (class: %s)\",\n+\t\t\t\t\tentry->d_name, class_id);\n+\t\t\t\tfound = 1;\n+\t\t\t}\n+\t\t}\n+\t\tSAFE_FCLOSE(fp);\n+\t}\n+\n+\tSAFE_CLOSEDIR(dir);\n+\n+\tif (found)\n+\t\ttst_res(TPASS, \"NVMe device properly enumerated on PCI bus\");\n+\telse\n+\t\ttst_res(TFAIL, \"NVMe device not found on PCI bus\");\n+}\n+\n+static void test_check_driver_binding(void)\n+{\n+\tchar driver_path[512];\n+\tchar driver_link[512];\n+\n+\tif (!nvme_device_found) {\n+\t\ttst_res(TCONF, \"No NVMe device found, skipping driver binding check\");\n+\t\treturn;\n+\t}\n+\n+\tsnprintf(driver_path, sizeof(driver_path), \"%s/%s/device/driver\",\n+\t\t NVME_SYS_PATH, nvme_dev_name);\n+\n+\tSAFE_READLINK(driver_path, driver_link, sizeof(driver_link));\n+\n+\ttst_res(TINFO, \"Driver binding: %s\", driver_link);\n+\n+\tif (strstr(driver_link, \"nvme\") != NULL)\n+\t\ttst_res(TPASS, \"NVMe driver properly bound to device\");\n+\telse\n+\t\ttst_res(TFAIL, \"Unexpected driver bound to NVMe device: %s\", driver_link);\n+}\n+\n+static void setup(void)\n+{\n+\tif (access(\"/sys/module/nvme\", F_OK) != 0)\n+\t\ttst_brk(TCONF, \"NVMe kernel module not loaded\");\n+\n+\ttst_res(TINFO, \"NVMe Device Discovery & Identification Test\");\n+}\n+\n+static void run(unsigned int n)\n+{\n+\t/* Reset state for each iteration */\n+\tnvme_device_found = 0;\n+\tmemset(nvme_dev_name, 0, sizeof(nvme_dev_name));\n+\n+\tswitch (n) {\n+\tcase 0:\n+\t\ttest_detect_nvme_controllers();\n+\t\tbreak;\n+\tcase 1:\n+\t\ttest_enumerate_namespaces();\n+\t\tbreak;\n+\tcase 2:\n+\t\ttest_verify_pci_enumeration();\n+\t\tbreak;\n+\tcase 3:\n+\t\ttest_check_driver_binding();\n+\t\tbreak;\n+\t}\n+}\n+\n+static struct tst_test test = {\n+\t.test = run,\n+\t.tcnt = 4,\n+\t.setup = setup,\n+};\n",
    "prefixes": [
        "v3"
    ]
}