]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph distributed storage system | |
5 | * | |
6 | * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com> | |
7 | * Copyright (C) 2014 Red Hat <contact@redhat.com> | |
8 | * | |
9 | * Author: Loic Dachary <loic@dachary.org> | |
10 | * | |
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. | |
15 | * | |
16 | */ | |
17 | ||
18 | #include <errno.h> | |
19 | #include <stdlib.h> | |
20 | #include "arch/probe.h" | |
21 | #include "arch/intel.h" | |
22 | #include "erasure-code/ErasureCodePlugin.h" | |
23 | #include "global/global_context.h" | |
11fdf7f2 | 24 | #include "common/config_proxy.h" |
7c673cae FG |
25 | #include "gtest/gtest.h" |
26 | ||
20effc67 | 27 | using namespace std; |
7c673cae FG |
28 | |
29 | TEST(ErasureCodePlugin, factory) | |
30 | { | |
31 | ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance(); | |
32 | ErasureCodeProfile profile; | |
33 | profile["mapping"] = "DD_"; | |
34 | profile["layers"] = "[ [ \"DDc\", \"\" ] ]"; | |
35 | ErasureCodeInterfaceRef erasure_code; | |
36 | EXPECT_FALSE(erasure_code); | |
37 | EXPECT_EQ(0, instance.factory("lrc", | |
11fdf7f2 | 38 | g_conf().get_val<std::string>("erasure_code_dir"), |
7c673cae FG |
39 | profile, &erasure_code, &cerr)); |
40 | EXPECT_TRUE(erasure_code.get()); | |
41 | } | |
42 | ||
43 | /* | |
44 | * Local Variables: | |
45 | * compile-command: "cd ../.. ; make -j4 && | |
46 | * make unittest_erasure_code_plugin_lrc && | |
47 | * valgrind --tool=memcheck ./unittest_erasure_code_plugin_lrc \ | |
48 | * --gtest_filter=*.* --log-to-stderr=true --debug-osd=20" | |
49 | * End: | |
50 | */ |