1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "cls/user/cls_user_ops.h"
#include "common/Formatter.h"
#include "common/ceph_json.h"
void cls_user_set_buckets_op::dump(Formatter *f) const
{
encode_json("entries", entries, f);
encode_json("add", add, f);
encode_json("time", utime_t(time), f);
}
void cls_user_set_buckets_op::generate_test_instances(list<cls_user_set_buckets_op*>& ls)
{
ls.push_back(new cls_user_set_buckets_op);
cls_user_set_buckets_op *op = new cls_user_set_buckets_op;
for (int i = 0; i < 3; i++) {
cls_user_bucket_entry e;
cls_user_gen_test_bucket_entry(&e, i);
op->entries.push_back(e);
}
op->add = true;
op->time = utime_t(1, 0).to_real_time();
ls.push_back(op);
}
void cls_user_remove_bucket_op::dump(Formatter *f) const
{
encode_json("bucket", bucket, f);
}
void cls_user_remove_bucket_op::generate_test_instances(list<cls_user_remove_bucket_op*>& ls)
{
ls.push_back(new cls_user_remove_bucket_op);
cls_user_remove_bucket_op *op = new cls_user_remove_bucket_op;
cls_user_gen_test_bucket(&op->bucket, 0);
ls.push_back(op);
}
void cls_user_list_buckets_op::dump(Formatter *f) const
{
encode_json("marker", marker, f);
encode_json("max_entries", max_entries, f);
}
void cls_user_list_buckets_op::generate_test_instances(list<cls_user_list_buckets_op*>& ls)
{
ls.push_back(new cls_user_list_buckets_op);
cls_user_list_buckets_op *op = new cls_user_list_buckets_op;
op->marker = "marker";
op->max_entries = 1000;
ls.push_back(op);
}
void cls_user_list_buckets_ret::dump(Formatter *f) const
{
encode_json("entries", entries, f);
encode_json("marker", marker, f);
encode_json("truncated", truncated, f);
}
void cls_user_list_buckets_ret::generate_test_instances(list<cls_user_list_buckets_ret*>& ls)
{
ls.push_back(new cls_user_list_buckets_ret);
cls_user_list_buckets_ret *ret = new cls_user_list_buckets_ret;
for (int i = 0; i < 3; i++) {
cls_user_bucket_entry e;
cls_user_gen_test_bucket_entry(&e, i);
ret->entries.push_back(e);
}
ret->marker = "123";
ret->truncated = true;
ls.push_back(ret);
}
void cls_user_get_header_op::dump(Formatter *f) const
{
// empty!
}
void cls_user_get_header_op::generate_test_instances(list<cls_user_get_header_op*>& ls)
{
ls.push_back(new cls_user_get_header_op);
}
void cls_user_get_header_ret::dump(Formatter *f) const
{
encode_json("header", header, f);
}
void cls_user_get_header_ret::generate_test_instances(list<cls_user_get_header_ret*>& ls)
{
ls.push_back(new cls_user_get_header_ret);
cls_user_get_header_ret *ret = new cls_user_get_header_ret;
cls_user_gen_test_header(&ret->header);
ls.push_back(ret);
}
void cls_user_complete_stats_sync_op::dump(Formatter *f) const
{
encode_json("time", utime_t(time), f);
}
void cls_user_complete_stats_sync_op::generate_test_instances(list<cls_user_complete_stats_sync_op*>& ls)
{
ls.push_back(new cls_user_complete_stats_sync_op);
cls_user_complete_stats_sync_op *op = new cls_user_complete_stats_sync_op;
op->time = utime_t(12345, 0).to_real_time();
ls.push_back(op);
}
|