@@ -52,8 +52,7 @@ endif
if ENABLE_DESTRUCTIVE
ndctl_SOURCES += ../test/blk_namespaces.c \
- ../test/pmem_namespaces.c \
- ../test/pcommit.c
+ ../test/pmem_namespaces.c
ndctl_SOURCES += builtin-bat.c
endif
@@ -39,11 +39,6 @@ int cmd_bat(int argc, const char **argv)
return EXIT_FAILURE;
}
- rc = test_pcommit(test);
- fprintf(stderr, "test_pcommit: %s\n", rc ? "FAIL" : "PASS");
- if (rc && rc != 77)
- return rc;
-
rc = test_blk_namespaces(loglevel, test);
fprintf(stderr, "test_blk_namespaces: %s\n", rc ? "FAIL" : "PASS");
if (rc && rc != 77)
@@ -18,5 +18,4 @@ int test_dpa_alloc(int loglevel, struct ndctl_test *test);
int test_libndctl(int loglevel, struct ndctl_test *test);
int test_blk_namespaces(int loglevel, struct ndctl_test *test);
int test_pmem_namespaces(int loglevel, struct ndctl_test *test);
-int test_pcommit(struct ndctl_test *test);
#endif /* __TEST_H__ */
@@ -18,7 +18,6 @@ if ENABLE_DESTRUCTIVE
TESTS +=\
blk-ns \
pmem-ns \
- pcommit \
dax-dev \
dax.sh \
mmap.sh
@@ -26,7 +25,6 @@ TESTS +=\
check_PROGRAMS +=\
blk-ns \
pmem-ns \
- pcommit \
dax-dev \
dax-pmd \
mmap
@@ -39,9 +37,6 @@ LIBNDCTL_LIB =\
libndctl_SOURCES = libndctl.c core.c
libndctl_LDADD = $(LIBNDCTL_LIB) $(UUID_LIBS) $(KMOD_LIBS)
-pcommit_SOURCES = pcommit.c core.c
-pcommit_LDADD = $(LIBNDCTL_LIB) $(KMOD_LIBS)
-
blk_ns_SOURCES = blk_namespaces.c core.c
blk_ns_LDADD = $(LIBNDCTL_LIB) $(KMOD_LIBS)
deleted file mode 100644
@@ -1,76 +0,0 @@
-/*
- * test-pcommit: Make sure PCOMMIT is supported by the platform.
- *
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU Lesser General Public License,
- * version 2.1, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
- * more details.
- */
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <test.h>
-#include <stdlib.h>
-#include <linux/version.h>
-
-#define err(msg)\
- fprintf(stderr, "%s:%d: %s (%s)\n", __func__, __LINE__, msg, strerror(errno))
-
-int test_pcommit(struct ndctl_test *test)
-{
- const char *pcommit = "pcommit";
- const char *flags = "flags";
- const int buffer_size = 1024;
-
- char buffer[buffer_size];
- FILE *cpuinfo;
- char *token;
-
- if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 0, 0)))
- return 77;
-
- cpuinfo = fopen("/proc/cpuinfo", "r");
- if (!cpuinfo) {
- err("open");
- return -ENXIO;
- }
-
- while (fgets(buffer, buffer_size, cpuinfo)) {
- token = strtok(buffer, " :");
-
- if (token &&
- strncmp(token, flags, strlen(flags)) != 0)
- continue;
-
- while (token != NULL) {
- token = strtok(NULL, " ");
- if (token &&
- strncmp(token, pcommit, strlen(pcommit)) == 0) {
- fclose(cpuinfo);
- return 0;
- }
- }
- }
-
- fclose(cpuinfo);
- ndctl_test_skip(test);
- return 77;
-}
-
-int __attribute__((weak)) main(int argc, char *argv[])
-{
- struct ndctl_test *test = ndctl_test_new(0);
-
- if (!test) {
- fprintf(stderr, "failed to initialize test\n");
- return EXIT_FAILURE;
- }
-
- return test_pcommit(test);
-}
Now that the kernel no longer has pcommit support, remove the ndctl test. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- ndctl/Makefile.am | 3 +- ndctl/builtin-bat.c | 5 --- test.h | 1 - test/Makefile.am | 5 --- test/pcommit.c | 76 --------------------------------------------------- 5 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 test/pcommit.c