1 Star 0 Fork 0

星辰大海 / ocf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

Open CAS Framework

Build Status Tests Status Coverity status codecov License

Open CAS Framework (OCF) is high performance block storage caching meta-library written in C. It's entirely platform and system independent, accessing system API through user provided environment wrappers layer. OCF tightly integrates with the rest of software stack, providing flawless, high performance, low latency caching utility.

In this readme:

Documentation

OCF documentation is available on GitHub Pages. Doxygen API documentation is available here.

Source Code

Source code is available in the official OCF GitHub repository:

git clone https://github.com/Open-CAS/ocf.git
cd ocf

Deployment

OCF doesn't compile as separate library. It's designed to be included into another software stack. For this purpose OCF provides Makefile with two useful targets for deploying its source into target directories. Assuming OCFDIR is OCF directory, and SRCDIR and INCDIR are respectively your source and include directories, use following commands to deploy OCF into your project:

make -C $OCFDIR src O=$SRCDIR
make -C $OCFDIR inc O=$INCDIR

By default this will not copy OCF source files but create symbolic links to them, to avoid source duplication and allow for easy OCF code modification. If you prefer to copy OCF source files (e.g. you don't want to distribute whole OCF repository as your submodule) you can use following commands:

make -C $OCFDIR src O=$SRCDIR CMD=cp
make -C $OCFDIR inc O=$INCDIR CMD=cp

Examples

OCF is shipped with examples, which are complete, compillable and working programs, containing lot of comments that explain basics of caching. They are great starting point for everyone who wants to start working with OCF.

Examples can be found in directory example/.

Each example contains Makefile which can be used to compile it.

Unit Tests

OCF is shipped with dedicated unit test framework based on Cmocka.
To run unit tests you need to install following packages:

  • Cmake (>= 3.8.1)
  • Cmocka (>= 1.1.1)
  • ctags (>= 5.8)

To run unit tests use following command:

./tests/unit/framework/run_unit_tests.py

Build Test

OCF repository contains basic build test. It uses default POSIX environment. To run this test, use following commands:

cd tests/build/
make

Functional Tests

OCF repository contains dedicated functional test framework written in python and executed via pytest. With the use of ctypes it is possible to call, wrap ocf functions and use C compatible data types.
To run functional tests you need to install the following:

  • python3 (>=3.6.7)
  • pytest (Install with pip3 install pytest)

To run all functional tests (in compliance with the configuration file) compile using makefile located in ./tests/functional/Makefile and then use the following command:

pytest

Contributing

Feel like making OCF better? Don't hesitate to submit a pull request!
You can find more information about our contribution process here.
In case of any questions feel free to contact maintainer.

Copyright(c) 2019-2021 Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. 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 HOLDER 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.

简介

暂无描述 展开 收起
C 等 3 种语言
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/oss_enterprise/ocf.git
git@gitee.com:oss_enterprise/ocf.git
oss_enterprise
ocf
ocf
master

搜索帮助