Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
null | ceph-main/src/test/formatter.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 9,231 | 25.005634 | 88 | cc |
null | ceph-main/src/test/gather.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 Greg Farnum <gregory.farnum@dreamhost.com>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser ... | 2,887 | 26.769231 | 81 | cc |
null | ceph-main/src/test/gprof-helper.c | /* gprof-helper.c -- preload library to profile pthread-enabled programs
*
* Authors: Sam Hocevar <sam at zoy dot org>
* Daniel Jönsson <danieljo at fagotten dot org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Do What The Fuck You Want To
* Pu... | 3,604 | 29.041667 | 72 | c |
null | ceph-main/src/test/heartbeat_map.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 1,172 | 25.066667 | 71 | cc |
null | ceph-main/src/test/kv_store_bench.cc | /*
* KvStoreBench.cc
*
* Created on: Aug 23, 2012
* Author: eleanor
*/
#include "test/kv_store_bench.h"
#include "key_value_store/key_value_structure.h"
#include "key_value_store/kv_flat_btree_async.h"
#include "include/rados/librados.hpp"
#include "test/omap_bench.h"
#include "common/ceph_argparse.h"
#in... | 16,597 | 28.376991 | 123 | cc |
null | ceph-main/src/test/kv_store_bench.h | /*
* Benchmarking suite for key-value store
*
* September 2, 2012
* Eleanor Cawthon
* eleanor.cawthon@inktank.com
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software
* Foundation. See f... | 5,252 | 26.217617 | 94 | h |
null | ceph-main/src/test/libcephfs_config.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 1,645 | 24.323077 | 70 | cc |
null | ceph-main/src/test/librgw_file.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 7,245 | 23.815068 | 99 | cc |
null | ceph-main/src/test/librgw_file_aw.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 10,902 | 23.949657 | 79 | cc |
null | ceph-main/src/test/librgw_file_cd.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 4,764 | 22.706468 | 79 | cc |
null | ceph-main/src/test/librgw_file_gp.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 13,117 | 24.226923 | 80 | cc |
null | ceph-main/src/test/librgw_file_marker.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 12,713 | 24.633065 | 78 | cc |
null | ceph-main/src/test/librgw_file_nfsns.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 32,378 | 25.649383 | 78 | cc |
null | ceph-main/src/test/librgw_file_xattr.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 10,598 | 23.421659 | 79 | cc |
null | ceph-main/src/test/mime.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 4,248 | 27.139073 | 70 | cc |
null | ceph-main/src/test/multi_stress_watch.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
#include "include/rados/librados.h"
#include "include/rados/librados.hpp"
#include "test/librados/test_cxx.h"
#include <errno.h>
#include <mutex>
#include <condition_variable>
#include <chrono>
#include <map>
#include <iostream>
#include <string>... | 4,493 | 25.435294 | 173 | cc |
null | ceph-main/src/test/objectstore_bench.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include <chrono>
#include <cassert>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <thread>
#include "os/ObjectStore.h"
#include "global/global_init.h"
#include "common/strtol.h"
#include "c... | 9,291 | 27.157576 | 103 | cc |
null | ceph-main/src/test/omap_bench.cc | /*
* Generate latency statistics for a configurable number of write
* operations of configurable size.
*
* Created on: May 21, 2012
* Author: Eleanor Cawthon
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as pu... | 12,407 | 27.722222 | 80 | cc |
null | ceph-main/src/test/omap_bench.h | /*
* Generate latency statistics for a configurable number of object map write
* operations of configurable size.
*
* Created on: May 21, 2012
* Author: Eleanor Cawthon
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version... | 5,375 | 24.971014 | 78 | h |
null | ceph-main/src/test/on_exit.cc | #include <sys/mman.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <unistd.h>
#include "include/on_exit.h"
#include "include/ceph_assert.h"
#ifndef MAP_ANONYMOUS
# ifdef MAP_ANON
# define MAP_ANONYMOUS MAP_ANON
# else
// cppcheck-suppress preprocessorErrorDirective
# error "Don't know ho... | 2,748 | 22.698276 | 74 | cc |
null | ceph-main/src/test/perf_counters.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 23,801 | 33.34632 | 502 | cc |
null | ceph-main/src/test/perf_helper.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/* Copyright (c) 2011 Facebook
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission n... | 1,477 | 26.886792 | 77 | cc |
null | ceph-main/src/test/perf_helper.h | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/* Copyright (c) 2011 Facebook
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission n... | 1,098 | 34.451613 | 77 | h |
null | ceph-main/src/test/perf_local.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/* Copyright (c) 2015 Haomai Wang <haomaiwang@gmail.com>
* Copyright (c) 2011-2014 Stanford University
* Copyright (c) 2011 Facebook
*
* Permission to use, copy, modify, and distribute this software for any
* purpose ... | 29,610 | 26.725655 | 92 | cc |
null | ceph-main/src/test/rbd-ggate.sh | #!/usr/bin/env bash
#
# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library Public License as publ... | 901 | 33.692308 | 78 | sh |
null | ceph-main/src/test/run-rbd-unit-tests.sh | #!/usr/bin/env bash
set -ex
# this should be run from the src directory in the ceph.git
source $(dirname $0)/detect-build-env-vars.sh
PATH="$CEPH_BIN:$PATH"
if [ $# = 0 ]; then
# mimic the old behaviour
TESTS='0 1 61 109 127'
unset RBD_FEATURES; unittest_librbd
elif [ $# = 1 -a "${1}" = N ] ; then
# new styl... | 473 | 17.230769 | 59 | sh |
null | ceph-main/src/test/run-rbd-valgrind-unit-tests.sh | #!/usr/bin/env bash
set -ex
# this should be run from the src directory in the ceph.git (when built with
# automake) or cmake build directory
source $(dirname $0)/detect-build-env-vars.sh
RBD_FEATURES=13 valgrind --tool=memcheck --leak-check=full --error-exitcode=1 \
--suppressions=${CEPH_ROOT}/qa/valgrind.supp... | 346 | 25.692308 | 79 | sh |
null | ceph-main/src/test/run_cmd.cc | #include "common/config.h"
#include "common/run_cmd.h"
#include "gtest/gtest.h"
#include <stdlib.h>
#include <unistd.h>
TEST(RunCommand, StringSimple)
{
char temp_file_name[] = "run_cmd_temp_file_XXXXXX";
int fd = ::mkstemp(temp_file_name);
ASSERT_GE(fd, 0);
::close(fd);
std::string ret = run_cmd("touch"... | 551 | 19.444444 | 66 | cc |
null | ceph-main/src/test/signals.cc | #include "common/config.h"
#include "common/signal.h"
#include "global/signal_handler.h"
#include "common/debug.h"
#include "include/coredumpctl.h"
#include "gtest/gtest.h"
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include "include/ceph_assert.h"
#define dout_context g_ceph_con... | 3,064 | 18.27673 | 56 | cc |
null | ceph-main/src/test/simple_spin.cc |
#include <future>
#include "gtest/gtest.h"
#include "include/spinlock.h"
using ceph::spin_lock;
using ceph::spin_unlock;
static std::atomic_flag lock = ATOMIC_FLAG_INIT;
static int64_t counter = 0;
TEST(SimpleSpin, Test0)
{
std::atomic_flag lock0 = ATOMIC_FLAG_INIT;
spin_lock(&lock0);
spin_unlock(&lock0);
}... | 2,783 | 19.470588 | 77 | cc |
null | ceph-main/src/test/smoke.sh | #!/usr/bin/env bash
source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
mon_port=$(get_unused_port)
function run() {
local dir=$1
shift
export CEPH_MON="127.0.0.1:$mon_port"
export CEPH_ARGS
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
CEPH_ARGS+="--mon-host=$CEPH_MON "
set -e
... | 1,310 | 19.169231 | 74 | sh |
null | ceph-main/src/test/strtol.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 Dreamhost
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version ... | 14,177 | 20.812308 | 82 | cc |
null | ceph-main/src/test/test_addrs.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License versio... | 9,731 | 28.050746 | 107 | cc |
null | ceph-main/src/test/test_admin_socket_output.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2017 Red Hat
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.... | 3,766 | 27.976923 | 112 | cc |
null | ceph-main/src/test/test_any.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2018 Adam C. Emerson <aemerson@redhat.com>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Publi... | 21,692 | 25.682657 | 77 | cc |
null | ceph-main/src/test/test_arch.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph distributed storage system
*
* Copyright (C) 2014 Red Hat <contact@redhat.com>
*
* Author: Loic Dachary <loic@dachary.org>
*
* This library is free software; you can redistribute it and/or
* modify it u... | 2,353 | 24.042553 | 101 | cc |
null | ceph-main/src/test/test_auth.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "include/types.h"
#include "include/stringify.h"
#include "auth/Auth.h"
#include "gtest/gtest.h"
#include "common/ceph_context.h"
#include "global/global_context.h"
#include "auth/AuthRegistry.h"
#include <sstre... | 10,284 | 40.471774 | 80 | cc |
null | ceph-main/src/test/test_backfill.sh | #!/bin/sh
TEST_POOL=rbd
./stop.sh
CEPH_NUM_OSD=3 ./vstart.sh -d -n -x -o 'osd min pg log entries = 5'
./rados -p $TEST_POOL bench 15 write -b 4096
./ceph osd out 0
./init-ceph stop osd.0
./ceph osd down 0
./rados -p $TEST_POOL bench 600 write -b 4096
| 255 | 20.333333 | 67 | sh |
null | ceph-main/src/test/test_c2c.cc | #include "common/ceph_argparse.h"
#include "common/debug.h"
#include "common/config.h"
#include "global/global_init.h"
#include "global/signal_handler.h"
#include "include/mempool.h"
#include <iostream>
#include <string>
using std::cerr;
using std::string;
static void usage(void)
{
cerr << "--threads number... | 1,927 | 20.662921 | 94 | cc |
null | ceph-main/src/test/test_c_headers.c | // -*- mode:C++; tab-width:2; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=2 sw=2 smarttab
#include <stdlib.h>
#include "include/cephfs/libcephfs.h"
#include "include/rados/librados.h"
#ifdef __cplusplus
#error "test invalid: only use C mode"
#endif
int main(int argc, char **argv)
{
int ret;
/* librados.h ... | 563 | 17.193548 | 70 | c |
null | ceph-main/src/test/test_cfuse_cache_invalidate.cc |
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "include/ceph_assert.h"
#define REGION 1048576
int main(int argc, char *argv[]) {
pid_t p = fork();
char buf[REGION];
memset(buf, 0, size... | 1,005 | 17.290909 | 56 | cc |
null | ceph-main/src/test/test_common.sh | #!/usr/bin/env bash
set -x
#
# test_common.sh
#
# Common routines for tests
#
#
# Environment variables that affect tests:
# KEEP_TEMPDIR If set, the tempdir will not be deleted
# when the test is over.
#
# Clean up the temporary directory
cleanup() {
if [ -n ${T... | 4,371 | 23.982857 | 106 | sh |
null | ceph-main/src/test/test_cors.cc | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern "C"{
#include <curl/curl.h>
}
#include "common/ceph_crypto.h"
#include <map>
#include <list>
#define S3_BUCKET_NAME "s3testgw.fcgi"
#define SWIFT_BUCKET_NAME "swift3testgw.fcgi"
#define BUCKET_URL \
((g_test->get_key_type() == KEY_T... | 34,226 | 36.945676 | 113 | cc |
null | ceph-main/src/test/test_crush_bucket.sh | #!/usr/bin/env bash
#Generic test_crush_bucket test
#
# Includes
source $(dirname $0)/detect-build-env-vars.sh
source ../qa/standalone/ceph-helpers.sh
function run() {
local dir=$1
shift
export CEPH_MON="127.0.0.1:17119" # git grep '\<17119\>' : there must be only one
export CEPH_ARGS
CEPH_ARGS... | 1,516 | 27.622642 | 108 | sh |
null | ceph-main/src/test/test_csyn.sh | #!/usr/bin/env bash
set -x
#
# Runs the synthetic client
#
# Includes
source "`dirname $0`/test_common.sh"
# Functions
setup() {
export CEPH_NUM_OSD=$1
# Start ceph
./stop.sh
# set recovery start to a really long time to ensure that we don't start recovery
./vstart.sh -d -n ... | 633 | 16.135135 | 98 | sh |
null | ceph-main/src/test/test_denc.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph distributed storage system
*
* Copyright (C) 2016 Red Hat
*
* Author: Sage Weil <sage@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU... | 16,370 | 21.004032 | 79 | cc |
null | ceph-main/src/test/test_features.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include <stdio.h>
#include "global/global_init.h"
#include "common/ceph_argparse.h"
#include "common/ceph_releases.h"
#include "common/ceph_strings.h"
#include "global/global_context.h"
#include "gtest/gtest.h"
#include ... | 1,433 | 28.875 | 80 | cc |
null | ceph-main/src/test/test_get_blkdev_props.cc | #include <stdio.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "include/uuid.h"
#include "common/blkdev.h"
#define BUFSIZE 80
int main(int argc, char **argv)
{
int fd, ret;
int64_t size;
bool discard_support;
bool rotational... | 2,018 | 21.433333 | 65 | cc |
null | ceph-main/src/test/test_intarith.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include <climits>
#include <gtest/gtest.h>
#include "include/intarith.h"
TEST(intarith, cbits) {
ASSERT_EQ(0u, cbits(0));
ASSERT_EQ(1u, cbits(1));
ASSERT_EQ(2u, cbits(2));
ASSERT_EQ(2u, cbits(3));
ASSERT_EQ(3u... | 1,128 | 26.536585 | 70 | cc |
null | ceph-main/src/test/test_ipaddr.cc | #include "include/ipaddr.h"
#include "common/pick_address.h"
#include "gtest/gtest.h"
#include "include/stringify.h"
#include "common/ceph_context.h"
#include <boost/smart_ptr/intrusive_ptr.hpp>
#if defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#include <arpa/inet.... | 27,288 | 26.343687 | 109 | cc |
null | ceph-main/src/test/test_lost.sh | #!/usr/bin/env bash
set -x
#
# Test the lost object logic
#
# Includes
source "`dirname $0`/test_common.sh"
TEST_POOL=rbd
# Functions
setup() {
export CEPH_NUM_OSD=$1
vstart_config=$2
# Start ceph
./stop.sh
# set recovery start to a really long time to ensure that we don't ... | 6,419 | 23.883721 | 89 | sh |
null | ceph-main/src/test/test_mempool.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph distributed storage system
*
* Copyright (C) 2016 Western Digital Corporation
*
* Author: Allen Samuels <allen.samuels@sandisk.com>
*
* This library is free software; you can redistribute it and/or
* mo... | 11,258 | 23.422993 | 101 | cc |
null | ceph-main/src/test/test_missing_unfound.sh | #!/bin/sh
CEPH_NUM_OSD=3 ./vstart.sh -d -n -x -o 'osd recovery max active = 1'
TEST_POOL=rbd
./ceph -c ./ceph.conf osd pool set $TEST_POOL size 3
sleep 20
./init-ceph stop osd.1
./ceph osd down 1 # faster
for f in `seq 1 100`
do
./rados -c ./ceph.conf -p $TEST_POOL put test_$f /etc/passwd
done
# zap some o... | 512 | 16.1 | 68 | sh |
null | ceph-main/src/test/test_mutate.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 2,870 | 24.40708 | 81 | cc |
null | ceph-main/src/test/test_objectstore_memstore.sh | #!/bin/sh -ex
rm -rf memstore.test_temp_dir
ceph_test_objectstore --gtest_filter=\*/0
echo OK
| 96 | 12.857143 | 41 | sh |
null | ceph-main/src/test/test_pageset.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "gtest/gtest.h"
#include "os/memstore/PageSet.h"
template <typename T>
bool is_aligned(T* ptr) {
const auto align_mask = alignof(T) - 1;
return (reinterpret_cast<uintptr_t>(ptr) & align_mask) == 0;
}
TEST(P... | 6,808 | 22.975352 | 70 | cc |
null | ceph-main/src/test/test_pidfile.sh | #!/usr/bin/env bash
#
# test pidfile here
#
# Includes
source $(dirname $0)/detect-build-env-vars.sh
source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
function run() {
local dir=$1
shift
export CEPH_MON="127.0.0.1:7124" # git grep '\<7124\>' : there must be only one
export CEPH_ARGS
CEPH_ARGS+="-... | 2,479 | 26.252747 | 91 | sh |
null | ceph-main/src/test/test_pools.sh | #!/usr/bin/env bash
set -x
#
# Test pools
#
# Includes
source "`dirname $0`/test_common.sh"
# Functions
setup() {
export CEPH_NUM_OSD=$1
# Start ceph
./stop.sh
./vstart.sh -d -n || die "vstart failed"
}
test629_impl() {
# create the pool
./ceph -c ./ceph.conf osd po... | 898 | 16.627451 | 103 | sh |
null | ceph-main/src/test/test_rados_tool.sh | ../../qa/workunits/rados/test_rados_tool.sh | 43 | 43 | 43 | sh |
null | ceph-main/src/test/test_random_string.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2019 Red Hat
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.... | 3,587 | 28.652893 | 82 | cc |
null | ceph-main/src/test/test_rbd_replay.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2014 Adam Crume <adamcrume@gmail.com>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Pub... | 4,039 | 28.489051 | 87 | cc |
null | ceph-main/src/test/test_rewrite_latency.cc |
#include <unistd.h>
#include <map>
#include <errno.h>
#include "include/utime.h"
#include "common/Clock.h"
#include "common/errno.h"
using namespace std;
int main(int argc, const char **argv)
{
const char *fn = argv[1];
multimap<utime_t, utime_t> latency;
unsigned max = 10;
int fd = ::open(fn, O_CREAT|O_RD... | 1,144 | 22.854167 | 82 | cc |
null | ceph-main/src/test/test_rgw_admin_log.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser Gener... | 53,791 | 32.810182 | 111 | cc |
null | ceph-main/src/test/test_rgw_admin_meta.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser Gener... | 28,954 | 30.302703 | 104 | cc |
null | ceph-main/src/test/test_rgw_ldap.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2015 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 2,885 | 23.666667 | 212 | cc |
null | ceph-main/src/test/test_rgw_token.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2016 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License vers... | 3,222 | 24.784 | 203 | cc |
null | ceph-main/src/test/test_rw.sh | #!/usr/bin/env bash
set -x
#
# Generic read/write from object store test
#
# Includes
source "`dirname $0`/test_common.sh"
TEST_POOL=rbd
# Functions
my_write_objects() {
write_objects $1 $2 10 1000000 $TEST_POOL
}
setup() {
export CEPH_NUM_OSD=$1
# Start ceph
./stop.sh
./v... | 854 | 14.833333 | 51 | sh |
null | ceph-main/src/test/test_snap_mapper.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
#include <iterator>
#include <map>
#include <set>
#include <boost/scoped_ptr.hpp>
#include <sys/types.h>
#include <cstdlib>
#include "include/buffer.h"
#include "common/map_cacher.hpp"
#include "osd/osd_types_fmt.h"
#include "osd/SnapMapper.h"
#inc... | 25,223 | 25.467996 | 116 | cc |
null | ceph-main/src/test/test_split.sh | #!/usr/bin/env bash
set -x
#
# Add some objects to the data PGs, and then test splitting those PGs
#
# Includes
source "`dirname $0`/test_common.sh"
TEST_POOL=rbd
# Constants
my_write_objects() {
write_objects $1 $2 10 1000000 $TEST_POOL
}
setup() {
export CEPH_NUM_OSD=$1
# Start ceph
... | 1,299 | 17.84058 | 94 | sh |
null | ceph-main/src/test/test_str_list.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "include/str_list.h"
#include "gtest/gtest.h"
// SplitTest is parameterized for list/vector/set
using Types = ::testing::Types<std::list<std::string>,
std::vector<std::string>>;
... | 1,553 | 32.782609 | 70 | cc |
null | ceph-main/src/test/test_stress_watch.cc | #include "include/rados/librados.h"
#include "include/rados/librados.hpp"
#include "include/utime.h"
#include "common/Thread.h"
#include "common/Clock.h"
#include "test/librados/test_cxx.h"
#include "gtest/gtest.h"
#include <semaphore.h>
#include <errno.h>
#include <map>
#include <sstream>
#include <iostream>
#include... | 2,922 | 22.572581 | 70 | cc |
null | ceph-main/src/test/test_striper.cc | #include "gtest/gtest.h"
#include "global/global_context.h"
#include "osdc/Striper.h"
using namespace std;
TEST(Striper, Stripe1)
{
file_layout_t l;
l.object_size = 262144;
l.stripe_unit = 4096;
l.stripe_count = 3;
vector<ObjectExtent> ex;
Striper::file_to_extents(g_ceph_context, 1, &l, 5006035, 46419,... | 1,945 | 20.622222 | 86 | cc |
null | ceph-main/src/test/test_subprocess.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph distributed storage system
*
* Copyright (C) 2015 Mirantis Inc
*
* Author: Mykola Golub <mgolub@mirantis.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the term... | 9,150 | 28.050794 | 94 | cc |
null | ceph-main/src/test/test_texttable.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2012 Inktank Storage, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Lice... | 2,036 | 24.78481 | 80 | cc |
null | ceph-main/src/test/test_trans.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General ... | 2,052 | 24.345679 | 71 | cc |
null | ceph-main/src/test/test_unfound.sh | #!/usr/bin/env bash
set -x
#
# Creates some unfound objects and then tests finding them.
#
# Includes
source "`dirname $0`/test_common.sh"
TEST_POOL=rbd
# Functions
my_write_objects() {
write_objects $1 $2 10 1000000 $TEST_POOL
}
setup() {
export CEPH_NUM_OSD=$1
# Start ceph
./stop... | 3,137 | 21.414286 | 103 | sh |
null | ceph-main/src/test/test_utime.cc | #include "include/utime.h"
#include "gtest/gtest.h"
#include "include/stringify.h"
#include "common/ceph_context.h"
using namespace std;
TEST(utime_t, localtime)
{
utime_t t(1556122013, 839991182);
string s = stringify(t);
cout << s << std::endl;
// time zone may vary where unit test is run, so be cirsumspect... | 1,839 | 26.058824 | 71 | cc |
null | ceph-main/src/test/test_weighted_shuffle.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "common/weighted_shuffle.h"
#include <array>
#include <map>
#include "gtest/gtest.h"
TEST(WeightedShuffle, Basic) {
std::array<char, 5> choices{'a', 'b', 'c', 'd', 'e'};
std::array<int, 5> weights{100, 50, 2... | 1,340 | 32.525 | 79 | cc |
null | ceph-main/src/test/test_workqueue.cc | #include "gtest/gtest.h"
#include "common/WorkQueue.h"
#include "common/ceph_argparse.h"
using namespace std;
TEST(WorkQueue, StartStop)
{
ThreadPool tp(g_ceph_context, "foo", "tp_foo", 10, "");
tp.start();
tp.pause();
tp.pause_new();
tp.unpause();
tp.unpause();
tp.drain();
tp.stop();
}
TEST(Work... | 2,428 | 23.535354 | 122 | cc |
null | ceph-main/src/test/test_xlist.cc | #include <algorithm>
#include <iterator>
#include <vector>
#include "include/xlist.h"
#include "gtest/gtest.h"
struct Item {
xlist<Item*>::item xitem;
int val;
explicit Item(int v) :
xitem(this),
val(v)
{}
};
class XlistTest : public testing::Test
{
protected:
typedef xlist<Item*> ItemList;
typ... | 2,540 | 20.352941 | 68 | cc |
null | ceph-main/src/test/testclass.cc |
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include "objclass/objclass.h"
CLS_VER(1,0)
CLS_NAME(test)
cls_handle_t h_class;
cls_method_handle_t h_foo;
int foo_method(cls_method_context_t ctx, char *indata, int datalen,
char **outdata, int *outdatalen)
{
int i, r;
cls_log("hello worl... | 1,032 | 16.810345 | 79 | cc |
null | ceph-main/src/test/testcrypto.cc | #include "auth/Crypto.h"
#include "common/Clock.h"
#include "common/config.h"
#include "common/debug.h"
#define dout_subsys ceph_subsys_auth
#define AES_KEY_LEN 16
#define dout_context g_ceph_context
using namespace std;
int main(int argc, char *argv[])
{
char aes_key[AES_KEY_LEN];
memset(aes_key, 0x77, sizeo... | 1,438 | 22.590164 | 69 | cc |
null | ceph-main/src/test/testkeys.cc | #include "auth/cephx/CephxKeyServer.h"
#include "common/ceph_argparse.h"
#include "global/global_init.h"
#include "common/config.h"
#include "common/debug.h"
#define dout_context g_ceph_context
#define AES_KEY_LEN 16
using namespace std;
int main(int argc, const char **argv)
{
auto args = argv_to_vec(argc, argv);... | 1,647 | 22.542857 | 69 | cc |
null | ceph-main/src/test/testmsgr.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General ... | 3,699 | 24.517241 | 136 | cc |
null | ceph-main/src/test/unit.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 1,407 | 27.734694 | 80 | cc |
null | ceph-main/src/test/utf8.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2011 New Dream Network
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License ... | 2,326 | 33.731343 | 83 | cc |
null | ceph-main/src/test/vstart_wrapper.sh | #!/usr/bin/env bash
#
# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
# Copyright (C) 2015 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library Public License as published ... | 2,231 | 28.368421 | 83 | sh |
null | ceph-main/src/test/xattr_bench.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General P... | 5,204 | 25.42132 | 86 | cc |
null | ceph-main/src/test/ObjectMap/KeyValueDBMemory.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "include/encoding.h"
#include "KeyValueDBMemory.h"
#include <map>
#include <set>
#include <iostream>
using namespace std;
/**
* Iterate over the whole key space of the in-memory store
*
* @note Removing keys ... | 5,982 | 21.577358 | 99 | cc |
null | ceph-main/src/test/ObjectMap/KeyValueDBMemory.h | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include <map>
#include <set>
#include <string>
#include "kv/KeyValueDB.h"
#include "include/buffer.h"
#include "include/Context.h"
using std::string;
class KeyValueDBMemory : public KeyValueDB {
public:
std::map<std:... | 4,938 | 25.132275 | 110 | h |
null | ceph-main/src/test/ObjectMap/test_keyvaluedb_atomicity.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
#include <pthread.h>
#include "include/buffer.h"
#include "kv/KeyValueDB.h"
#include <sys/types.h>
#include <dirent.h>
#include <string>
#include <vector>
#include <boost/scoped_ptr.hpp>
#include <iostream>
#include <sstream>
#include "stdlib.h"
#in... | 3,191 | 26.282051 | 77 | cc |
null | ceph-main/src/test/ObjectMap/test_keyvaluedb_iterators.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2012 Inktank, Inc.
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1... | 55,602 | 30.646557 | 123 | cc |
null | ceph-main/src/test/ObjectMap/test_object_map.cc | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
#include <iterator>
#include <map>
#include <set>
#include <boost/scoped_ptr.hpp>
#include "include/buffer.h"
#include "test/ObjectMap/KeyValueDBMemory.h"
#include "kv/KeyValueDB.h"
#include "os/DBObjectMap.h"
#include <sys/types.h>
#include "globa... | 31,252 | 26.731145 | 82 | cc |
null | ceph-main/src/test/behave_tests/README.md | # Integration testing using the behave framework
## Introduction
Behave framework is based on the Behaviour driven development where the test cases defined using gherkin language (written natural language style). The test cases are defined in .feature files in `feature` directory and python implementation defined un... | 1,675 | 31.862745 | 273 | md |
null | ceph-main/src/test/behave_tests/features/environment.py | import logging
import os
import re
from jinja2 import Template
from kcli_handler import is_bootstrap_script_complete, execute_kcli_cmd
KCLI_PLANS_DIR = "generated_plans"
KCLI_PLAN_NAME = "behave_test_plan"
Kcli_Config = {
"nodes": 1,
"pool": "default",
"network": "default",
"domain": "cephlab.com",
... | 5,810 | 26.9375 | 76 | py |
null | ceph-main/src/test/behave_tests/features/kcli_handler.py | import subprocess
import time
import os
kcli_exec = r"""
podman run --net host -it --rm --security-opt label=disable
-v $HOME/.ssh:/root/.ssh -v $HOME/.kcli:/root/.kcli
-v /var/lib/libvirt/images:/var/lib/libvirt/images
-v /var/run/libvirt:/var/run/libvirt -v $PWD:/workdir
-v /var/tmp:/ignitiondir jolmomar/kcli
"... | 2,673 | 29.044944 | 75 | py |
null | ceph-main/src/test/behave_tests/features/validation_util.py |
def str_to_list(string):
"""
Converts the string into list removing whitespaces
"""
string = string.replace('\t', '\n')
return [
[
key for key in line.split(' ')
if key != ''
]
for line in string.split('\n')
if line != ''
]
def assert_st... | 454 | 21.75 | 62 | py |
null | ceph-main/src/test/behave_tests/features/steps/ceph_steps.py | import time
from behave import given, when, then
from kcli_handler import execute_ssh_cmd
from validation_util import str_to_list
@given("I log as root into {node}")
def login_to_node(context, node):
context.node = node
@given("I execute in {shell}")
def init_step_execute(context, shell):
commands = contex... | 3,754 | 34.093458 | 76 | py |
null | ceph-main/src/test/centos-8/install-deps.sh | ../../../install-deps.sh | 24 | 24 | 24 | sh |
null | ceph-main/src/test/ceph-erasure-code-tool/test_ceph-erasure-code-tool.sh | #!/bin/sh -ex
TMPDIR=/tmp/test_ceph-erasure-code-tool.$$
mkdir $TMPDIR
trap "rm -fr $TMPDIR" 0
ceph-erasure-code-tool test-plugin-exists INVALID_PLUGIN && exit 1
ceph-erasure-code-tool test-plugin-exists jerasure
ceph-erasure-code-tool validate-profile \
plugin=jerasure,technique=reed_sol_van,... | 1,327 | 29.181818 | 76 | sh |