diff --git a/ChangeLog b/ChangeLog index cfbc5ac5eaa..9d02f0c32b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ - removes other misc tests using pmempool with log/blk/btt pool types - removes btt specific test and related btt tests tools - removes btt support from pmemspoil + - removes libpmemlog tests and examples - ... Wed May 31 2023 Oksana Sałyk diff --git a/src/examples/Makefile b/src/examples/Makefile index 04ef07170a5..d4eab42e9ca 100644 --- a/src/examples/Makefile +++ b/src/examples/Makefile @@ -7,8 +7,7 @@ include ../common.inc -DIRS = libpmem libpmemblk libpmemlog libpmemobj libpmempool \ - pmreorder libpmem2 +DIRS = libpmem libpmemblk libpmemobj libpmempool pmreorder libpmem2 include Makefile.inc diff --git a/src/examples/libpmemlog/.gitignore b/src/examples/libpmemlog/.gitignore deleted file mode 100644 index 112ed861024..00000000000 --- a/src/examples/libpmemlog/.gitignore +++ /dev/null @@ -1 +0,0 @@ -manpage diff --git a/src/examples/libpmemlog/Makefile b/src/examples/libpmemlog/Makefile deleted file mode 100644 index 6cb83932a9f..00000000000 --- a/src/examples/libpmemlog/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# examples/libpmemlog/Makefile -- build the libpmemlog examples -# -PROGS = manpage -DIRS = logfile - -LIBS = -lpmemlog -lpmem -pthread - -include ../Makefile.inc - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations - -manpage: manpage.o diff --git a/src/examples/libpmemlog/README b/src/examples/libpmemlog/README deleted file mode 100644 index 203f8e95e4d..00000000000 --- a/src/examples/libpmemlog/README +++ /dev/null @@ -1,21 +0,0 @@ -Persistent Memory Development Kit - -This is examples/libpmemlog/README. - -This directory contains examples for libpmemlog, the library providing -pmem-resident log files. Some of these examples are explained in more -detail here: https://pmem.io/pmdk/libpmemlog - -manpage.c is the example used in the libpmemlog man page. - -logfile implements a simple log using libpmemlog. - -To build these examples: - make - -These examples can be built against an installed system using: - make LIBDIR=/usr/lib INCDIR=/usr/include - -If you're looking for documentation to get you started using PMDK, -start here: https://pmem.io/pmdk and follow the links to examples and -man pages. Developers new to PMDK are probably looking for libpmemobj. diff --git a/src/examples/libpmemlog/logfile/.gitignore b/src/examples/libpmemlog/logfile/.gitignore deleted file mode 100644 index 3b2f05823af..00000000000 --- a/src/examples/libpmemlog/logfile/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -addlog -printlog diff --git a/src/examples/libpmemlog/logfile/Makefile b/src/examples/libpmemlog/logfile/Makefile deleted file mode 100644 index 5f0585d7a11..00000000000 --- a/src/examples/libpmemlog/logfile/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# examples/logfile/Makefile -- build the Persistent Memory Development Kit examples -# -PROGS = addlog printlog - -LIBS = -lpmemlog -lpmem -pthread - -include ../../Makefile.inc - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations - -addlog: addlog.o - -printlog: printlog.o - -addlog.o printlog.o: logentry.h diff --git a/src/examples/libpmemlog/logfile/README b/src/examples/libpmemlog/logfile/README deleted file mode 100644 index fb3a25ac346..00000000000 --- a/src/examples/libpmemlog/logfile/README +++ /dev/null @@ -1,31 +0,0 @@ -Persistent Memory Development Kit - -This is examples/libpmemlog/logfile/README. - -The example in this directory uses persistent memory to implement a -simple log file using libpmemlog. To run this example, follow these steps: - -0. Build the example with "make". The libraries must be built first (i.e. - by running "make" in ../../..). - -1. Create the log file. This can be anywhere but the point is it - will be a much faster log file if it is created on a pmem-aware - file system. For example, if /pmem is the mount point for a - pmem-aware file system: - - $ fallocate -l 1G /pmem/logfile - -2. Append to the log file as many times as you like: - - $ addlog /pmem/logfile "Hello there." - $ addlog /pmem/logfile "First line." "Second line." - ... - -3. Print the contents of the log any time using: - - $ printlog /pmem/logfile - -4. The printlog command will throw away the current log file contents - after printing it if given the -t argument: - - $ printlog -t /pmem/logfile diff --git a/src/examples/libpmemlog/logfile/addlog.c b/src/examples/libpmemlog/logfile/addlog.c deleted file mode 100644 index 4a4c9bf9b63..00000000000 --- a/src/examples/libpmemlog/logfile/addlog.c +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ - -/* - * addlog -- given a log file, append a log entry - * - * Usage: - * fallocate -l 1G /path/to/pm-aware/file - * addlog /path/to/pm-aware/file "first line of entry" "second line" - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "logentry.h" - -int -main(int argc, char *argv[]) -{ - PMEMlogpool *plp; - struct logentry header; - struct iovec *iovp; - struct iovec *next_iovp; - int iovcnt; - - if (argc < 3) { - fprintf(stderr, "usage: %s filename lines...\n", argv[0]); - exit(1); - } - - const char *path = argv[1]; - - /* create the log in the given file, or open it if already created */ - plp = pmemlog_create(path, 0, CREATE_MODE_RW); - - if (plp == NULL && - (plp = pmemlog_open(path)) == NULL) { - perror(path); - exit(1); - } - - /* fill in the header */ - time(&header.timestamp); - header.pid = getpid(); - - /* - * Create an iov for pmemlog_appendv(). For each argument given, - * allocate two entries (one for the string, one for the newline - * appended to the string). Allocate 1 additional entry for the - * header that gets prepended to the entry. - */ - iovcnt = (argc - 2) * 2 + 2; - if ((iovp = malloc(sizeof(*iovp) * iovcnt)) == NULL) { - perror("malloc"); - exit(1); - } - next_iovp = iovp; - - /* put the header into iov first */ - next_iovp->iov_base = &header; - next_iovp->iov_len = sizeof(header); - next_iovp++; - - /* - * Now put each arg in, following it with the string "\n". - * Calculate a total character count in header.len along the way. - */ - header.len = 0; - for (int arg = 2; arg < argc; arg++) { - /* add the string given */ - next_iovp->iov_base = argv[arg]; - next_iovp->iov_len = strlen(argv[arg]); - header.len += next_iovp->iov_len; - next_iovp++; - - /* add the newline */ - next_iovp->iov_base = "\n"; - next_iovp->iov_len = 1; - header.len += 1; - next_iovp++; - } - - /* - * pad with NULs (at least one) to align next entry to sizeof(long long) - * bytes - */ - int a = sizeof(long long); - int len_to_round = 1 + (a - (header.len + 1) % a) % a; - char *buf[sizeof(long long)] = {0}; - next_iovp->iov_base = buf; - next_iovp->iov_len = len_to_round; - header.len += len_to_round; - next_iovp++; - - /* atomically add it all to the log */ - if (pmemlog_appendv(plp, iovp, iovcnt) < 0) { - perror("pmemlog_appendv"); - free(iovp); - exit(1); - } - - free(iovp); - - pmemlog_close(plp); - return 0; -} diff --git a/src/examples/libpmemlog/logfile/addlog.filters b/src/examples/libpmemlog/logfile/addlog.filters deleted file mode 100644 index 13046112715..00000000000 --- a/src/examples/libpmemlog/logfile/addlog.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {7b7d2f5a-464e-4d55-894b-3110e15303f1} - - - {c2e783a4-4f6d-419d-bbf6-1056eddfdd8f} - - - - - Source Files - - - - - Header Files - - - \ No newline at end of file diff --git a/src/examples/libpmemlog/logfile/logentry.h b/src/examples/libpmemlog/logfile/logentry.h deleted file mode 100644 index 8c246f068a7..00000000000 --- a/src/examples/libpmemlog/logfile/logentry.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright 2014-2023, Intel Corporation */ - -/* - * info prepended to each log entry... - */ -struct logentry { - size_t len; /* length of the rest of the log entry */ - time_t timestamp; - pid_t pid; - -}; diff --git a/src/examples/libpmemlog/logfile/printlog.c b/src/examples/libpmemlog/logfile/printlog.c deleted file mode 100644 index a9813746d1f..00000000000 --- a/src/examples/libpmemlog/logfile/printlog.c +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ - -/* - * printlog -- given a log file, print the entries - * - * Usage: - * printlog [-t] /path/to/pm-aware/file - * - * -t option means truncate the file after printing it. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "logentry.h" - -/* - * printlog -- callback function called when walking the log - */ -static int -printlog(const void *buf, size_t len, void *arg) -{ - /* first byte after log contents */ - const void *endp = (char *)buf + len; - - /* for each entry in the log... */ - while (buf < endp) { - struct logentry *headerp = (struct logentry *)buf; - buf = (char *)buf + sizeof(struct logentry); - - /* print the header */ - printf("Entry from pid: %d\n", headerp->pid); - printf(" Created: %s", ctime(&headerp->timestamp)); - printf(" Contents:\n"); - - /* print the log data itself, it is NUL-terminated */ - printf("%s", (char *)buf); - buf = (char *)buf + headerp->len; - } - - return 0; -} - -int -main(int argc, char *argv[]) -{ - int ind = 1; - int tflag = 0; - PMEMlogpool *plp; - - if (argc > 2) { - if (strcmp(argv[1], "-t") == 0) { - tflag = 1; - ind++; - } else { - fprintf(stderr, "usage: %s [-t] file\n", argv[0]); - exit(1); - } - } - - const char *path = argv[ind]; - - if ((plp = pmemlog_open(path)) == NULL) { - perror(path); - exit(1); - } - - /* the rest of the work happens in printlog() above */ - pmemlog_walk(plp, 0, printlog, NULL); - - if (tflag) - pmemlog_rewind(plp); - - pmemlog_close(plp); - return 0; -} diff --git a/src/examples/libpmemlog/logfile/printlog.filters b/src/examples/libpmemlog/logfile/printlog.filters deleted file mode 100644 index 23e5d8117e3..00000000000 --- a/src/examples/libpmemlog/logfile/printlog.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {7b7d2f5a-464e-4d55-894b-3110e15303f1} - - - {c2e783a4-4f6d-419d-bbf6-1056eddfdd8f} - - - - - Source Files - - - - - Header Files - - - \ No newline at end of file diff --git a/src/examples/libpmemlog/manpage.c b/src/examples/libpmemlog/manpage.c deleted file mode 100644 index 7d3c8e83c48..00000000000 --- a/src/examples/libpmemlog/manpage.c +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2023, Intel Corporation */ - -/* - * manpage.c -- simple example for the libpmemlog man page - */ - -#include -#include -#include -#include -#include -#include -#include - -/* size of the pmemlog pool -- 1 GB */ -#define POOL_SIZE ((size_t)(1 << 30)) - -/* - * printit -- log processing callback for use with pmemlog_walk() - */ -static int -printit(const void *buf, size_t len, void *arg) -{ - fwrite(buf, len, 1, stdout); - return 0; -} - -int -main(int argc, char *argv[]) -{ - const char path[] = "/pmem-fs/myfile"; - PMEMlogpool *plp; - size_t nbyte; - char *str; - - /* create the pmemlog pool or open it if it already exists */ - plp = pmemlog_create(path, POOL_SIZE, 0666); - - if (plp == NULL) - plp = pmemlog_open(path); - - if (plp == NULL) { - perror(path); - exit(1); - } - - /* how many bytes does the log hold? */ - nbyte = pmemlog_nbyte(plp); - printf("log holds %zu bytes\n", nbyte); - - /* append to the log... */ - str = "This is the first string appended\n"; - if (pmemlog_append(plp, str, strlen(str)) < 0) { - perror("pmemlog_append"); - exit(1); - } - str = "This is the second string appended\n"; - if (pmemlog_append(plp, str, strlen(str)) < 0) { - perror("pmemlog_append"); - exit(1); - } - - /* print the log contents */ - printf("log contains:\n"); - pmemlog_walk(plp, 0, printit, NULL); - - pmemlog_close(plp); - return 0; -} diff --git a/src/test/Makefile b/src/test/Makefile index 8b85b3d581d..33caf6494f6 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -24,14 +24,6 @@ BLK_TESTS = \ blk_rw\ blk_rw_mt -LOG_TESTS = \ - log_basic\ - log_include\ - log_pool\ - log_pool_lock\ - log_recovery\ - log_walker - OBJ_DEPS = \ obj_list @@ -236,7 +228,6 @@ EXAMPLES_TESTS = \ ex_libpmem\ ex_libpmem2\ ex_libpmemblk\ - ex_libpmemlog\ ex_libpmemobj\ ex_linkedlist\ ex_pmreorder @@ -268,7 +259,6 @@ PMREORDER_TESTS = \ LOCAL_TESTS = \ $(OBJ_TESTS)\ $(BLK_TESTS)\ - $(LOG_TESTS)\ $(OTHER_TESTS)\ $(PMEM_TESTS)\ $(PMEM2_TESTS)\ diff --git a/src/test/Makefile.inc b/src/test/Makefile.inc index 057a3bd07d3..189936ab2fa 100644 --- a/src/test/Makefile.inc +++ b/src/test/Makefile.inc @@ -21,7 +21,6 @@ EXAMPLES_DIR=$(TOP)/src/examples EX_LIBPMEM=$(EXAMPLES_DIR)/libpmem EX_LIBPMEM2=$(EXAMPLES_DIR)/libpmem2 EX_LIBPMEMBLK=$(EXAMPLES_DIR)/libpmemblk -EX_LIBPMEMLOG=$(EXAMPLES_DIR)/libpmemlog EX_LIBPMEMOBJ=$(EXAMPLES_DIR)/libpmemobj EX_PMREORDER=$(EXAMPLES_DIR)/pmreorder @@ -54,13 +53,6 @@ STATIC_DEBUG_LIBS += $(LIBS_DIR)/debug/libpmemblk.a STATIC_NONDEBUG_LIBS += $(LIBS_DIR)/nondebug/libpmemblk.a endif -ifeq ($(LIBPMEMLOG), y) -LIBPMEM=y -DYNAMIC_LIBS += -lpmemlog -STATIC_DEBUG_LIBS += $(LIBS_DIR)/debug/libpmemlog.a -STATIC_NONDEBUG_LIBS += $(LIBS_DIR)/nondebug/libpmemlog.a -endif - ifeq ($(LIBPMEMOBJ), y) LIBPMEM=y DYNAMIC_LIBS += -lpmemobj diff --git a/src/test/compat_incompat_features/Makefile b/src/test/compat_incompat_features/Makefile index d7e81bf28fb..8a452f9f585 100644 --- a/src/test/compat_incompat_features/Makefile +++ b/src/test/compat_incompat_features/Makefile @@ -10,12 +10,11 @@ OBJS = pool_open.o LIBPMEMOBJ=y LIBPMEMBLK=y -LIBPMEMLOG=y USE_PMEMSPOIL=y include ../Makefile.inc -# Libpmemblk and libpmemlog are deprecated. +# Libpmemblk is deprecated. # This flag allows to build tests, examples and benchmarks -# using pmemblk/pmemlog despite the deprecated state. +# using pmemblk despite the deprecated state. CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/compat_incompat_features/common.sh b/src/test/compat_incompat_features/common.sh index 1c154e78f42..5bd35db2bce 100644 --- a/src/test/compat_incompat_features/common.sh +++ b/src/test/compat_incompat_features/common.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation +# Copyright 2017-2023, Intel Corporation # # # compat_incompat_features/common.sh -- common stuff for compat/incompat feature @@ -18,13 +18,12 @@ rm -f $ERR_TEMP && touch $ERR_TEMP LAYOUT=OBJ_LAYOUT$SUFFIX POOLSET=$DIR/pool.set -POOL_TYPES=(obj blk log) +POOL_TYPES=(obj blk) # pmempool create arguments: declare -A create_args create_args[obj]="obj $POOLSET" create_args[blk]="blk 512 $POOLSET" -create_args[log]="log $POOLSET" # Known compat flags: diff --git a/src/test/compat_incompat_features/err1.log.match b/src/test/compat_incompat_features/err1.log.match index 2e19885992d..4565bdc6688 100644 --- a/src/test/compat_incompat_features/err1.log.match +++ b/src/test/compat_incompat_features/err1.log.match @@ -2,5 +2,3 @@ {$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemobj_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST1: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument diff --git a/src/test/compat_incompat_features/err2.log.match b/src/test/compat_incompat_features/err2.log.match index 26e9dcd9616..80921e6f033 100644 --- a/src/test/compat_incompat_features/err2.log.match +++ b/src/test/compat_incompat_features/err2.log.match @@ -6,7 +6,3 @@ {$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST2: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument diff --git a/src/test/compat_incompat_features/err3.log.match b/src/test/compat_incompat_features/err3.log.match index d1f8ce9b3d5..1249e833962 100644 --- a/src/test/compat_incompat_features/err3.log.match +++ b/src/test/compat_incompat_features/err3.log.match @@ -6,7 +6,3 @@ {$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST3: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument diff --git a/src/test/compat_incompat_features/err4.log.match b/src/test/compat_incompat_features/err4.log.match index aad72597e14..2f81a8c1f06 100644 --- a/src/test/compat_incompat_features/err4.log.match +++ b/src/test/compat_incompat_features/err4.log.match @@ -6,7 +6,3 @@ {$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument {$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemblk_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument -{$(nW) main} compat_incompat_features/TEST4: Error: $(nW)pool.set: pmemlog_open failed: Invalid argument diff --git a/src/test/compat_incompat_features/out0.log.match b/src/test/compat_incompat_features/out0.log.match index e4bf2870f71..bc94207fda2 100644 --- a/src/test/compat_incompat_features/out0.log.match +++ b/src/test/compat_incompat_features/out0.log.match @@ -30,19 +30,3 @@ compat_incompat_features/TEST0: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW) $(nW)pool.set: pmemblk_open succeeded compat_incompat_features/TEST0: DONE -compat_incompat_features/TEST0: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW) -$(nW)pool.set: pmemlog_open succeeded -compat_incompat_features/TEST0: DONE -compat_incompat_features/TEST0: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW) -$(nW)pool.set: pmemlog_open succeeded -compat_incompat_features/TEST0: DONE -compat_incompat_features/TEST0: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW) -$(nW)pool.set: pmemlog_open succeeded -compat_incompat_features/TEST0: DONE -compat_incompat_features/TEST0: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW) -$(nW)pool.set: pmemlog_open succeeded -compat_incompat_features/TEST0: DONE diff --git a/src/test/compat_incompat_features/out1.log.match b/src/test/compat_incompat_features/out1.log.match index 89ea72654cf..79784b58e29 100644 --- a/src/test/compat_incompat_features/out1.log.match +++ b/src/test/compat_incompat_features/out1.log.match @@ -6,7 +6,3 @@ compat_incompat_features/TEST1: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set compat_incompat_features/TEST1: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set -compat_incompat_features/TEST1: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST1: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set diff --git a/src/test/compat_incompat_features/out2.log.match b/src/test/compat_incompat_features/out2.log.match index 9dd22f65f2c..e7877a67db2 100644 --- a/src/test/compat_incompat_features/out2.log.match +++ b/src/test/compat_incompat_features/out2.log.match @@ -14,11 +14,3 @@ compat_incompat_features/TEST2: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set compat_incompat_features/TEST2: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set -compat_incompat_features/TEST2: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST2: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST2: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST2: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set diff --git a/src/test/compat_incompat_features/out3.log.match b/src/test/compat_incompat_features/out3.log.match index fac9025a5e3..24b15301b14 100644 --- a/src/test/compat_incompat_features/out3.log.match +++ b/src/test/compat_incompat_features/out3.log.match @@ -14,11 +14,3 @@ compat_incompat_features/TEST3: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set compat_incompat_features/TEST3: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set -compat_incompat_features/TEST3: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST3: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST3: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST3: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set diff --git a/src/test/compat_incompat_features/out4.log.match b/src/test/compat_incompat_features/out4.log.match index 9bcf91c2796..7e43d4905fb 100644 --- a/src/test/compat_incompat_features/out4.log.match +++ b/src/test/compat_incompat_features/out4.log.match @@ -14,11 +14,3 @@ compat_incompat_features/TEST4: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set compat_incompat_features/TEST4: START: compat_incompat_features $(nW)pool_open$(nW) blk $(nW)pool.set -compat_incompat_features/TEST4: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST4: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST4: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set -compat_incompat_features/TEST4: START: compat_incompat_features - $(nW)pool_open$(nW) log $(nW)pool.set diff --git a/src/test/compat_incompat_features/pool_open.c b/src/test/compat_incompat_features/pool_open.c index 5dca9aa0bc0..41d80fb7e59 100644 --- a/src/test/compat_incompat_features/pool_open.c +++ b/src/test/compat_incompat_features/pool_open.c @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2017-2018, Intel Corporation */ +/* Copyright 2017-2023, Intel Corporation */ /* - * pool_open.c -- a tool for verifying that an obj/blk/log pool opens correctly + * pool_open.c -- a tool for verifying that an obj/blk pool opens correctly * - * usage: pool_open + * usage: pool_open */ #include "unittest.h" @@ -13,7 +13,7 @@ main(int argc, char *argv[]) { START(argc, argv, "compat_incompat_features"); if (argc < 3) - UT_FATAL("usage: %s ", argv[0]); + UT_FATAL("usage: %s ", argv[0]); char *type = argv[1]; char *path = argv[2]; @@ -34,16 +34,8 @@ main(int argc, char *argv[]) UT_OUT("%s: pmemblk_open succeeded", path); pmemblk_close(pop); } - } else if (strcmp(type, "log") == 0) { - PMEMlogpool *pop = pmemlog_open(path); - if (pop == NULL) { - UT_FATAL("!%s: pmemlog_open failed", path); - } else { - UT_OUT("%s: pmemlog_open succeeded", path); - pmemlog_close(pop); - } } else { - UT_FATAL("usage: %s ", argv[0]); + UT_FATAL("usage: %s ", argv[0]); } DONE(NULL); diff --git a/src/test/ctl_cow/Makefile b/src/test/ctl_cow/Makefile index cb7764fb40c..11c63aa1397 100644 --- a/src/test/ctl_cow/Makefile +++ b/src/test/ctl_cow/Makefile @@ -8,12 +8,11 @@ TARGET = ctl_cow OBJS = ctl_cow.o LIBPMEMBLK=y -LIBPMEMLOG=y LIBPMEMOBJ=y include ../Makefile.inc -# Libpmemblk and libpmemlog are deprecated. +# Libpmemblk is deprecated. # This flag allows to build tests, examples and benchmarks -# using pmemblk/pmemlog despite the deprecated state. +# using pmemblk despite the deprecated state. CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/ctl_cow/ctl_cow.c b/src/test/ctl_cow/ctl_cow.c index 247c529065e..c335e8f44a5 100644 --- a/src/test/ctl_cow/ctl_cow.c +++ b/src/test/ctl_cow/ctl_cow.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2019, Intel Corporation */ +/* Copyright 2019-2023, Intel Corporation */ /* * ctl_cow.c -- unit tests for copy on write feature which check @@ -87,26 +87,6 @@ test_blk(const char *path) pmemblk_close(pbp); } -static void -test_log(const char *path) -{ - PMEMlogpool *plp = pmemlog_open(path); - - if (plp == NULL) - UT_FATAL("!cannot open %s", path); - - char buf[] = "pmemlog test"; - char buf_2[] = "pmemlog test 2"; - - if (pmemlog_append(plp, buf, strlen(buf)) < 0) - UT_FATAL("cannot append to %s", path); - - if (pmemlog_append(plp, buf_2, strlen(buf_2)) < 0) - UT_FATAL("cannot append to %s", path); - - pmemlog_close(plp); -} - static void test_dax(const char *path) { @@ -124,7 +104,7 @@ main(int argc, char *argv[]) START(argc, argv, "ctl_cow"); if (argc < 3) - UT_FATAL("usage: %s filename obj|log|blk|dax", argv[0]); + UT_FATAL("usage: %s filename obj|blk|dax", argv[0]); const char *path = argv[1]; const char *action = argv[2]; @@ -135,9 +115,6 @@ main(int argc, char *argv[]) } else if (strcmp(action, "blk") == 0) { test_blk(path); - } else if (strcmp(action, "log") == 0) { - test_log(path); - } else if (strcmp(action, "dax") == 0) { test_dax(path); diff --git a/src/test/ctl_prefault/Makefile b/src/test/ctl_prefault/Makefile index 1d669a95ea2..600ca1aff2d 100644 --- a/src/test/ctl_prefault/Makefile +++ b/src/test/ctl_prefault/Makefile @@ -8,12 +8,11 @@ TARGET = ctl_prefault OBJS = ctl_prefault.o LIBPMEMBLK=y -LIBPMEMLOG=y LIBPMEMOBJ=y include ../Makefile.inc -# Libpmemblk and libpmemlog are deprecated. +# Libpmemblk is deprecated. # This flag allows to build tests, examples and benchmarks -# using pmemblk/pmemlog despite the deprecated state. +# using pmemblk despite the deprecated state. CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/ctl_prefault/ctl_prefault.c b/src/test/ctl_prefault/ctl_prefault.c index b60329b94bf..5116cd58af1 100644 --- a/src/test/ctl_prefault/ctl_prefault.c +++ b/src/test/ctl_prefault/ctl_prefault.c @@ -12,7 +12,6 @@ #define OBJ_STR "obj" #define BLK_STR "blk" -#define LOG_STR "log" #define BSIZE 20 #define LAYOUT "obj_ctl_prefault" @@ -129,38 +128,9 @@ test_blk(const char *path, int open) UT_OUT("%ld", resident_pages); } -/* - * test_log -- open/create PMEMlogpool - */ -static void -test_log(const char *path, int open) -{ - PMEMlogpool *plp; - - /* - * To test prefaulting, pool must have size at least equal to 2 pages. - * If 2MB huge pages are used this is at least 4MB. - */ - size_t pool_size = 2 * PMEMLOG_MIN_POOL; - - if (open) { - if ((plp = pmemlog_open(path)) == NULL) - UT_FATAL("!pmemlog_open: %s", path); - } else { - if ((plp = pmemlog_create(path, pool_size, - S_IWUSR | S_IRUSR)) == NULL) - UT_FATAL("!pmemlog_create: %s", path); - } - - size_t resident_pages = count_resident_pages(plp, pool_size); - - pmemlog_close(plp); - - UT_OUT("%ld", resident_pages); -} #define USAGE() do {\ - UT_FATAL("usage: %s file-name type(obj/blk/log) prefault(0/1/2) "\ + UT_FATAL("usage: %s file-name type(obj/blk) prefault(0/1/2) "\ "open(0/1)", argv[0]);\ } while (0) @@ -185,10 +155,6 @@ main(int argc, char *argv[]) prefault_fun(prefault, (fun)pmemblk_ctl_get, (fun)pmemblk_ctl_set); test_blk(path, open); - } else if (strcmp(type, LOG_STR) == 0) { - prefault_fun(prefault, (fun)pmemlog_ctl_get, - (fun)pmemlog_ctl_set); - test_log(path, open); } else USAGE(); diff --git a/src/test/ex_libpmemlog/Makefile b/src/test/ex_libpmemlog/Makefile deleted file mode 100644 index c0910af52ff..00000000000 --- a/src/test/ex_libpmemlog/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2016, Intel Corporation - -# -# src/test/ex_libpmemlog/Makefile -- build ex_libpmemlog unittest -# - -all: $(EXAMPLES) - $(MAKE) -C $(EX_LIBPMEMLOG) - -include ../Makefile.inc - -EXAMPLES=$(EX_LIBPMEMLOG)/logfile/addlog \ - $(EX_LIBPMEMLOG)/logfile/printlog - diff --git a/src/test/ex_libpmemlog/README b/src/test/ex_libpmemlog/README deleted file mode 100644 index 7d0774c0a4f..00000000000 --- a/src/test/ex_libpmemlog/README +++ /dev/null @@ -1,7 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/ex_libpmemlog/README. - -This directory contains unit tests for libpmemlog examples. - -The unit tests utilizes examples from src/examples/libpmemlog directory. diff --git a/src/test/ex_libpmemlog/TEST0 b/src/test/ex_libpmemlog/TEST0 deleted file mode 100755 index 186df14a2fb..00000000000 --- a/src/test/ex_libpmemlog/TEST0 +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/ex_libpmemlog/TEST0 -- unit test for libpmemlog examples -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_build_type debug nondebug - -setup - -EX_PATH=../../examples/libpmemlog/logfile - -create_holey_file 32M $DIR/testfile1 - -expect_normal_exit $EX_PATH/addlog $DIR/testfile1 "Hello World! foo bar" > out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/printlog $DIR/testfile1 >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/addlog $DIR/testfile1 "PMEMLOG" >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/printlog -t $DIR/testfile1 >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/addlog $DIR/testfile1 "PMDK" >> out$UNITTEST_NUM.log 2>&1 -expect_normal_exit $EX_PATH/printlog -t $DIR/testfile1 >> out$UNITTEST_NUM.log 2>&1 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/ex_libpmemlog/out0.log.match b/src/test/ex_libpmemlog/out0.log.match deleted file mode 100644 index 41e87500c56..00000000000 --- a/src/test/ex_libpmemlog/out0.log.match +++ /dev/null @@ -1,22 +0,0 @@ -Entry from pid: $(N) - Created: $(*) - Contents: -Hello -World! -foo -bar -Entry from pid: $(N) - Created: $(*) - Contents: -Hello -World! -foo -bar -Entry from pid: $(N) - Created: $(*) - Contents: -PMEMLOG -Entry from pid: $(N) - Created: $(*) - Contents: -PMDK diff --git a/src/test/log_basic/.gitignore b/src/test/log_basic/.gitignore deleted file mode 100644 index 260ef90418a..00000000000 --- a/src/test/log_basic/.gitignore +++ /dev/null @@ -1 +0,0 @@ -log_basic diff --git a/src/test/log_basic/Makefile b/src/test/log_basic/Makefile deleted file mode 100644 index fa2e5a6b1d8..00000000000 --- a/src/test/log_basic/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# src/test/log_basic/Makefile -- build log_basic unit test -# -TARGET = log_basic -OBJS = log_basic.o - -LIBPMEMLOG=y - -include ../Makefile.inc - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/log_basic/README b/src/test/log_basic/README deleted file mode 100644 index 9a74d8e594f..00000000000 --- a/src/test/log_basic/README +++ /dev/null @@ -1,34 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/log_basic/README. - -This directory contains a unit test for: -- pmemlog_open -- pmemlog_close -- pmemlog_nbyte -- pmemlog_append -- pmemlog_appendv -- pmemlog_tell -- pmemlog_rewind -- pmemlog_walk -- pmemlog_check -- fault injection - -The program in pmemlog.c takes a file name and a list of -operations encoded as characters as arguments. For example: - - ./log_basic file1 c a v r w t n l h - -this will call a series of log iterations with some hardcoded arguments -as described in the table below: - - l - pmemlog_close - h - pmemlog_check - f - fault injection - c - pmemlog_create - a - pmemlog_append - v - pmemlog_appendv - t - pmemlog_tell - r - pmemlog_rewind - w - pmemlog_walk - n - pmemlog_nbyte diff --git a/src/test/log_basic/TEST0 b/src/test/log_basic/TEST0 deleted file mode 100755 index f1031f911b0..00000000000 --- a/src/test/log_basic/TEST0 +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_basic/TEST0 -- unit test for: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# - fault injection -# in case of empty pool and: -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup - -create_holey_file 2M $DIR/testfile2 -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testfile2 f - -create_holey_file 2M $DIR/testfile1 -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testfile1 c n t w r l h - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/log_basic/TEST1 b/src/test/log_basic/TEST1 deleted file mode 100755 index c202c76db83..00000000000 --- a/src/test/log_basic/TEST1 +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_basic/TEST1 -- unit test for: -# - pmemlog_append -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup - -create_holey_file 2M $DIR/testfile1 - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testfile1 c a n t w r t w l h - -check_pool $DIR/testfile1 - -check - -pass - diff --git a/src/test/log_basic/TEST10 b/src/test/log_basic/TEST10 deleted file mode 100755 index 5eda034dea0..00000000000 --- a/src/test/log_basic/TEST10 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/log_basic/TEST10 -- unit test for: -# - pmemlog_append -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# -# Same as TEST1, but run on a pool set that spans two Device DAX devices -# with 2M alignment. Expected success, as pool is created with SINGLEHDR option. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_dax_device_alignments 2097152 2097152 # 2MiB - -setup - -dax_device_zero - -create_poolset $DIR/testset AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]} \ - O SINGLEHDR - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testset c a n t w r t w l h - -pass diff --git a/src/test/log_basic/TEST2 b/src/test/log_basic/TEST2 deleted file mode 100755 index ed87fdd434b..00000000000 --- a/src/test/log_basic/TEST2 +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_basic/TEST2 -- unit test for: -# - pmemlog_appendv -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup - -create_holey_file 2M $DIR/testfile1 - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testfile1 c v n t w r t w l h - -check_pool $DIR/testfile1 - -check - -pass - diff --git a/src/test/log_basic/TEST3 b/src/test/log_basic/TEST3 deleted file mode 100755 index 1fe52a5e0c7..00000000000 --- a/src/test/log_basic/TEST3 +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_basic/TEST3 -- unit test for: -# - pmemlog_append -# - pmemlog_appendv -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup - -create_holey_file 2M $DIR/testfile1 - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testfile1\ - c a n t w r t w v n t w r t w l h - -check_pool $DIR/testfile1 - -check - -pass - diff --git a/src/test/log_basic/TEST4 b/src/test/log_basic/TEST4 deleted file mode 100755 index 68308acf0a9..00000000000 --- a/src/test/log_basic/TEST4 +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_basic/TEST4 -- unit test for: -# - pmemlog_append -# - pmemlog_appendv -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# - -. ../unittest/unittest.sh - -require_test_type medium - -# long test, run only on pmem -configure_valgrind pmemcheck force-enable -setup - -create_holey_file 2M $DIR/testfile1 - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testfile1\ - c a n t w r t w v n t w r t w l h - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/log_basic/TEST5 b/src/test/log_basic/TEST5 deleted file mode 100755 index ac2cf623839..00000000000 --- a/src/test/log_basic/TEST5 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_basic/TEST5 -- unit test for: -# - pmemlog_nbyte -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup - -export PMEMLOG_LOG_LEVEL=10 - -create_poolset $DIR/testset1 2M:$DIR/testfile1:x - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testset1 c n l h - -check_pool $DIR/testset1 - -check - -pass diff --git a/src/test/log_basic/TEST6 b/src/test/log_basic/TEST6 deleted file mode 100755 index 2728c841595..00000000000 --- a/src/test/log_basic/TEST6 +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_basic/TEST6 -- unit test for: -# - pmemlog_nbyte -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup - -create_poolset $DIR/testset1 2M:$DIR/testfile1:x 2M:$DIR/testfile2:x - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testset1 c n l h - -check_pool $DIR/testset1 - -check - -pass diff --git a/src/test/log_basic/TEST7 b/src/test/log_basic/TEST7 deleted file mode 100755 index dca4ab66490..00000000000 --- a/src/test/log_basic/TEST7 +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/log_basic/TEST7 -- unit test for: -# - pmemlog_append -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# -# Same as TEST1, but run on a single Device DAX device. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_dax_devices 1 -require_fs_type any - -setup - -dax_device_zero - -expect_normal_exit ./log_basic$EXESUFFIX $DEVICE_DAX_PATH c a n t w r t w l h - -check_pool $DEVICE_DAX_PATH - -pass diff --git a/src/test/log_basic/TEST8 b/src/test/log_basic/TEST8 deleted file mode 100755 index 9b17d44cfd6..00000000000 --- a/src/test/log_basic/TEST8 +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/log_basic/TEST8 -- unit test for: -# - pmemlog_append -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# -# Same as TEST1, but run on a pool set that spans two Device DAX devices -# with 4K alignment. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_dax_device_alignments 4096 4096 - -setup - -dax_device_zero - -create_poolset $DIR/testset AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]} - -expect_normal_exit ./log_basic$EXESUFFIX $DIR/testset c a n t w r t w l h - -check_pool $DIR/testset - -pass diff --git a/src/test/log_basic/TEST9 b/src/test/log_basic/TEST9 deleted file mode 100755 index 7f581ef1454..00000000000 --- a/src/test/log_basic/TEST9 +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2017-2019, Intel Corporation - -# -# src/test/log_basic/TEST9 -- unit test for: -# - pmemlog_append -# and: -# - pmemlog_nbyte -# - pmemlog_tell -# - pmemlog_walk -# - pmemlog_rewind -# in case of non-empty pool and -# - pmemlog_check -# - pmemlog_open -# - pmemlog_close -# -# Same as TEST1, but run on a pool set that spans two Device DAX devices -# with 2M alignment. Expected failure, as 2M alignment is not supported -# if SINGLEHDR option is not specified. -# - -. ../unittest/unittest.sh - -require_test_type medium -require_fs_type any -require_dax_device_alignments 2097152 2097152 # 2MiB - -setup - -dax_device_zero - -create_poolset $DIR/testset AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]} - -expect_abnormal_exit ./log_basic$EXESUFFIX $DIR/testset c a n t w r t w l h - -pass diff --git a/src/test/log_basic/log_basic.c b/src/test/log_basic/log_basic.c deleted file mode 100644 index 2239c53f258..00000000000 --- a/src/test/log_basic/log_basic.c +++ /dev/null @@ -1,289 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2019, Intel Corporation */ - -/* - * log_basic.c -- unit test for pmemlog_* - * - * usage: log_basic file operation:... - * - * operations are 'l' or 'h' or 'f' or 'c' or 'n' or 'a' or 'v' or 't' - * or 'r' or 'w' - * - */ - -#include "unittest.h" -#include "../libpmemlog/log.h" - -/* - * do_nbyte -- call pmemlog_nbyte() & print result - */ -static void -do_nbyte(PMEMlogpool *plp) -{ - size_t nbyte = pmemlog_nbyte(plp); - UT_OUT("usable size: %zu", nbyte); -} - -/* - * do_append -- call pmemlog_append() & print result - */ -static void -do_append(PMEMlogpool *plp) -{ - const char *str[6] = { - "1st test string\n", - "2nd test string\n", - "3rd test string\n", - "4th test string\n", - "5th test string\n", - "6th test string\n" - }; - - for (int i = 0; i < 6; ++i) { - int rv = pmemlog_append(plp, str[i], strlen(str[i])); - switch (rv) { - case 0: - UT_OUT("append str[%i] %s", i, str[i]); - break; - case -1: - UT_OUT("!append str[%i] %s", i, str[i]); - break; - default: - UT_OUT("!append: wrong return value"); - break; - } - } -} - -/* - * do_appendv -- call pmemlog_appendv() & print result - */ -static void -do_appendv(PMEMlogpool *plp) -{ - struct iovec iov[9] = { - { - .iov_base = "1st test string\n", - .iov_len = 16 - }, - { - .iov_base = "2nd test string\n", - .iov_len = 16 - }, - { - .iov_base = "3rd test string\n", - .iov_len = 16 - }, - { - .iov_base = "4th test string\n", - .iov_len = 16 - }, - { - .iov_base = "5th test string\n", - .iov_len = 16 - }, - { - .iov_base = "6th test string\n", - .iov_len = 16 - }, - { - .iov_base = "7th test string\n", - .iov_len = 16 - }, - { - .iov_base = "8th test string\n", - .iov_len = 16 - }, - { - .iov_base = "9th test string\n", - .iov_len = 16 - } - }; - - int rv = pmemlog_appendv(plp, iov, 9); - switch (rv) { - case 0: - UT_OUT("appendv"); - break; - case -1: - UT_OUT("!appendv"); - break; - default: - UT_OUT("!appendv: wrong return value"); - break; - } - - rv = pmemlog_appendv(plp, iov, 0); - UT_ASSERTeq(rv, 0); - - errno = 0; - rv = pmemlog_appendv(plp, iov, -3); - UT_ASSERTeq(errno, EINVAL); - UT_ASSERTeq(rv, -1); -} - -/* - * do_tell -- call pmemlog_tell() & print result - */ -static void -do_tell(PMEMlogpool *plp) -{ - os_off_t tell = pmemlog_tell(plp); - UT_OUT("tell %zu", tell); -} - -/* - * do_rewind -- call pmemlog_rewind() & print result - */ -static void -do_rewind(PMEMlogpool *plp) -{ - pmemlog_rewind(plp); - UT_OUT("rewind"); -} - -/* - * printit -- print out the 'buf' of length 'len'. - * - * It is a walker function for pmemlog_walk - */ -static int -printit(const void *buf, size_t len, void *arg) -{ - char *str = MALLOC(len + 1); - - strncpy(str, buf, len); - str[len] = '\0'; - UT_OUT("%s", str); - - FREE(str); - - return 1; -} - -/* - * do_walk -- call pmemlog_walk() & print result - * - * pmemlog_walk() is called twice: for chunk size 0 and 16 - */ -static void -do_walk(PMEMlogpool *plp) -{ - pmemlog_walk(plp, 0, printit, NULL); - UT_OUT("walk all at once"); - pmemlog_walk(plp, 16, printit, NULL); - UT_OUT("walk by 16"); -} - -/* - * do_create -- call pmemlog_create() and check if it was successful - */ -static PMEMlogpool * -do_create(const char *path) -{ - PMEMlogpool *_plp = pmemlog_create(path, 0, S_IWUSR | S_IRUSR); - if (_plp == NULL) - UT_FATAL("!pmemlog_create: %s", path); - - return _plp; -} - -/* - * do_fault_injection -- inject error in first Malloc() in pmemlog_create() - */ -static void -do_fault_injection(PMEMlogpool *plp, const char *path) -{ - if (pmemlog_fault_injection_enabled()) { - pmemlog_inject_fault_at(PMEM_MALLOC, 1, - "log_runtime_init"); - - plp = pmemlog_create(path, 0, S_IWUSR | S_IRUSR); - UT_ASSERTeq(plp, NULL); - UT_ASSERTeq(errno, ENOMEM); - } -} - -/* - * do_close -- call pmemlog_close() - */ -static void -do_close(PMEMlogpool *plp) -{ - pmemlog_close(plp); -} - -/* - * do_check -- call pmemlog_check() and check consistency - */ -static void -do_check(const char *path) -{ - int result = pmemlog_check(path); - if (result < 0) - UT_OUT("!%s: pmemlog_check", path); - else if (result == 0) - UT_OUT("%s: pmemlog_check: not consistent", path); -} - -int -main(int argc, char *argv[]) -{ - PMEMlogpool *plp; - - START(argc, argv, "log_basic"); - - if (argc < 3) - UT_FATAL("usage: %s file-name op:l|h|f|c|n|a|v|t|r|w", argv[0]); - - const char *path = argv[1]; - /* go through all arguments one by one */ - for (int arg = 2; arg < argc; arg++) { - /* Scan the character of each argument. */ - if (strchr("lhfcnavtrw", argv[arg][0]) == NULL || - argv[arg][1] != '\0') - UT_FATAL("op must be l or h or f or c or n or a or v\ - or t or r or w"); - - switch (argv[arg][0]) { - case 'c': - plp = do_create(path); - break; - case 'n': - do_nbyte(plp); - break; - - case 'a': - do_append(plp); - break; - - case 'v': - do_appendv(plp); - break; - - case 't': - do_tell(plp); - break; - - case 'r': - do_rewind(plp); - break; - - case 'w': - do_walk(plp); - break; - - case 'f': - do_fault_injection(plp, path); - break; - case 'l': - do_close(plp); - break; - case 'h': - do_check(path); - break; - } - } - - DONE(NULL); -} diff --git a/src/test/log_basic/out0.log.match b/src/test/log_basic/out0.log.match deleted file mode 100644 index e8ff979224a..00000000000 --- a/src/test/log_basic/out0.log.match +++ /dev/null @@ -1,10 +0,0 @@ -log_basic$(nW)TEST0: START: log_basic - $(nW)log_basic$(nW) $(nW)testfile1 c n t w r l h -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -tell 0 - -walk all at once -walk by 16 -rewind -log_basic$(nW)TEST0: DONE diff --git a/src/test/log_basic/out1.log.match b/src/test/log_basic/out1.log.match deleted file mode 100644 index a44eb630880..00000000000 --- a/src/test/log_basic/out1.log.match +++ /dev/null @@ -1,44 +0,0 @@ -log_basic$(nW)TEST1: START: log_basic - $(nW)log_basic$(nW) $(nW)testfile1 c a n t w r t w l h -append str[0] 1st test string - -append str[1] 2nd test string - -append str[2] 3rd test string - -append str[3] 4th test string - -append str[4] 5th test string - -append str[5] 6th test string - -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -tell 96 -1st test string -2nd test string -3rd test string -4th test string -5th test string -6th test string - -walk all at once -1st test string - -2nd test string - -3rd test string - -4th test string - -5th test string - -6th test string - -walk by 16 -rewind -tell 0 - -walk all at once -walk by 16 -log_basic$(nW)TEST1: DONE diff --git a/src/test/log_basic/out2.log.match b/src/test/log_basic/out2.log.match deleted file mode 100644 index 7d7d20c68b7..00000000000 --- a/src/test/log_basic/out2.log.match +++ /dev/null @@ -1,42 +0,0 @@ -log_basic$(nW)TEST2: START: log_basic - $(nW)log_basic$(nW) $(nW)testfile1 c v n t w r t w l h -appendv -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -tell 144 -1st test string -2nd test string -3rd test string -4th test string -5th test string -6th test string -7th test string -8th test string -9th test string - -walk all at once -1st test string - -2nd test string - -3rd test string - -4th test string - -5th test string - -6th test string - -7th test string - -8th test string - -9th test string - -walk by 16 -rewind -tell 0 - -walk all at once -walk by 16 -log_basic$(nW)TEST2: DONE diff --git a/src/test/log_basic/out3.log.match b/src/test/log_basic/out3.log.match deleted file mode 100644 index 657100f2556..00000000000 --- a/src/test/log_basic/out3.log.match +++ /dev/null @@ -1,83 +0,0 @@ -log_basic$(nW)TEST3: START: log_basic - $(nW)log_basic$(nW) $(nW)testfile1 c a n t w r t w v n t w r t w l h -append str[0] 1st test string - -append str[1] 2nd test string - -append str[2] 3rd test string - -append str[3] 4th test string - -append str[4] 5th test string - -append str[5] 6th test string - -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -tell 96 -1st test string -2nd test string -3rd test string -4th test string -5th test string -6th test string - -walk all at once -1st test string - -2nd test string - -3rd test string - -4th test string - -5th test string - -6th test string - -walk by 16 -rewind -tell 0 - -walk all at once -walk by 16 -appendv -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -tell 144 -1st test string -2nd test string -3rd test string -4th test string -5th test string -6th test string -7th test string -8th test string -9th test string - -walk all at once -1st test string - -2nd test string - -3rd test string - -4th test string - -5th test string - -6th test string - -7th test string - -8th test string - -9th test string - -walk by 16 -rewind -tell 0 - -walk all at once -walk by 16 -log_basic$(nW)TEST3: DONE diff --git a/src/test/log_basic/out4.log.match b/src/test/log_basic/out4.log.match deleted file mode 100644 index 65fa3128112..00000000000 --- a/src/test/log_basic/out4.log.match +++ /dev/null @@ -1,83 +0,0 @@ -log_basic$(nW)TEST4: START: log_basic - $(nW)log_basic$(nW) $(nW)testfile1 c a n t w r t w v n t w r t w l h -append str[0] 1st test string - -append str[1] 2nd test string - -append str[2] 3rd test string - -append str[3] 4th test string - -append str[4] 5th test string - -append str[5] 6th test string - -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -tell 96 -1st test string -2nd test string -3rd test string -4th test string -5th test string -6th test string - -walk all at once -1st test string - -2nd test string - -3rd test string - -4th test string - -5th test string - -6th test string - -walk by 16 -rewind -tell 0 - -walk all at once -walk by 16 -appendv -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -tell 144 -1st test string -2nd test string -3rd test string -4th test string -5th test string -6th test string -7th test string -8th test string -9th test string - -walk all at once -1st test string - -2nd test string - -3rd test string - -4th test string - -5th test string - -6th test string - -7th test string - -8th test string - -9th test string - -walk by 16 -rewind -tell 0 - -walk all at once -walk by 16 -log_basic$(nW)TEST4: DONE diff --git a/src/test/log_basic/out5.log.match b/src/test/log_basic/out5.log.match deleted file mode 100644 index 8ae3695b1ae..00000000000 --- a/src/test/log_basic/out5.log.match +++ /dev/null @@ -1,5 +0,0 @@ -log_basic$(nW)TEST5: START: log_basic - $(nW)log_basic$(nW) $(nW)testset1 c n l h -$(OPT)usable size: 2088960 -$(OPX)usable size: 1966080 -log_basic$(nW)TEST5: DONE diff --git a/src/test/log_basic/out6.log.match b/src/test/log_basic/out6.log.match deleted file mode 100644 index b7d221173a6..00000000000 --- a/src/test/log_basic/out6.log.match +++ /dev/null @@ -1,5 +0,0 @@ -log_basic$(nW)TEST6: START: log_basic - $(nW)log_basic$(nW) $(nW)testset1 c n l h -$(OPT)usable size: 4182016 -$(OPX)usable size: 3997696 -log_basic$(nW)TEST6: DONE diff --git a/src/test/log_include/.gitignore b/src/test/log_include/.gitignore deleted file mode 100644 index 27c4c309680..00000000000 --- a/src/test/log_include/.gitignore +++ /dev/null @@ -1 +0,0 @@ -log_include diff --git a/src/test/log_include/Makefile b/src/test/log_include/Makefile deleted file mode 100644 index 8b72bfacc9c..00000000000 --- a/src/test/log_include/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2023, Intel Corporation - -# -# src/test/log_include/Makefile -- compilation test for libpmemlog -# -TARGET = log_include -OBJS = log_include.o - -LIBPMEMLOG=y - -include ../Makefile.inc - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/log_include/log_include.c b/src/test/log_include/log_include.c deleted file mode 100644 index cd4d17512d0..00000000000 --- a/src/test/log_include/log_include.c +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2016, Intel Corporation */ - -/* - * log_include.c -- include test for libpmemlog - * - * this is only a compilation test - do not run this program - */ - -#include - -int -main(int argc, char *argv[]) -{ - return 0; -} diff --git a/src/test/log_pool/.gitignore b/src/test/log_pool/.gitignore deleted file mode 100644 index da473776d08..00000000000 --- a/src/test/log_pool/.gitignore +++ /dev/null @@ -1 +0,0 @@ -log_pool diff --git a/src/test/log_pool/Makefile b/src/test/log_pool/Makefile deleted file mode 100644 index fccda5feab5..00000000000 --- a/src/test/log_pool/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2023, Intel Corporation - -# -# src/test/log_pool/Makefile -- build log_pool unit test -# -TARGET = log_pool -OBJS = log_pool.o - -LIBPMEMLOG=y -USE_PMEMSPOIL=y - -include ../Makefile.inc - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/log_pool/README b/src/test/log_pool/README deleted file mode 100644 index 498cb6970b3..00000000000 --- a/src/test/log_pool/README +++ /dev/null @@ -1,63 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/log_pool/README. - -This directory contains a unit test for pmemlog_create() and pmemlog_open(). - -The program in log_pool.c takes: operation, path, poolsize, mode -Operation can be: - c - create - o - open - -For example: - - ./log_pool c /my/file 20 0640 - -This calls pmemlog_create() with the given arguments. Note that poolsize -is given in megabytes. - -Test cases: - -- pmemlog_create: - -TEST0 (pass) non-existing file, poolsize >= min required size -TEST1 (pass) existing file, file length >= min required size, poolsize == 0 -TEST2 (fail) non-existing file, poolsize == 0 -TEST3 (fail) existing file, file length >= min required size, poolsize != 0 -TEST4 (fail) existing file, file length < min required size, poolsize == 0 -TEST5 (fail) non-existing file, poolsize >= min required size - (path is invalid, directory does not exist) -TEST6 (fail) existing file, file length >= min required size, poolsize == 0 - (file contains garbage) -TEST7 (pass) existing file, file length >= min required size, poolsize == 0 - (file contains garbage, except for header) -TEST8 (fail) non-existing file, poolsize < min required size -TEST9 (fail) existing file, file length >= min required size, poolsize == 0 - (no read permissions) -TEST10 (fail) existing file, file length >= min required size, poolsize == 0 - (no write permissions) -TEST11 (pass) non-existing file, poolsize >= min required size - (pool set) -TEST12 (fail) non-existing file, poolsize >= min required size - (pool set with replica section) -- pmemlog_open: - -TEST20 (fail) non-existing file -TEST21 (fail) existing file, file length < min required size -TEST22 (fail) existing file, file length < min required size - (valid pool header) -TEST23 (fail) existing file, file length >= min required size - (empty pool header) -TEST24 (fail) existing file, file length >= min required size - (no read permissions) -TEST25 (fail) existing file, file length >= min required size - (no write permissions) -TEST26 (pass) existing file, file length >= min required size -TEST27 (pass) existing file, file length >= min required size - (pool set) -TEST28 (fail) existing file, file length >= min required size - (pool set with replica section) - -- each case outputs: - - error, if error happened - - resulting file size, mode, consistency check results diff --git a/src/test/log_pool/TEST0 b/src/test/log_pool/TEST0 deleted file mode 100755 index 9b4360babc3..00000000000 --- a/src/test/log_pool/TEST0 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST0 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST0 non-existing file, poolsize > 0 -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 20 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST1 b/src/test/log_pool/TEST1 deleted file mode 100755 index b34c6531f9d..00000000000 --- a/src/test/log_pool/TEST1 +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST1 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_holey_file 40M $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST1 existing file, file length >= min required size, poolsize == 0 -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST10 b/src/test/log_pool/TEST10 deleted file mode 100755 index 87b97262f15..00000000000 --- a/src/test/log_pool/TEST10 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST10 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -create_holey_file 20M $DIR/testfile -chmod 0440 $DIR/testfile - -# -# TEST11 existing file, file length >= min required size, poolsize == 0, -# (no write permissions) -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST11 b/src/test/log_pool/TEST11 deleted file mode 100755 index c36ff0ec7ef..00000000000 --- a/src/test/log_pool/TEST11 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/log_pool/TEST11 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST11 non-existing file, poolsize > 0 -# (pool set) -# -create_poolset $DIR/testset 20M:$DIR/testfile1:x 20M:$DIR/testfile2:x - -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testset 0 0600 - -check_files $DIR/testset $DIR/testfile1 $DIR/testfile2 - -check - -pass diff --git a/src/test/log_pool/TEST12 b/src/test/log_pool/TEST12 deleted file mode 100755 index 70a0cf622a0..00000000000 --- a/src/test/log_pool/TEST12 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/log_pool/TEST12 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST12 non-existing file, poolsize > 0 -# (pool set with replica section) -# -create_poolset $DIR/testset 20M:$DIR/testfile1:x R 20M:$DIR/testfile2:x - -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testset 0 0600 - -check_files $DIR/testset -check_no_files $DIR/testfile1 $DIR/testfile2 - -check - -pass diff --git a/src/test/log_pool/TEST2 b/src/test/log_pool/TEST2 deleted file mode 100755 index 30fc9a4a837..00000000000 --- a/src/test/log_pool/TEST2 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST2 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST2 non-existing file, poolsize == 0 -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 0 0600 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST20 b/src/test/log_pool/TEST20 deleted file mode 100755 index 2cfad4adf10..00000000000 --- a/src/test/log_pool/TEST20 +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST20 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST20 non-existing file -# -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST21 b/src/test/log_pool/TEST21 deleted file mode 100755 index 482569bf3f1..00000000000 --- a/src/test/log_pool/TEST21 +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST21 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_holey_file 1M $DIR/testfile - -# -# TEST21 existing file, file size < min required size -# -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testfile - -rm $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST22 b/src/test/log_pool/TEST22 deleted file mode 100755 index eee40695bb0..00000000000 --- a/src/test/log_pool/TEST22 +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST22 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST22 existing file, file size < min required size -# (valid pool header) -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 20 0640 -truncate -s 1M $DIR/testfile - -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST23 b/src/test/log_pool/TEST23 deleted file mode 100755 index 740e40c57db..00000000000 --- a/src/test/log_pool/TEST23 +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST23 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_holey_file 20M $DIR/testfile - -# -# TEST23 existing file, file size >= min required size -# (empty pool header) -# -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST24 b/src/test/log_pool/TEST24 deleted file mode 100755 index e2d7631f8f2..00000000000 --- a/src/test/log_pool/TEST24 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST24 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -# -# TEST24 existing file, file size >= min required size -# (no read permissions) -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 20 0640 -chmod -r $DIR/testfile - -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST25 b/src/test/log_pool/TEST25 deleted file mode 100755 index f4c5c496cbe..00000000000 --- a/src/test/log_pool/TEST25 +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST25 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -# -# TEST25 existing file, file size >= min required size -# (no write permissions) -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 20 0640 -chmod -w $DIR/testfile - -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST26 b/src/test/log_pool/TEST26 deleted file mode 100755 index 41dcd30d19c..00000000000 --- a/src/test/log_pool/TEST26 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST26 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST26 existing file, file size >= min required size -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 20 0640 - -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST27 b/src/test/log_pool/TEST27 deleted file mode 100755 index f732d7bef48..00000000000 --- a/src/test/log_pool/TEST27 +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/log_pool/TEST27 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST27 existing file, file size >= min required size -# -create_poolset $DIR/testset 20M:$DIR/testfile1:x 20M:$DIR/testfile2:x - -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testset 0 0640 - -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testset - -check - -pass diff --git a/src/test/log_pool/TEST28 b/src/test/log_pool/TEST28 deleted file mode 100755 index 13dcd2e35df..00000000000 --- a/src/test/log_pool/TEST28 +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2019, Intel Corporation - -# -# src/test/log_pool/TEST28 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST28 existing file, file size >= min required size -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile1 20 0640 - -cp $DIR/testfile1 $DIR/testfile2 - -$PMEMSPOIL $DIR/testfile1 pool_hdr.uuid=1111111111111111 \ - pool_hdr.next_part_uuid=1111111111111111 \ - pool_hdr.prev_part_uuid=1111111111111111 \ - pool_hdr.next_repl_uuid=2222222222222222 \ - pool_hdr.prev_repl_uuid=2222222222222222 \ - "pool_hdr.f:checksum_gen" - -$PMEMSPOIL $DIR/testfile2 pool_hdr.uuid=2222222222222222 \ - pool_hdr.next_part_uuid=2222222222222222 \ - pool_hdr.prev_part_uuid=2222222222222222 \ - pool_hdr.next_repl_uuid=1111111111111111 \ - pool_hdr.prev_repl_uuid=1111111111111111 \ - "pool_hdr.f:checksum_gen" - -create_poolset $DIR/testset 20M:$DIR/testfile1 R 20M:$DIR/testfile2 - -expect_normal_exit ./log_pool$EXESUFFIX o $DIR/testset - -check - -pass diff --git a/src/test/log_pool/TEST3 b/src/test/log_pool/TEST3 deleted file mode 100755 index 5ff3e4d0a20..00000000000 --- a/src/test/log_pool/TEST3 +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST3 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_holey_file 20M $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST3 existing file, file length >= min required size, poolsize > 0 -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 20 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST4 b/src/test/log_pool/TEST4 deleted file mode 100755 index abe68c4fe93..00000000000 --- a/src/test/log_pool/TEST4 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST4 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -touch $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST4 existing file, file length < min required size, poolsize == 0 -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST5 b/src/test/log_pool/TEST5 deleted file mode 100755 index ece84dc8d52..00000000000 --- a/src/test/log_pool/TEST5 +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST5 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST5 non-existing file, poolsize > 0 -# (path is invalid, directory does not exist) -# -expect_normal_exit ./log_pool$EXESUFFIX c /NULL/testfile 20 0600 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST6 b/src/test/log_pool/TEST6 deleted file mode 100755 index 794e55c28e3..00000000000 --- a/src/test/log_pool/TEST6 +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST6 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_nonzeroed_file 2M 0K $DIR/testfile -chmod 0640 $DIR/testfile - -# -# TEST6 existing file, file length >= min required size, poolsize == 0 -# (file contains garbage) -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST7 b/src/test/log_pool/TEST7 deleted file mode 100755 index 0048f0b294e..00000000000 --- a/src/test/log_pool/TEST7 +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2020, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST7 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -create_nonzeroed_file 2M $(log_pool_desc_size) $DIR/testfile -chmod 0600 $DIR/testfile - -# -# TEST7 existing file, file length >= min required size, poolsize == 0 -# (file contains garbage, except for header) -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST8 b/src/test/log_pool/TEST8 deleted file mode 100755 index 6b9ce62d97a..00000000000 --- a/src/test/log_pool/TEST8 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool/TEST8 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -setup -umask 0 - -# -# TEST8 non-existing file, poolsize < min required size -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 1 0600 - -check_no_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/TEST9 b/src/test/log_pool/TEST9 deleted file mode 100755 index 2a729c5966a..00000000000 --- a/src/test/log_pool/TEST9 +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -# -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation -# -# Copyright (c) 2016, Microsoft Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# * Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# -# src/test/log_pool/TEST9 -- unit test for pmemlog_create -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_no_superuser - -setup -umask 0 - -create_holey_file 20M $DIR/testfile -chmod 0240 $DIR/testfile - -# -# TEST9 existing file, file length >= min required size, poolsize == 0, -# (no read permissions) -# -expect_normal_exit ./log_pool$EXESUFFIX c $DIR/testfile 0 0600 - -check_files $DIR/testfile - -check - -pass diff --git a/src/test/log_pool/log_pool.c b/src/test/log_pool/log_pool.c deleted file mode 100644 index 8f6cb8c2084..00000000000 --- a/src/test/log_pool/log_pool.c +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2017, Intel Corporation */ - -/* - * log_pool.c -- unit test for pmemlog_create() and pmemlog_open() - * - * usage: log_pool op path [poolsize mode] - * - * op can be: - * c - create - * o - open - * - * "poolsize" and "mode" arguments are ignored for "open" - */ -#include "unittest.h" - -#define MB ((size_t)1 << 20) - -static void -pool_create(const char *path, size_t poolsize, unsigned mode) -{ - PMEMlogpool *plp = pmemlog_create(path, poolsize, mode); - - if (plp == NULL) - UT_OUT("!%s: pmemlog_create", path); - else { - os_stat_t stbuf; - STAT(path, &stbuf); - - UT_OUT("%s: file size %zu usable space %zu mode 0%o", - path, stbuf.st_size, - pmemlog_nbyte(plp), - stbuf.st_mode & 0777); - - pmemlog_close(plp); - - int result = pmemlog_check(path); - - if (result < 0) - UT_OUT("!%s: pmemlog_check", path); - else if (result == 0) - UT_OUT("%s: pmemlog_check: not consistent", path); - } -} - -static void -pool_open(const char *path) -{ - PMEMlogpool *plp = pmemlog_open(path); - if (plp == NULL) - UT_OUT("!%s: pmemlog_open", path); - else { - UT_OUT("%s: pmemlog_open: Success", path); - pmemlog_close(plp); - } -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "log_pool"); - - if (argc < 3) - UT_FATAL("usage: %s op path [poolsize mode]", argv[0]); - - size_t poolsize; - unsigned mode; - - switch (argv[1][0]) { - case 'c': - poolsize = strtoul(argv[3], NULL, 0) * MB; /* in megabytes */ - mode = strtoul(argv[4], NULL, 8); - - pool_create(argv[2], poolsize, mode); - break; - - case 'o': - pool_open(argv[2]); - break; - - default: - UT_FATAL("unknown operation"); - } - - DONE(NULL); -} diff --git a/src/test/log_pool/out0.log.match b/src/test/log_pool/out0.log.match deleted file mode 100644 index ae4a99ddf45..00000000000 --- a/src/test/log_pool/out0.log.match +++ /dev/null @@ -1,5 +0,0 @@ -log_pool$(nW)TEST0: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 20 0600 -$(OPT)$(nW)testfile: file size 20971520 usable space 20963328 mode 0600 -$(OPX)$(nW)testfile: file size 20971520 usable space 20840448 mode 0600 -log_pool$(nW)TEST0: DONE diff --git a/src/test/log_pool/out1.log.match b/src/test/log_pool/out1.log.match deleted file mode 100644 index 6c09899bc79..00000000000 --- a/src/test/log_pool/out1.log.match +++ /dev/null @@ -1,5 +0,0 @@ -log_pool$(nW)TEST1: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 0 0600 -$(OPT)$(nW)testfile: file size 41943040 usable space 41934848 mode 0600 -$(OPX)$(nW)testfile: file size 41943040 usable space 41811968 mode 0600 -log_pool$(nW)TEST1: DONE diff --git a/src/test/log_pool/out10.log.match b/src/test/log_pool/out10.log.match deleted file mode 100644 index 34eddb396e2..00000000000 --- a/src/test/log_pool/out10.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST10: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 0 0600 -$(nW)testfile: pmemlog_create: Permission denied -log_pool$(nW)TEST10: DONE diff --git a/src/test/log_pool/out11.log.match b/src/test/log_pool/out11.log.match deleted file mode 100644 index 8ae2fb00821..00000000000 --- a/src/test/log_pool/out11.log.match +++ /dev/null @@ -1,5 +0,0 @@ -log_pool$(nW)TEST11: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testset 0 0600 -$(OPT)$(nW)testset: file size $(N) usable space 41930752 mode 0666 -$(OPX)$(nW)testset: file size $(N) usable space 41746432 mode 0666 -log_pool$(nW)TEST11: DONE diff --git a/src/test/log_pool/out12.log.match b/src/test/log_pool/out12.log.match deleted file mode 100644 index 150f637cd05..00000000000 --- a/src/test/log_pool/out12.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST12: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testset 0 0600 -$(nW)testset: pmemlog_create: Operation not supported -log_pool$(nW)TEST12: DONE diff --git a/src/test/log_pool/out2.log.match b/src/test/log_pool/out2.log.match deleted file mode 100644 index 7b4e3f99543..00000000000 --- a/src/test/log_pool/out2.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST2: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 0 0600 -$(nW)testfile: pmemlog_create: No such file or directory -log_pool$(nW)TEST2: DONE diff --git a/src/test/log_pool/out20.log.match b/src/test/log_pool/out20.log.match deleted file mode 100644 index 0486bbda597..00000000000 --- a/src/test/log_pool/out20.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST20: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testfile -$(nW)testfile: pmemlog_open: No such file or directory -log_pool$(nW)TEST20: DONE diff --git a/src/test/log_pool/out21.log.match b/src/test/log_pool/out21.log.match deleted file mode 100644 index d3f6986241e..00000000000 --- a/src/test/log_pool/out21.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST21: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testfile -$(nW)testfile: pmemlog_open: Invalid argument -log_pool$(nW)TEST21: DONE diff --git a/src/test/log_pool/out22.log.match b/src/test/log_pool/out22.log.match deleted file mode 100644 index de91b00481e..00000000000 --- a/src/test/log_pool/out22.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST22: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testfile -$(nW)testfile: pmemlog_open: Invalid argument -log_pool$(nW)TEST22: DONE diff --git a/src/test/log_pool/out23.log.match b/src/test/log_pool/out23.log.match deleted file mode 100644 index 173030c565a..00000000000 --- a/src/test/log_pool/out23.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST23: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testfile -$(nW)testfile: pmemlog_open: Invalid argument -log_pool$(nW)TEST23: DONE diff --git a/src/test/log_pool/out24.log.match b/src/test/log_pool/out24.log.match deleted file mode 100644 index 68a114403d3..00000000000 --- a/src/test/log_pool/out24.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST24: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testfile -$(nW)testfile: pmemlog_open: Permission denied -log_pool$(nW)TEST24: DONE diff --git a/src/test/log_pool/out25.log.match b/src/test/log_pool/out25.log.match deleted file mode 100644 index 43fa888f32e..00000000000 --- a/src/test/log_pool/out25.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST25: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testfile -$(nW)testfile: pmemlog_open: Permission denied -log_pool$(nW)TEST25: DONE diff --git a/src/test/log_pool/out26.log.match b/src/test/log_pool/out26.log.match deleted file mode 100644 index 532f6a6c1ba..00000000000 --- a/src/test/log_pool/out26.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST26: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testfile -$(nW)testfile: pmemlog_open: Success -log_pool$(nW)TEST26: DONE diff --git a/src/test/log_pool/out27.log.match b/src/test/log_pool/out27.log.match deleted file mode 100644 index 5c641c07cb9..00000000000 --- a/src/test/log_pool/out27.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST27: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testset -$(nW)testset: pmemlog_open: Success -log_pool$(nW)TEST27: DONE diff --git a/src/test/log_pool/out28.log.match b/src/test/log_pool/out28.log.match deleted file mode 100644 index 959e797e1f9..00000000000 --- a/src/test/log_pool/out28.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST28: START: log_pool$(nW) - $(nW)log_pool$(nW) o $(nW)testset -$(nW)testset: pmemlog_open: Operation not supported -log_pool$(nW)TEST28: DONE diff --git a/src/test/log_pool/out3.log.match b/src/test/log_pool/out3.log.match deleted file mode 100644 index 51ddd7342c1..00000000000 --- a/src/test/log_pool/out3.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST3: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 20 0600 -$(nW)testfile: pmemlog_create: File exists -log_pool$(nW)TEST3: DONE diff --git a/src/test/log_pool/out4.log.match b/src/test/log_pool/out4.log.match deleted file mode 100644 index c638d83eb04..00000000000 --- a/src/test/log_pool/out4.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST4: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 0 0600 -$(nW)testfile: pmemlog_create: Invalid argument -log_pool$(nW)TEST4: DONE diff --git a/src/test/log_pool/out5.log.match b/src/test/log_pool/out5.log.match deleted file mode 100644 index 039b77faade..00000000000 --- a/src/test/log_pool/out5.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST5: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)NULL$(nW)testfile 20 0600 -$(nW)NULL$(nW)testfile: pmemlog_create: No such file or directory -log_pool$(nW)TEST5: DONE diff --git a/src/test/log_pool/out6.log.match b/src/test/log_pool/out6.log.match deleted file mode 100644 index 7e8555905b3..00000000000 --- a/src/test/log_pool/out6.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST6: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 0 0600 -$(nW)testfile: pmemlog_create: File exists -log_pool$(nW)TEST6: DONE diff --git a/src/test/log_pool/out7.log.match b/src/test/log_pool/out7.log.match deleted file mode 100644 index b08a1177552..00000000000 --- a/src/test/log_pool/out7.log.match +++ /dev/null @@ -1,5 +0,0 @@ -log_pool$(nW)TEST7: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 0 0600 -$(OPT)$(nW)testfile: file size 2097152 usable space 2088960 mode 0600 -$(OPX)$(nW)testfile: file size 2097152 usable space 1966080 mode 0600 -log_pool$(nW)TEST7: DONE diff --git a/src/test/log_pool/out8.log.match b/src/test/log_pool/out8.log.match deleted file mode 100644 index 390ffeaa51b..00000000000 --- a/src/test/log_pool/out8.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST8: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 1 0600 -$(nW)testfile: pmemlog_create: Invalid argument -log_pool$(nW)TEST8: DONE diff --git a/src/test/log_pool/out9.log.match b/src/test/log_pool/out9.log.match deleted file mode 100644 index 74d92b54e9e..00000000000 --- a/src/test/log_pool/out9.log.match +++ /dev/null @@ -1,4 +0,0 @@ -log_pool$(nW)TEST9: START: log_pool$(nW) - $(nW)log_pool$(nW) c $(nW)testfile 0 0600 -$(nW)testfile: pmemlog_create: Permission denied -log_pool$(nW)TEST9: DONE diff --git a/src/test/log_pool_lock/.gitignore b/src/test/log_pool_lock/.gitignore deleted file mode 100644 index 3ce82dc6caa..00000000000 --- a/src/test/log_pool_lock/.gitignore +++ /dev/null @@ -1 +0,0 @@ -log_pool_lock diff --git a/src/test/log_pool_lock/Makefile b/src/test/log_pool_lock/Makefile deleted file mode 100644 index f020f044b57..00000000000 --- a/src/test/log_pool_lock/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2023, Intel Corporation - -# -# src/test/log_pool_lock/Makefile -- build log_pool_lock unit test -# -TARGET = log_pool_lock -OBJS = log_pool_lock.o - -LIBPMEMLOG=y - -include ../Makefile.inc - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations - diff --git a/src/test/log_pool_lock/TEST0 b/src/test/log_pool_lock/TEST0 deleted file mode 100755 index 27b29c041fb..00000000000 --- a/src/test/log_pool_lock/TEST0 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2019, Intel Corporation - -# -# src/test/log_pool_lock/TEST0 -- unit test for pmemlog_open -# - -. ../unittest/unittest.sh - -require_test_type medium -require_no_superuser - -setup - -expect_normal_exit ./log_pool_lock$EXESUFFIX $DIR/testfile - -pass diff --git a/src/test/log_pool_lock/log_pool_lock.c b/src/test/log_pool_lock/log_pool_lock.c deleted file mode 100644 index eab6c3d803d..00000000000 --- a/src/test/log_pool_lock/log_pool_lock.c +++ /dev/null @@ -1,97 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2023, Intel Corporation */ - -/* - * log_pool_lock.c -- unit test which checks whether it's possible to - * simultaneously open the same log pool - */ - -#include "unittest.h" - -static void -test_reopen(const char *path) -{ - PMEMlogpool *log1 = pmemlog_create(path, PMEMLOG_MIN_POOL, - S_IWUSR | S_IRUSR); - if (!log1) - UT_FATAL("!create"); - - PMEMlogpool *log2 = pmemlog_open(path); - if (log2) - UT_FATAL("pmemlog_open should not succeed"); - - if (errno != EWOULDBLOCK) - UT_FATAL("!pmemlog_open failed but for unexpected reason"); - - pmemlog_close(log1); - - log2 = pmemlog_open(path); - if (!log2) - UT_FATAL("pmemlog_open should succeed after close"); - - pmemlog_close(log2); - - UNLINK(path); -} - -static void -test_open_in_different_process(int argc, char **argv, unsigned sleep) -{ - pid_t pid = fork(); - PMEMlogpool *log; - char *path = argv[1]; - - if (pid < 0) - UT_FATAL("fork failed"); - - if (pid == 0) { - /* child */ - if (sleep) - usleep(sleep); - while (os_access(path, R_OK)) - usleep(100 * 1000); - - log = pmemlog_open(path); - if (log) - UT_FATAL("pmemlog_open after fork should not succeed"); - - if (errno != EWOULDBLOCK) - UT_FATAL("!pmemlog_open after fork failed but for " - "unexpected reason"); - - exit(0); - } - - log = pmemlog_create(path, PMEMLOG_MIN_POOL, S_IWUSR | S_IRUSR); - if (!log) - UT_FATAL("!create"); - - int status; - - if (waitpid(pid, &status, 0) < 0) - UT_FATAL("!waitpid failed"); - - if (!WIFEXITED(status)) - UT_FATAL("child process failed"); - - pmemlog_close(log); - - UNLINK(path); -} - -int -main(int argc, char *argv[]) -{ - START(argc, argv, "log_pool_lock"); - - if (argc != 2) { - UT_FATAL("usage: %s path", argv[0]); - } else { - test_reopen(argv[1]); - test_open_in_different_process(argc, argv, 0); - for (unsigned i = 1; i < 100000; i *= 2) - test_open_in_different_process(argc, argv, i); - } - - DONE(NULL); -} diff --git a/src/test/log_recovery/.gitignore b/src/test/log_recovery/.gitignore deleted file mode 100644 index af57d6618b0..00000000000 --- a/src/test/log_recovery/.gitignore +++ /dev/null @@ -1 +0,0 @@ -log_recovery diff --git a/src/test/log_recovery/Makefile b/src/test/log_recovery/Makefile deleted file mode 100644 index 6b2740796c0..00000000000 --- a/src/test/log_recovery/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# src/test/log_recovery/Makefile -- build log_recovery unit test -# -TARGET = log_recovery -OBJS = log_recovery.o - -LIBPMEMLOG=y - -include ../Makefile.inc -CFLAGS += -I../../libpmemlog - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations - diff --git a/src/test/log_recovery/README b/src/test/log_recovery/README deleted file mode 100644 index 8adede041c3..00000000000 --- a/src/test/log_recovery/README +++ /dev/null @@ -1,20 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/log_recovery/README. - -This directory contains a unit test for pmemlog recovery. It works only -in non-debug mode. - -The program in log_recovery.c takes a file name and an operation as arguments. -An operation is encoded as a character 'a' or 'v'. The first one means that -pmemlog_append() will be used to append data and the second one means that -pmemlog_appendv() will be used to do that. For example: - - ./log_recovery file1 a - -this will call pmemlog_open() on file1, call pmemlog_append() to append -six strings to the log and pmemlog_tell() to check the current write point, -then it will change the memory protection on the metadata area to read-only. -Next, pmemlog_append() is called again and SIGSEGV is caught and reported. -Finally, pmemblk_check() and pmemlog_tell() are called to make sure there are -no partial log entries. diff --git a/src/test/log_recovery/TEST0 b/src/test/log_recovery/TEST0 deleted file mode 100755 index bd2e6b10b06..00000000000 --- a/src/test/log_recovery/TEST0 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/log_recovery/TEST0 -- unit test for pmemlog recovery -# pmemlog_append() is used to append data -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_build_type nondebug static-nondebug - -# exits with locked mutexes -configure_valgrind helgrind force-disable -configure_valgrind drd force-disable -configure_valgrind pmemcheck force-disable - -setup - -# this test invokes sigsegvs by design -export ASAN_OPTIONS=handle_segv=0 - -touch $DIR/testfile1 - -expect_normal_exit ./log_recovery$EXESUFFIX $DIR/testfile1 a - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/log_recovery/TEST1 b/src/test/log_recovery/TEST1 deleted file mode 100755 index 04cd4abbd54..00000000000 --- a/src/test/log_recovery/TEST1 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/log_recovery/TEST0 -- unit test for pmemlog recovery -# pmemlog_appendv() is used to append data -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_build_type nondebug static-nondebug - -# exits with locked mutexes -configure_valgrind helgrind force-disable -configure_valgrind drd force-disable -configure_valgrind pmemcheck force-disable - -setup - -# this test invokes sigsegvs by design -export ASAN_OPTIONS=handle_segv=0 - -touch $DIR/testfile1 - -expect_normal_exit ./log_recovery$EXESUFFIX $DIR/testfile1 v - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/log_recovery/log_recovery.c b/src/test/log_recovery/log_recovery.c deleted file mode 100644 index 04e92a3b71c..00000000000 --- a/src/test/log_recovery/log_recovery.c +++ /dev/null @@ -1,237 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2018, Intel Corporation */ - -/* - * log_recovery.c -- unit test for pmemlog recovery - * - * usage: log_recovery file operation:... - * - * operation has to be 'a' or 'v' - * - */ - -#include -#include "unittest.h" -#include "log.h" - -/* - * do_append -- call pmemlog_append() & print result - */ -static void -do_append(PMEMlogpool *plp) -{ - const char *str[6] = { - "1st append string\n", - "2nd append string\n", - "3rd append string\n", - "4th append string\n", - "5th append string\n", - "6th append string\n" - }; - - for (int i = 0; i < 6; ++i) { - int rv = pmemlog_append(plp, str[i], strlen(str[i])); - switch (rv) { - case 0: - UT_OUT("append str[%i] %s", i, str[i]); - break; - case -1: - UT_OUT("!append str[%i] %s", i, str[i]); - break; - default: - UT_OUT("!append: wrong return value"); - break; - } - } -} - -/* - * do_appendv -- call pmemlog_appendv() & print result - */ -static void -do_appendv(PMEMlogpool *plp) -{ - struct iovec iov[9] = { - { - .iov_base = "1st appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "2nd appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "3rd appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "4th appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "5th appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "6th appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "7th appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "8th appendv string\n", - .iov_len = 19 - }, - { - .iov_base = "9th appendv string\n", - .iov_len = 19 - } - }; - - int rv = pmemlog_appendv(plp, iov, 9); - switch (rv) { - case 0: - UT_OUT("appendv"); - break; - case -1: - UT_OUT("!appendv"); - break; - default: - UT_OUT("!appendv: wrong return value"); - break; - } -} - -/* - * do_tell -- call pmemlog_tell() & print result - */ -static void -do_tell(PMEMlogpool *plp) -{ - os_off_t tell = pmemlog_tell(plp); - UT_OUT("tell %zu", tell); -} - -/* - * printit -- print out the 'buf' of length 'len'. - * - * It is a walker function for pmemlog_walk - */ -static int -printit(const void *buf, size_t len, void *arg) -{ - char *str = MALLOC(len + 1); - - strncpy(str, buf, len); - str[len] = '\0'; - UT_OUT("%s", str); - - FREE(str); - return 0; -} - -/* - * do_walk -- call pmemlog_walk() & print result - */ -static void -do_walk(PMEMlogpool *plp) -{ - pmemlog_walk(plp, 0, printit, NULL); - UT_OUT("walk all at once"); -} - -static ut_jmp_buf_t Jmp; - -/* - * signal_handler -- called on SIGSEGV - */ -static void -signal_handler(int sig) -{ - UT_OUT("signal: %s", os_strsignal(sig)); - - ut_siglongjmp(Jmp); -} - -int -main(int argc, char *argv[]) -{ - PMEMlogpool *plp; - int result; - - START(argc, argv, "log_recovery"); - - if (argc != 3) - UT_FATAL("usage: %s file-name op:a|v", argv[0]); - - if (strchr("av", argv[2][0]) == NULL || argv[2][1] != '\0') - UT_FATAL("op must be a or v"); - - const char *path = argv[1]; - - int fd = OPEN(path, O_RDWR); - - /* pre-allocate 2MB of persistent memory */ - POSIX_FALLOCATE(fd, (os_off_t)0, (size_t)(2 * 1024 * 1024)); - - CLOSE(fd); - - if ((plp = pmemlog_create(path, 0, S_IWUSR | S_IRUSR)) == NULL) - UT_FATAL("!pmemlog_create: %s", path); - - /* append some data */ - if (argv[2][0] == 'a') - do_append(plp); - else - do_appendv(plp); - - /* print out current write point */ - do_tell(plp); - - size_t len = roundup(sizeof(*plp), LOG_FORMAT_DATA_ALIGN); - UT_OUT("write-protecting the metadata, length %zu", len); - MPROTECT(plp, len, PROT_READ); - - /* arrange to catch SEGV */ - struct sigaction v; - sigemptyset(&v.sa_mask); - v.sa_flags = 0; - v.sa_handler = signal_handler; - SIGACTION(SIGSEGV, &v, NULL); - - if (!ut_sigsetjmp(Jmp)) { - /* try to append more data */ - if (argv[2][0] == 'a') - do_append(plp); - else - do_appendv(plp); - } - - MPROTECT(plp, len, PROT_READ | PROT_WRITE); - pmemlog_close(plp); - - /* check consistency */ - result = pmemlog_check(path); - if (result < 0) - UT_OUT("!%s: pmemlog_check", path); - else if (result == 0) - UT_OUT("%s: pmemlog_check: not consistent", path); - else - UT_OUT("%s: consistent", path); - - /* map again to print out whole log */ - if ((plp = pmemlog_open(path)) == NULL) - UT_FATAL("!pmemlog_open: %s", path); - - /* print out current write point */ - do_tell(plp); - - /* print out whole log */ - do_walk(plp); - - pmemlog_close(plp); - - DONE(NULL); -} diff --git a/src/test/log_recovery/out0.log.match b/src/test/log_recovery/out0.log.match deleted file mode 100644 index 8ae80a22c12..00000000000 --- a/src/test/log_recovery/out0.log.match +++ /dev/null @@ -1,29 +0,0 @@ -log_recovery$(nW)TEST0: START: log_recovery - $(nW)log_recovery$(nW) $(nW)testfile1 a -append str[0] 1st append string - -append str[1] 2nd append string - -append str[2] 3rd append string - -append str[3] 4th append string - -append str[4] 5th append string - -append str[5] 6th append string - -tell 108 -$(OPT)write-protecting the metadata, length 8192 -$(OPX)write-protecting the metadata, length 131072 -signal: Segmentation fault -$(nW)testfile1: consistent -tell 108 -1st append string -2nd append string -3rd append string -4th append string -5th append string -6th append string - -walk all at once -log_recovery$(nW)TEST0: DONE diff --git a/src/test/log_recovery/out1.log.match b/src/test/log_recovery/out1.log.match deleted file mode 100644 index d0977cdd038..00000000000 --- a/src/test/log_recovery/out1.log.match +++ /dev/null @@ -1,21 +0,0 @@ -log_recovery$(nW)TEST1: START: log_recovery - $(nW)log_recovery$(nW) $(nW)testfile1 v -appendv -tell 171 -$(OPT)write-protecting the metadata, length 8192 -$(OPX)write-protecting the metadata, length 131072 -signal: Segmentation fault -$(nW)testfile1: consistent -tell 171 -1st appendv string -2nd appendv string -3rd appendv string -4th appendv string -5th appendv string -6th appendv string -7th appendv string -8th appendv string -9th appendv string - -walk all at once -log_recovery$(nW)TEST1: DONE diff --git a/src/test/log_walker/.gitignore b/src/test/log_walker/.gitignore deleted file mode 100644 index 110dbec30b5..00000000000 --- a/src/test/log_walker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -log_walker diff --git a/src/test/log_walker/Makefile b/src/test/log_walker/Makefile deleted file mode 100644 index 8b7f17e6d13..00000000000 --- a/src/test/log_walker/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2023, Intel Corporation - -# -# src/test/log_walker/Makefile -- build log_walker unit test -# -TARGET = log_walker -OBJS = log_walker.o - -LIBPMEMLOG=y - -include ../Makefile.inc - -# Libpmemlog is deprecated. -# This flag allows to build tests, examples and benchmarks -# using pmemlog despite the deprecated state. -CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/log_walker/README b/src/test/log_walker/README deleted file mode 100644 index d1a6a39a0dd..00000000000 --- a/src/test/log_walker/README +++ /dev/null @@ -1,14 +0,0 @@ -Persistent Memory Development Kit - -This is src/test/log_walker/README. - -This directory contains a unit test to verify pool's write-protection -in debug mode. It works only in debug mode. - -The program in log_walker.c takes only a file name as an argument. For example: - - ./log_walker file1 - -this calls pmemlog_open() on file1 and pmemlog_append() to append six strings -to the log. Next pmemlog_walk() is called and the walk handler tries to store -to the buffer and SIGSEGV is caught and reported. diff --git a/src/test/log_walker/TEST0 b/src/test/log_walker/TEST0 deleted file mode 100755 index 3cab6275f3f..00000000000 --- a/src/test/log_walker/TEST0 +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation - -# -# src/test/log_walker/TEST0 -- unit test to verify pool's write-protection -# in debug mode -# - -. ../unittest/unittest.sh - -require_test_type medium - -require_build_type debug static-debug - -# exits without cleanup -configure_valgrind force-disable - -setup - -# this test invokes sigsegvs by design -export ASAN_OPTIONS=handle_segv=0 - -touch $DIR/testfile1 - -expect_normal_exit ./log_walker$EXESUFFIX $DIR/testfile1 - -check_pool $DIR/testfile1 - -check - -pass diff --git a/src/test/log_walker/log_walker.c b/src/test/log_walker/log_walker.c deleted file mode 100644 index af7bea7deec..00000000000 --- a/src/test/log_walker/log_walker.c +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2017, Intel Corporation */ - -/* - * log_walker.c -- unit test to verify pool's write-protection in debug mode - * - * usage: log_walker file - * - */ - -#include -#include "unittest.h" - -/* - * do_append -- call pmemlog_append() & print result - */ -static void -do_append(PMEMlogpool *plp) -{ - const char *str[6] = { - "1st append string\n", - "2nd append string\n", - "3rd append string\n", - "4th append string\n", - "5th append string\n", - "6th append string\n" - }; - - for (int i = 0; i < 6; ++i) { - int rv = pmemlog_append(plp, str[i], strlen(str[i])); - switch (rv) { - case 0: - UT_OUT("append str[%i] %s", i, str[i]); - break; - case -1: - UT_OUT("!append str[%i] %s", i, str[i]); - break; - default: - UT_OUT("!append: wrong return value"); - break; - } - } -} - -/* - * try_to_store -- try to store to the buffer 'buf' - * - * It is a walker function for pmemlog_walk - */ -static int -try_to_store(const void *buf, size_t len, void *arg) -{ - memset((void *)buf, 0, len); - return 0; -} - -/* - * do_walk -- call pmemlog_walk() & print result - */ -static void -do_walk(PMEMlogpool *plp) -{ - pmemlog_walk(plp, 0, try_to_store, NULL); - UT_OUT("walk all at once"); -} - -static ut_jmp_buf_t Jmp; - -/* - * signal_handler -- called on SIGSEGV - */ -static void -signal_handler(int sig) -{ - UT_OUT("signal: %s", os_strsignal(sig)); - - ut_siglongjmp(Jmp); -} - -int -main(int argc, char *argv[]) -{ - PMEMlogpool *plp; - - START(argc, argv, "log_walker"); - - if (argc != 2) - UT_FATAL("usage: %s file-name", argv[0]); - - const char *path = argv[1]; - - int fd = OPEN(path, O_RDWR); - - /* pre-allocate 2MB of persistent memory */ - POSIX_FALLOCATE(fd, (os_off_t)0, (size_t)(2 * 1024 * 1024)); - - CLOSE(fd); - - if ((plp = pmemlog_create(path, 0, S_IWUSR | S_IRUSR)) == NULL) - UT_FATAL("!pmemlog_create: %s", path); - - /* append some data */ - do_append(plp); - - /* arrange to catch SEGV */ - struct sigaction v; - sigemptyset(&v.sa_mask); - v.sa_flags = 0; - v.sa_handler = signal_handler; - SIGACTION(SIGSEGV, &v, NULL); - - if (!ut_sigsetjmp(Jmp)) { - do_walk(plp); - } - - pmemlog_close(plp); - - DONE(NULL); -} diff --git a/src/test/log_walker/out0.log.match b/src/test/log_walker/out0.log.match deleted file mode 100644 index 795fa4b3523..00000000000 --- a/src/test/log_walker/out0.log.match +++ /dev/null @@ -1,16 +0,0 @@ -log_walker$(nW)TEST0: START: log_walker - $(nW)log_walker$(nW) $(nW)testfile1 -append str[0] 1st append string - -append str[1] 2nd append string - -append str[2] 3rd append string - -append str[3] 4th append string - -append str[4] 5th append string - -append str[5] 6th append string - -signal: Segmentation fault -log_walker$(nW)TEST0: DONE diff --git a/src/test/out_err_mt/Makefile b/src/test/out_err_mt/Makefile index 7f97114c3df..516da77e873 100644 --- a/src/test/out_err_mt/Makefile +++ b/src/test/out_err_mt/Makefile @@ -9,14 +9,13 @@ OBJS = out_err_mt.o LIBPMEMCOMMON=y LIBPMEM=y -LIBPMEMLOG=y LIBPMEMBLK=y LIBPMEMOBJ=y LIBPMEMPOOL=y include ../Makefile.inc -# Libpmemblk and libpmemlog are deprecated. +# Libpmemblk is deprecated. # This flag allows to build tests, examples and benchmarks -# using pmemblk/pmemlog despite the deprecated state. +# using pmemblk despite the deprecated state. CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/out_err_mt/TEST1 b/src/test/out_err_mt/TEST1 index 2efe29b086b..589971766b7 100755 --- a/src/test/out_err_mt/TEST1 +++ b/src/test/out_err_mt/TEST1 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2020, Intel Corporation +# Copyright 2015-2023, Intel Corporation # # @@ -19,13 +19,11 @@ configure_valgrind drd force-enable setup unset PMEM_LOG_LEVEL -unset PMEMLOG_LOG_LEVEL unset PMEMBLK_LOG_LEVEL unset PMEMOBJ_LOG_LEVEL unset PMEMPOOL_LOG_LEVEL unset PMEM_LOG_FILE -unset PMEMLOG_LOG_FILE unset PMEMBLK_LOG_FILE unset PMEMOBJ_LOG_FILE unset PMEMPOOL_LOG_FILE diff --git a/src/test/out_err_mt/TEST2 b/src/test/out_err_mt/TEST2 index 3a9905a3add..edd1c5bf8fe 100755 --- a/src/test/out_err_mt/TEST2 +++ b/src/test/out_err_mt/TEST2 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2015-2020, Intel Corporation +# Copyright 2015-2023, Intel Corporation # # @@ -19,12 +19,10 @@ configure_valgrind helgrind force-enable setup unset PMEM_LOG_LEVEL -unset PMEMLOG_LOG_LEVEL unset PMEMBLK_LOG_LEVEL unset PMEMOBJ_LOG_LEVEL unset PMEM_LOG_FILE -unset PMEMLOG_LOG_FILE unset PMEMBLK_LOG_FILE unset PMEMOBJ_LOG_FILE diff --git a/src/test/out_err_mt/out0.log.match b/src/test/out_err_mt/out0.log.match index 304ef76fbf6..e883c4ecc87 100644 --- a/src/test/out_err_mt/out0.log.match +++ b/src/test/out_err_mt/out0.log.match @@ -3,43 +3,31 @@ out_err_mt$(nW)TEST0: START: out_err_mt$(nW) start PMEM: PMEMOBJ: -PMEMLOG: PMEMBLK: PMEMPOOL: version check PMEM: libpmem major version mismatch (need 10000, found $(N)) PMEMOBJ: libpmemobj major version mismatch (need 10001, found $(N)) -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmem_msync PMEM: msync: $(S) PMEMOBJ: libpmemobj major version mismatch (need 10001, found $(N)) -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmemobj_alloc PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) -PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) -PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) -pmemlog_append -PMEM: msync: $(S) -PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmemblk_set_error PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: lba out of range (nlba $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmempool_check_init PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: lba out of range (nlba $(N)) PMEMPOOL: provided args_size is not supported out_err_mt$(nW)TEST0: DONE diff --git a/src/test/out_err_mt/out1.log.match b/src/test/out_err_mt/out1.log.match index c3cd4499e94..cef9ba31f6d 100644 --- a/src/test/out_err_mt/out1.log.match +++ b/src/test/out_err_mt/out1.log.match @@ -3,43 +3,31 @@ out_err_mt$(nW)TEST1: START: out_err_mt$(nW) start PMEM: PMEMOBJ: -PMEMLOG: PMEMBLK: PMEMPOOL: version check PMEM: libpmem major version mismatch (need 10000, found $(N)) PMEMOBJ: libpmemobj major version mismatch (need 10001, found $(N)) -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmem_msync PMEM: msync: $(S) PMEMOBJ: libpmemobj major version mismatch (need 10001, found $(N)) -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmemobj_alloc PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) -PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) -PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) -pmemlog_append -PMEM: msync: $(S) -PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmemblk_set_error PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: lba out of range (nlba $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmempool_check_init PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: lba out of range (nlba $(N)) PMEMPOOL: provided args_size is not supported out_err_mt$(nW)TEST1: DONE diff --git a/src/test/out_err_mt/out2.log.match b/src/test/out_err_mt/out2.log.match index 743eab9b488..a271565b06c 100644 --- a/src/test/out_err_mt/out2.log.match +++ b/src/test/out_err_mt/out2.log.match @@ -3,43 +3,31 @@ out_err_mt$(nW)TEST2: START: out_err_mt$(nW) start PMEM: PMEMOBJ: -PMEMLOG: PMEMBLK: PMEMPOOL: version check PMEM: libpmem major version mismatch (need 10000, found $(N)) PMEMOBJ: libpmemobj major version mismatch (need 10001, found $(N)) -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmem_msync PMEM: msync: $(S) PMEMOBJ: libpmemobj major version mismatch (need 10001, found $(N)) -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmemobj_alloc PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: libpmemlog major version mismatch (need 10002, found $(N)) -PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) -PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) -pmemlog_append -PMEM: msync: $(S) -PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: libpmemblk major version mismatch (need 10003, found $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmemblk_set_error PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: lba out of range (nlba $(N)) PMEMPOOL: libpmempool major version mismatch (need 10006, found $(N)) pmempool_check_init PMEM: msync: $(S) PMEMOBJ: allocation with size 0 -PMEMLOG: pmemlog_append: No space left on device PMEMBLK: lba out of range (nlba $(N)) PMEMPOOL: provided args_size is not supported out_err_mt$(nW)TEST2: DONE diff --git a/src/test/out_err_mt/out_err_mt.c b/src/test/out_err_mt/out_err_mt.c index 86b98e27dd0..c917270eea7 100644 --- a/src/test/out_err_mt/out_err_mt.c +++ b/src/test/out_err_mt/out_err_mt.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2020, Intel Corporation */ +/* Copyright 2015-2023, Intel Corporation */ /* * out_err_mt.c -- unit test for error messages @@ -20,7 +20,6 @@ print_errors(const char *msg) UT_OUT("%s", msg); UT_OUT("PMEM: %s", pmem_errormsg()); UT_OUT("PMEMOBJ: %s", pmemobj_errormsg()); - UT_OUT("PMEMLOG: %s", pmemlog_errormsg()); UT_OUT("PMEMBLK: %s", pmemblk_errormsg()); UT_OUT("PMEMPOOL: %s", pmempool_errormsg()); } @@ -46,13 +45,6 @@ check_errors(unsigned ver) UT_ASSERTeq(err_need, ver); UT_ASSERTeq(err_found, PMEMOBJ_MAJOR_VERSION); - ret = sscanf(pmemlog_errormsg(), - "libpmemlog major version mismatch (need %d, found %d)", - &err_need, &err_found); - UT_ASSERTeq(ret, 2); - UT_ASSERTeq(err_need, ver); - UT_ASSERTeq(err_found, PMEMLOG_MAJOR_VERSION); - ret = sscanf(pmemblk_errormsg(), "libpmemblk major version mismatch (need %d, found %d)", &err_need, &err_found); @@ -75,7 +67,6 @@ do_test(void *arg) pmem_check_version(ver, 0); pmemobj_check_version(ver, 0); - pmemlog_check_version(ver, 0); pmemblk_check_version(ver, 0); pmempool_check_version(ver, 0); check_errors(ver); @@ -111,8 +102,6 @@ main(int argc, char *argv[]) PMEMobjpool *pop = pmemobj_create(argv[1], "test", PMEMOBJ_MIN_POOL, 0666); - PMEMlogpool *plp = pmemlog_create(argv[2], - PMEMLOG_MIN_POOL, 0666); PMEMblkpool *pbp = pmemblk_create(argv[3], 128, PMEMBLK_MIN_POOL, 0666); @@ -120,7 +109,6 @@ main(int argc, char *argv[]) pmem_check_version(10000, 0); pmemobj_check_version(10001, 0); - pmemlog_check_version(10002, 0); pmemblk_check_version(10003, 0); pmempool_check_version(10006, 0); print_errors("version check"); @@ -141,9 +129,6 @@ main(int argc, char *argv[]) UT_ASSERTeq(ret, -1); print_errors("pmemobj_alloc"); - pmemlog_append(plp, NULL, PMEMLOG_MIN_POOL); - print_errors("pmemlog_append"); - size_t nblock = pmemblk_nblock(pbp); pmemblk_set_error(pbp, (long long)nblock + 1); print_errors("pmemblk_set_error"); @@ -151,7 +136,6 @@ main(int argc, char *argv[]) run_mt_test(do_test); pmemobj_close(pop); - pmemlog_close(plp); pmemblk_close(pbp); PMEMpoolcheck *ppc; diff --git a/src/test/scope/TESTS.py b/src/test/scope/TESTS.py index 399ebfa29ab..ec9b0d4ae4b 100755 --- a/src/test/scope/TESTS.py +++ b/src/test/scope/TESTS.py @@ -79,11 +79,6 @@ class TEST2(Common): checked_lib = 'libpmem' -class TEST3(Common): - """Check scope of libpmemlog library (*nix)""" - checked_lib = 'libpmemlog' - - class TEST4(Common): """Check scope of libpmemblk library (*nix)""" checked_lib = 'libpmemblk' diff --git a/src/test/scope/out3.log.match b/src/test/scope/out3.log.match deleted file mode 100644 index 74ce8a3297f..00000000000 --- a/src/test/scope/out3.log.match +++ /dev/null @@ -1,18 +0,0 @@ -pmemlog_append$(nW) -pmemlog_appendv$(nW) -pmemlog_check$(nW) -pmemlog_check_version$(nW) -pmemlog_close$(nW) -pmemlog_create$(nW) -pmemlog_ctl_exec$(nW) -pmemlog_ctl_get$(nW) -pmemlog_ctl_set$(nW) -pmemlog_errormsg$(nW) -$(OPT)pmemlog_fault_injection_enabled$(nW) -$(OPT)pmemlog_inject_fault_at$(nW) -pmemlog_nbyte$(nW) -pmemlog_open$(nW) -pmemlog_rewind$(nW) -pmemlog_set_funcs$(nW) -pmemlog_tell$(nW) -pmemlog_walk$(nW) diff --git a/src/test/set_funcs/Makefile b/src/test/set_funcs/Makefile index 8c6bf886ab9..cec3f161d4a 100644 --- a/src/test/set_funcs/Makefile +++ b/src/test/set_funcs/Makefile @@ -10,11 +10,10 @@ OBJS = set_funcs.o LIBPMEM=y LIBPMEMOBJ=y LIBPMEMBLK=y -LIBPMEMLOG=y include ../Makefile.inc -# Libpmemblk and libpmemlog are deprecated. +# Libpmemblk is deprecated. # This flag allows to build tests, examples and benchmarks -# using pmemblk/pmemlog despite the deprecated state. +# using pmemblk despite the deprecated state. CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/set_funcs/set_funcs.c b/src/test/set_funcs/set_funcs.c index bcd52cd3a2b..32d8037b954 100644 --- a/src/test/set_funcs/set_funcs.c +++ b/src/test/set_funcs/set_funcs.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2015-2019, Intel Corporation */ +/* Copyright 2015-2023, Intel Corporation */ /* * set_funcs.c -- unit test for pmem*_set_funcs() @@ -14,7 +14,6 @@ #define OBJ 0 #define BLK 1 -#define LOG 2 static struct counters { int mallocs; @@ -140,38 +139,6 @@ blk_strdup(const char *s) return test_strdup(s); } -static void * -log_malloc(size_t size) -{ - cnt[LOG].mallocs++; - return test_malloc(size); -} - -static void -log_free(void *ptr) -{ - if (ptr) - cnt[LOG].frees++; - test_free(ptr); -} - -static void * -log_realloc(void *ptr, size_t size) -{ - if (ptr == NULL) - cnt[LOG].reallocs_null++; - else - cnt[LOG].reallocs++; - return test_realloc(ptr, size); -} - -static char * -log_strdup(const char *s) -{ - cnt[LOG].strdups++; - return test_strdup(s); -} - /* * There are a few allocations made at first call to pmemobj_open() or * pmemobj_create(). They are related to some global structures @@ -282,48 +249,6 @@ test_blk(const char *path) UNLINK(path); } -static void -test_log(const char *path) -{ - pmemlog_set_funcs(log_malloc, log_free, log_realloc, log_strdup); - - /* - * Generate ERR() call, that calls malloc() once, - * but only when it is called for the first time - * (free() is called in the destructor of the library). - */ - pmemlog_create(EXISTING_FILE, NON_ZERO_POOL_SIZE, 0); - - memset(cnt, 0, sizeof(cnt)); - - PMEMlogpool *log = pmemlog_create(path, PMEMLOG_MIN_POOL, 0600); - - pmemlog_close(log); - - UT_OUT("log_mallocs: %d", cnt[LOG].mallocs); - UT_OUT("log_frees: %d", cnt[LOG].frees); - UT_OUT("log_reallocs: %d", cnt[LOG].reallocs); - UT_OUT("log_reallocs_null: %d", cnt[LOG].reallocs_null); - UT_OUT("log_strdups: %d", cnt[LOG].strdups); - - if (cnt[LOG].mallocs == 0 || cnt[LOG].frees == 0) - UT_FATAL("LOG mallocs: %d, frees: %d", cnt[LOG].mallocs, - cnt[LOG].frees); - - for (int i = 0; i < 5; ++i) { - if (i == LOG) - continue; - if (cnt[i].mallocs || cnt[i].frees) - UT_FATAL("LOG allocation used %d functions", i); - } - - if (cnt[LOG].mallocs + cnt[LOG].strdups + cnt[LOG].reallocs_null - != cnt[LOG].frees) - UT_FATAL("LOG memory leak"); - - UNLINK(path); -} - int main(int argc, char *argv[]) { @@ -334,7 +259,6 @@ main(int argc, char *argv[]) test_obj(argv[1]); test_blk(argv[1]); - test_log(argv[1]); DONE(NULL); } diff --git a/src/test/traces_pmem/Makefile b/src/test/traces_pmem/Makefile index 633285a4aee..dc21f7e94fc 100644 --- a/src/test/traces_pmem/Makefile +++ b/src/test/traces_pmem/Makefile @@ -9,12 +9,11 @@ OBJS = traces_pmem.o LIBPMEM=y LIBPMEMBLK=y -LIBPMEMLOG=y LIBPMEMOBJ=y include ../Makefile.inc -# Libpmemblk and libpmemlog are deprecated. +# Libpmemblk is deprecated. # This flag allows to build tests, examples and benchmarks -# using pmemblk/pmemlog despite the deprecated state. +# using pmemblk despite the deprecated state. CFLAGS += -Wno-deprecated-declarations diff --git a/src/test/traces_pmem/TEST0 b/src/test/traces_pmem/TEST0 index 8a9e8139828..51e80ec73a0 100755 --- a/src/test/traces_pmem/TEST0 +++ b/src/test/traces_pmem/TEST0 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2014-2019, Intel Corporation +# Copyright 2014-2023, Intel Corporation # # src/test/traces_pmem/TEST0 -- unit test traces for libraries pmem @@ -19,8 +19,6 @@ export PMEM_LOG_LEVEL=4 export PMEM_LOG_FILE=./trace_pmem$UNITTEST_NUM.log export PMEMBLK_LOG_LEVEL=4 export PMEMBLK_LOG_FILE=./trace_pmemblk$UNITTEST_NUM.log -export PMEMLOG_LOG_LEVEL=4 -export PMEMLOG_LOG_FILE=./trace_pmemlog$UNITTEST_NUM.log export PMEMOBJ_LOG_LEVEL=4 export PMEMOBJ_LOG_FILE=./trace_pmemobj$UNITTEST_NUM.log @@ -31,7 +29,6 @@ expect_normal_exit ./traces_pmem$EXESUFFIX # machines configurations), hence comparison of only first 3 lines. head -n 3 $PMEM_LOG_FILE > ./trace_pmem_head$UNITTEST_NUM.log head -n 3 $PMEMBLK_LOG_FILE > ./trace_pmemblk_head$UNITTEST_NUM.log -head -n 3 $PMEMLOG_LOG_FILE > ./trace_pmemlog_head$UNITTEST_NUM.log head -n 3 $PMEMOBJ_LOG_FILE > ./trace_pmemobj_head$UNITTEST_NUM.log check diff --git a/src/test/traces_pmem/trace_pmemlog_head0.log.match b/src/test/traces_pmem/trace_pmemlog_head0.log.match deleted file mode 100644 index d4aa381bc41..00000000000 --- a/src/test/traces_pmem/trace_pmemlog_head0.log.match +++ /dev/null @@ -1,3 +0,0 @@ -: <$(N)> [out.c:$(N) $(*)] pid $(N): program: $(*) -: <$(N)> [out.c:$(N) $(*)] libpmemlog version $(N).$(N) -: <$(N)> [out.c:$(N) $(*)] src version: $(*) diff --git a/src/test/traces_pmem/traces_pmem.c b/src/test/traces_pmem/traces_pmem.c index 949982dd85b..b4393d1a4ce 100644 --- a/src/test/traces_pmem/traces_pmem.c +++ b/src/test/traces_pmem/traces_pmem.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2014-2018, Intel Corporation */ +/* Copyright 2014-2023, Intel Corporation */ /* * traces_pmem.c -- unit test traces for libraries pmem @@ -16,8 +16,6 @@ main(int argc, char *argv[]) PMEM_MINOR_VERSION)); UT_ASSERT(!pmemblk_check_version(PMEMBLK_MAJOR_VERSION, PMEMBLK_MINOR_VERSION)); - UT_ASSERT(!pmemlog_check_version(PMEMLOG_MAJOR_VERSION, - PMEMLOG_MINOR_VERSION)); UT_ASSERT(!pmemobj_check_version(PMEMOBJ_MAJOR_VERSION, PMEMOBJ_MINOR_VERSION)); diff --git a/src/test/unittest/unittest.h b/src/test/unittest/unittest.h index a9ceff6b092..311334a2b75 100644 --- a/src/test/unittest/unittest.h +++ b/src/test/unittest/unittest.h @@ -58,7 +58,6 @@ #include #include #include -#include #include #include