1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph distributed storage system
6 * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
7 * Copyright (C) 2014 Red Hat <contact@redhat.com>
9 * Author: Loic Dachary <loic@dachary.org>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
20 #include "arch/probe.h"
21 #include "arch/intel.h"
22 #include "erasure-code/ErasureCodePlugin.h"
23 #include "global/global_context.h"
24 #include "common/config.h"
25 #include "gtest/gtest.h"
28 TEST(ErasureCodePlugin, factory)
30 ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
31 ErasureCodeProfile profile;
32 profile["mapping"] = "DD_";
33 profile["layers"] = "[ [ \"DDc\", \"\" ] ]";
34 ErasureCodeInterfaceRef erasure_code;
35 EXPECT_FALSE(erasure_code);
36 EXPECT_EQ(0, instance.factory("lrc",
37 g_conf->get_val<std::string>("erasure_code_dir"),
38 profile, &erasure_code, &cerr));
39 EXPECT_TRUE(erasure_code.get());
44 * compile-command: "cd ../.. ; make -j4 &&
45 * make unittest_erasure_code_plugin_lrc &&
46 * valgrind --tool=memcheck ./unittest_erasure_code_plugin_lrc \
47 * --gtest_filter=*.* --log-to-stderr=true --debug-osd=20"