Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/139216/?format=api
http://patches.dpdk.org/api/patches/139216/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240409170602.541658-3-stephen@networkplumber.org/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240409170602.541658-3-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20240409170602.541658-3-stephen@networkplumber.org", "date": "2024-04-09T17:05:03", "name": "[v4,2/2] test: add functional test for uuid", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5c8277d99d6c36a9a29a927da3c9b90470d3392a", "submitter": { "id": 27, "url": "http://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240409170602.541658-3-stephen@networkplumber.org/mbox/", "series": [ { "id": 31712, "url": "http://patches.dpdk.org/api/series/31712/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31712", "date": "2024-04-09T17:05:01", "name": "uuid: generator functions and unit test", "version": 4, "mbox": "http://patches.dpdk.org/series/31712/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/139216/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/139216/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AF5D843E2C;\n\tTue, 9 Apr 2024 19:07:02 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 465A540693;\n\tTue, 9 Apr 2024 19:06:49 +0200 (CEST)", "from mail-pf1-f170.google.com (mail-pf1-f170.google.com\n [209.85.210.170])\n by mails.dpdk.org (Postfix) with ESMTP id 9364D4025D\n for <dev@dpdk.org>; Tue, 9 Apr 2024 19:06:07 +0200 (CEST)", "by mail-pf1-f170.google.com with SMTP id\n d2e1a72fcca58-6ecf3943040so4003804b3a.0\n for <dev@dpdk.org>; Tue, 09 Apr 2024 10:06:07 -0700 (PDT)", "from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n x25-20020aa784d9000000b006e6b52eb59asm8545673pfn.126.2024.04.09.10.06.06\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 09 Apr 2024 10:06:06 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712682367;\n x=1713287167; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=O2hbXsi8PUIPXcDbPGNQLDAn/Jd2tgQRFFjFN8WIeOQ=;\n b=WD3Cq+67g40rQOPxRZy1bA+OdUI+Qy+B8lgLzTgDPA3lRc2ipECgX1ETLbv977+sXT\n It0HtKQ0xHtyj5mzkRqBUeKBuT1MWRceK+TV+RC+SYviOVupMy1dgIjwHC4IKOUuFbGt\n 9cI3eIZ+9L9/0Wgg3S3s0frfSdyh533pk+j4nOk/Mv/wpUNMz3kx7ZevsTTaaXk3yTH6\n tMEL1s7ockHzLAlZitFZ120zEyA6YliZERjkYk28EcCB4RFeDJmFQhqqS1ev/6yku1Wf\n mH9FFk04v2CZMuuhXFmwBFa8W045POK2x5oW6PHjg2GUbiZ13WI5P29v/LArrrbuyG08\n vlCw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1712682367; x=1713287167;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=O2hbXsi8PUIPXcDbPGNQLDAn/Jd2tgQRFFjFN8WIeOQ=;\n b=Fyas7XcReKZbW8Hs6klKU833mr7JpaV7+meREckkJhRfShoE4aDn96IJzo0DEoQZCq\n fVffVRRliDauIo3VEmWHmxfXf0dsnIg5H5848Ogc3rGn1gMU82mOhSlkcJBWT9+0/1mF\n TKzQpRZV/YeRNQE2CAvOoNYeYtDfLIzh1wa41SUtLKMItFtXAcTvDgXFS4PH4dDVohTI\n uIK6cqb9+gYbYKQ87eOLn1mE2gDbdHDzZvVmsudaJOI36xqb1PSo4ap4TQ/9hwng3ZoC\n bQ45E4tIRQqfcNGDkz/f/PC6M++OgOyA3go1w2LgMxqGRyMDb5c5Rr+6nNUb8RwtOBMP\n aypw==", "X-Gm-Message-State": "AOJu0YxPR/l8BRmVWqibTlaNab6XDFrNSZOZM7O9EGX1ZOV2Qkym64Oa\n ryhPK5VsstZTa4xXxAZoFXjU5HB/5f2UgovmwXGOvNGUXApRB82R3CWHDbYKcKHP0qRGGBBwgkm\n u", "X-Google-Smtp-Source": "\n AGHT+IH+nJKBOzBc/7zwF2mwRCLciLhYd7ziX5ZttQ+XjFXFOMmB2uQQMY8aNPzt79QyCPN8gUD34A==", "X-Received": "by 2002:a05:6a00:3cd3:b0:6e6:9f47:38c6 with SMTP id\n ln19-20020a056a003cd300b006e69f4738c6mr163620pfb.27.1712682366713;\n Tue, 09 Apr 2024 10:06:06 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Subject": "[PATCH v4 2/2] test: add functional test for uuid", "Date": "Tue, 9 Apr 2024 10:05:03 -0700", "Message-ID": "<20240409170602.541658-3-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20240409170602.541658-1-stephen@networkplumber.org>", "References": "<20240403163432.437275-1-stephen@networkplumber.org>\n <20240409170602.541658-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The uuid functions in EAL were not covered by existing functional\ntests.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n app/test/meson.build | 1 +\n app/test/test_uuid.c | 138 +++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 139 insertions(+)\n create mode 100644 app/test/test_uuid.c", "diff": "diff --git a/app/test/meson.build b/app/test/meson.build\nindex 7d909039ae..11fb7dbffa 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -198,6 +198,7 @@ source_file_deps = {\n 'test_trace.c': [],\n 'test_trace_perf.c': [],\n 'test_trace_register.c': [],\n+ 'test_uuid.c' : [],\n 'test_vdev.c': ['kvargs', 'bus_vdev'],\n 'test_version.c': [],\n }\ndiff --git a/app/test/test_uuid.c b/app/test/test_uuid.c\nnew file mode 100644\nindex 0000000000..a4b1b34786\n--- /dev/null\n+++ b/app/test/test_uuid.c\n@@ -0,0 +1,138 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2024 Stephen Hemminger\n+ */\n+\n+#include <rte_uuid.h>\n+\n+#include \"test.h\"\n+\n+#define NROUNDS 100\n+\n+static int\n+check_duplicate_uuid(rte_uuid_t uids[])\n+{\n+\tint i, j;\n+\tchar out[256];\n+\n+\tfor (i = 0; i < NROUNDS - 1; i++) {\n+\t\tfor (j = i + 1; j < NROUNDS; j++) {\n+\t\t\tif (rte_uuid_compare(uids[i], uids[j]) == 0) {\n+\t\t\t\trte_uuid_unparse(uids[i], out, sizeof(out));\n+\t\t\t\tprintf(\"Generated duplicate random uuids %d == %d : %s\\n\",\n+\t\t\t\t i, j, out);\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t}\n+\t}\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+static const struct uuid_case {\n+\tconst char *in;\n+\trte_uuid_t result;\n+} good_cases[] = {\n+\t{ \"02ce8e94-5b84-47fc-8f86-72633c5b5061\",\n+\t RTE_UUID_INIT(0x02ce8e94, 0x5b84, 0x47fc, 0x8f86, 0x72633c5b5061) },\n+\t{ \"2c72af87-d220-4931-98ec-45c8520c94e1\",\n+\t RTE_UUID_INIT(0x2c72af87, 0xd220, 0x4931, 0x98ec, 0x45c8520c94e1) },\n+\t{ \"441edca1-0942-4ccd-9b33-233e0454fe5b\",\n+\t RTE_UUID_INIT(0x441edca1, 0x0942, 0x4ccd, 0x9b33, 0x233e0454fe5b) },\n+};\n+\n+static const char * const bad_cases[] = {\n+\t\"\",\t\t\t\t\t/* empty */\n+\t\"41edca1-0942-4ccd-9b33-233e0454fe5b\", /* too short */\n+\t\"d5cecbac-531b-4527-b0629-2bc3011dc9c\", /* hyphen in wrong place */\n+\t\"db318745-1347-4f5e-m142-d86dc41172b2\", /* bad hex */\n+};\n+\n+static int\n+test_uuid(void)\n+{\n+\trte_uuid_t uids[NROUNDS] = { };\n+\trte_uuid_t clone[NROUNDS] = { };\n+\tunsigned int i;\n+\tint ret;\n+\n+\t/* Test generate random uuid */\n+\tfor (i = 0; i < NROUNDS; i++) {\n+\t\tif (!rte_uuid_is_null(uids[i])) {\n+\t\t\tprintf(\"Zero'd uuid %d is not null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\t\trte_uuid_generate_random(uids[i]);\n+\n+\t\tif (rte_uuid_is_null(uids[i])) {\n+\t\t\tprintf(\"Generated random uuid %d is null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\tret = check_duplicate_uuid(uids);\n+\tif (ret != TEST_SUCCESS)\n+\t\treturn ret;\n+\n+\t/* Test generate time */\n+\tfor (i = 0; i < NROUNDS; i++) {\n+\t\trte_uuid_generate_time(uids[i]);\n+\n+\t\tif (rte_uuid_is_null(uids[i])) {\n+\t\t\tprintf(\"Generated random uuid %d is null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\n+\t/* Test that copy works */\n+\tfor (i = 0; i < NROUNDS; i++) {\n+\t\tif (!rte_uuid_is_null(clone[i])) {\n+\t\t\tprintf(\"Zero'd clone %d is not null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\t\trte_uuid_copy(clone[i], uids[i]);\n+\n+\t\tif (rte_uuid_compare(uids[i], clone[i]) != 0) {\n+\t\t\tprintf(\"Copied uuid does not match\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < RTE_DIM(good_cases); i++) {\n+\t\tconst struct uuid_case *c = &good_cases[i];\n+\t\tchar out[37];\n+\t\trte_uuid_t uu;\n+\n+\t\tif (rte_uuid_parse(c->in, uu) != 0) {\n+\t\t\tprintf(\"Failed to parse '%s'\\n\", c->in);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t\tif (rte_uuid_compare(uu, c->result) != 0) {\n+\t\t\tprintf(\"Parse mismatch for '%s'\\n\", c->in);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\t\trte_uuid_unparse(uu, out, sizeof(out));\n+\t\tif (strcmp(out, c->in) != 0) {\n+\t\t\tprintf(\"Parse/unparse mismatch (%s != %s)\\n\",\n+\t\t\t out, c->in);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < RTE_DIM(bad_cases); i++) {\n+\t\tconst char *s = bad_cases[i];\n+\t\trte_uuid_t uu;\n+\n+\t\tif (rte_uuid_parse(s, uu) == 0) {\n+\t\t\tprintf(\"Accepted parse of '%s'\\n\", s);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+REGISTER_FAST_TEST(uuid_autotest, true, true, test_uuid);\n", "prefixes": [ "v4", "2/2" ] }{ "id": 139216, "url": "