Skip to content

pmem/pmdk-tests

Repository files navigation

pmdk-tests: Tests for Persistent Memory Development Kit

NOTICE: This repository is not actively developed. At this moment only the RAS tests are supported. If you are looking for tests for the PMDK repository, go to this page.

This repository utilizes Google Test C++ test framework and pugiXML.

Building The Source

To build pmdk-tests, the following packages are required:

  • PMDK
  • CMake - version 2.8.12 or greater

Building pmdk-tests

In the pmdk-tests root directory:

	$ mkdir build
	$ cd build
	$ cmake .. <args>
	$ make

<args> - for building debug version use -DCMAKE_BUILD_TYPE=DEBUG. No -DCMAKE_BUILD_TYPE argument provided is equivalent to -DCMAKE_BUILD_TYPE=RELEASE.

PMDK Custom path

If PMDK is installed in custom path, then additional arguments need to be specified. If pkg-config is available, then PKG_CONFIG_PATH environmental variable needs to be set to <PMDK_INSTALL_PATH>/lib/pkgconfig.

	$ PKG_CONFIG_PATH=<PMDK_INSTALL_PATH>/lib/pkgconfig cmake ..

If it's not available, then PMDK_INSTALL_PATH needs to be specified. PMDK_INSTALL_PATH must be an absolute path.

	$ cmake .. -DPMDK_INSTALL_PATH=<PMDK_INSTALL_PATH>

Running Tests

NOTICE: Currently only RAS tests are supported. Please check this README file for more information about RAS.

Before executing tests, valid configuration config.xml file needs to be placed in the same directory as the test binary. Template config.xml.example is located in etc/config directory. For more information see dedicated README file. After this setup, tests can be run simply by executing the binary:

	$ cd build
	$ cp ../etc/config/config.xml.example config.xml
	# Set own values in config.xml fields
	$ ./UNSAFE_SHUTDOWN_LOCAL

pmdk-tests are implemented using Google Test framework, and thus resulting binaries share its behavior and command line interface. To list all tests to be run from specific binary:

	$ ./UNSAFE_SHUTDOWN_LOCAL --gtest_list_tests

To run a subset of tests:

	# Runs only tests with 'VERBOSE' in title.
	$ ./UNSAFE_SHUTDOWN_LOCAL --gtest_filter="*VERBOSE*"

--gtest_filter argument can also be used to exclude tests from execution (mind the - before filtered out phrase):

	# Exclude tests with 'VERBOSE' in title from execution.
	$ ./UNSAFE_SHUTDOWN_LOCAL --gtest_filter=-"*VERBOSE*"

To see usage:

	$ ./UNSAFE_SHUTDOWN_LOCAL --help

For more information about running tests see Google Test documentation.

Other Requirements

Python scripts in pmdk-tests are compatible with Python 3.4.

See also

Detailed documentation for specific test groups: