]> git.proxmox.com Git - ceph.git/blame - ceph/src/test/librados/test.h
update sources to v12.1.0
[ceph.git] / ceph / src / test / librados / test.h
CommitLineData
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 - scalable distributed file system
5 *
6 * Copyright (C) 2011 New Dream Network
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14
15#ifndef CEPH_TEST_RADOS_API_TEST_H
16#define CEPH_TEST_RADOS_API_TEST_H
17
18#include "include/rados/librados.h"
19#include "include/rados/librados.hpp"
20
21#include <map>
22#include <string>
23#include <unistd.h>
24
25std::string get_temp_pool_name(const std::string &prefix = "test-rados-api-");
26
27std::string create_one_pool(const std::string &pool_name, rados_t *cluster,
28 uint32_t pg_num=0);
29std::string create_one_ec_pool(const std::string &pool_name, rados_t *cluster);
30std::string create_one_pool_pp(const std::string &pool_name,
31 librados::Rados &cluster);
32std::string create_one_pool_pp(const std::string &pool_name,
33 librados::Rados &cluster,
34 const std::map<std::string, std::string> &config);
35std::string create_one_ec_pool_pp(const std::string &pool_name,
36 librados::Rados &cluster);
7c673cae
FG
37std::string connect_cluster(rados_t *cluster);
38std::string connect_cluster_pp(librados::Rados &cluster);
39std::string connect_cluster_pp(librados::Rados &cluster,
40 const std::map<std::string, std::string> &config);
41int destroy_one_pool(const std::string &pool_name, rados_t *cluster);
42int destroy_one_ec_pool(const std::string &pool_name, rados_t *cluster);
43int destroy_one_pool_pp(const std::string &pool_name, librados::Rados &cluster);
44int destroy_one_ec_pool_pp(const std::string &pool_name, librados::Rados &cluster);
45void assert_eq_sparse(bufferlist& expected,
46 const std::map<uint64_t, uint64_t>& extents,
47 bufferlist& actual);
48
49class TestAlarm
50{
51public:
52 TestAlarm() {
53 alarm(1200);
54 }
55 ~TestAlarm() {
56 alarm(0);
57 }
58};
59
60#endif