summaryrefslogtreecommitdiffstats
path: root/src/spdk/dpdk/app/test/test_version.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/spdk/dpdk/app/test/test_version.c
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/dpdk/app/test/test_version.c')
-rw-r--r--src/spdk/dpdk/app/test/test_version.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/spdk/dpdk/app/test/test_version.c b/src/spdk/dpdk/app/test/test_version.c
new file mode 100644
index 000000000..1e1ff1865
--- /dev/null
+++ b/src/spdk/dpdk/app/test/test_version.c
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2014 Intel Corporation
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+
+#include <rte_common.h>
+#include <rte_version.h>
+
+#include "test.h"
+
+
+static int
+test_version(void)
+{
+ const char *version = rte_version();
+ if (version == NULL)
+ return -1;
+ printf("Version string: '%s'\n", version);
+ if (*version == '\0' ||
+ strncmp(version, RTE_VER_PREFIX, sizeof(RTE_VER_PREFIX)-1) != 0)
+ return -1;
+ return 0;
+}
+
+REGISTER_TEST_COMMAND(version_autotest, test_version);