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/qa/tasks/mgr/dashboard/test_rgw.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import base64 import logging import time from urllib import parse from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.hashes import SHA1 from cryptography.hazmat.primitives.twofactor.totp import TOTP from .helper ...
31,731
35.515535
96
py
null
ceph-main/qa/tasks/mgr/dashboard/test_role.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from .helper import DashboardTestCase class RoleTest(DashboardTestCase): @classmethod def _create_role(cls, name=None, description=None, scopes_permissions=None): data = {} if name: data['name'] = name if desc...
5,072
33.746575
94
py
null
ceph-main/qa/tasks/mgr/dashboard/test_settings.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from .helper import DashboardTestCase, JAny, JList, JObj class SettingsTest(DashboardTestCase): def setUp(self): super(SettingsTest, self).setUp() self.settings = self._get('/api/settings') def tearDown(self): self._put(...
2,000
29.318182
75
py
null
ceph-main/qa/tasks/mgr/dashboard/test_summary.py
from __future__ import absolute_import from .helper import DashboardTestCase class SummaryTest(DashboardTestCase): CEPHFS = True def test_summary(self): data = self._get("/api/summary") self.assertStatus(200) self.assertIn('health_status', data) self.assertIn('mgr_id', data)...
1,428
34.725
77
py
null
ceph-main/qa/tasks/mgr/dashboard/test_telemetry.py
from .helper import DashboardTestCase, JObj class TelemetryTest(DashboardTestCase): pre_enabled_status = True @classmethod def setUpClass(cls): super(TelemetryTest, cls).setUpClass() data = cls._get('/api/mgr/module/telemetry') cls.pre_enabled_status = data['enabled'] # ...
2,880
28.10101
82
py
null
ceph-main/qa/tasks/mgr/dashboard/test_user.py
# -*- coding: utf-8 -*- # pylint: disable=too-many-public-methods from __future__ import absolute_import import time from datetime import datetime, timedelta from .helper import DashboardTestCase class UserTest(DashboardTestCase): @classmethod def setUpClass(cls): super(UserTest, cls).setUpClass() ...
22,019
37.904594
96
py
null
ceph-main/qa/tasks/tests/__init__.py
0
0
0
py
null
ceph-main/qa/tasks/tests/conftest.py
import glob def pytest_addoption(parser): parser.addoption("--suite-dir", help="suite dir") def pytest_generate_tests(metafunc): if "yaml_file" in metafunc.fixturenames: suite_dir = metafunc.config.getoption("--suite-dir") files = glob.glob(f"{suite_dir}/**/*.yaml", recursive=True) m...
371
27.615385
67
py
null
ceph-main/qa/tasks/tests/test_devstack.py
from textwrap import dedent from tasks import devstack class TestDevstack(object): def test_parse_os_table(self): table_str = dedent(""" +---------------------+--------------------------------------+ | Property | Value | +-----...
2,096
41.795918
74
py
null
ceph-main/qa/tasks/tests/test_import_yaml.py
import yaml def test_load_yaml(yaml_file): yaml.safe_load(open(yaml_file))
81
12.666667
35
py
null
ceph-main/qa/tasks/tests/test_radosgw_admin.py
from unittest.mock import Mock from tasks import radosgw_admin acl_with_version = b"""<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>foo</ID><DisplayName>Foo</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001...
1,663
51
440
py
null
ceph-main/qa/tasks/util/__init__.py
from teuthology import misc def get_remote(ctx, cluster, service_type, service_id): """ Get the Remote for the host where a particular role runs. :param cluster: name of the cluster the service is part of :param service_type: e.g. 'mds', 'osd', 'client' :param service_id: The third part of a role,...
1,049
37.888889
75
py
null
ceph-main/qa/tasks/util/chacra.py
#!/usr/bin/env python3 import argparse import logging import requests import sys from pathlib import Path from urllib.parse import urlparse log = logging.getLogger(__name__) SHAMAN_SEARCH_URL = 'https://shaman.ceph.com/api/search' PROJECT = 'ceph' DISTRO = 'ubuntu' RELEASE = 'focal' ARCH='x86_64' BRANCH = 'main' S...
4,580
23.497326
114
py
null
ceph-main/qa/tasks/util/rados.py
import logging from teuthology import misc as teuthology log = logging.getLogger(__name__) def rados(ctx, remote, cmd, wait=True, check_status=False): testdir = teuthology.get_testdir(ctx) log.info("rados %s" % ' '.join(cmd)) pre = [ 'adjust-ulimits', 'ceph-coverage', '{tdir}/arch...
3,160
34.920455
112
py
null
ceph-main/qa/tasks/util/rgw.py
import logging import json import time from io import StringIO from teuthology import misc as teuthology log = logging.getLogger(__name__) def rgwadmin(ctx, client, cmd, stdin=StringIO(), check_status=False, omit_sudo=False, omit_tdir=False, format='json', decode=True, log_level=logging.DE...
2,967
28.68
79
py
null
ceph-main/qa/tasks/util/workunit.py
import copy from teuthology import misc from teuthology.orchestra import run class Refspec: def __init__(self, refspec): self.refspec = refspec def __str__(self): return self.refspec def _clone(self, git_url, clonedir, opts=None): if opts is None: opts = [] re...
2,378
29.113924
79
py
null
ceph-main/qa/tasks/util/test/__init__.py
0
0
0
py
null
ceph-main/qa/tasks/util/test/test_rados.py
# # The MIT License # # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com> # # Author: Loic Dachary <loic@dachary.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without ...
1,568
37.268293
68
py
null
ceph-main/qa/timezone/eastern.yaml
tasks: - exec: all: - echo America/New_York | sudo tee /etc/timezone
79
15
54
yaml
null
ceph-main/qa/timezone/pacific.yaml
tasks: - exec: all: - echo America/Los_Angeles | sudo tee /etc/timezone
82
15.6
57
yaml
null
ceph-main/qa/timezone/random.yaml
tasks: - exec: all: - echo America/Los_Angeles | sudo tee /etc/timezone - [ $RANDOM -gt 32000 ] && echo America/New_York | sudo tee /etc/timezone
162
26.166667
79
yaml
null
ceph-main/qa/workunits/ceph-helpers-root.sh
#!/usr/bin/env bash # # 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 by # the Free Software Foundation; either version 2, or (at you...
3,944
29.346154
122
sh
null
ceph-main/qa/workunits/false.sh
#!/bin/sh -ex false
20
6
13
sh
null
ceph-main/qa/workunits/kernel_untar_build.sh
#!/usr/bin/env bash set -ex wget -O linux.tar.gz http://download.ceph.com/qa/linux-5.4.tar.gz mkdir t cd t tar xzf ../linux.tar.gz cd linux* make defconfig make -j`grep -c processor /proc/cpuinfo` cd .. if ! rm -rv linux* ; then echo "uh oh rm -r failed, it left behind:" find . exit 1 fi cd .. rm -rv t l...
326
14.571429
65
sh
null
ceph-main/qa/workunits/post-file.sh
#!/usr/bin/env bash set -ex what="$1" [ -z "$what" ] && what=/etc/udev/rules.d sudo ceph-post-file -d ceph-test-workunit $what echo OK
137
14.333333
47
sh
null
ceph-main/qa/workunits/test_telemetry_pacific.sh
#!/bin/bash -ex # Set up ident details for cluster ceph config set mgr mgr/telemetry/channel_ident true ceph config set mgr mgr/telemetry/organization 'ceph-qa' ceph config set mgr mgr/telemetry/description 'upgrade test cluster' # Opt-in ceph telemetry on --license sharing-1-0 # Check last_opt_revision LAST_OPT_REV...
573
22.916667
72
sh
null
ceph-main/qa/workunits/test_telemetry_pacific_x.sh
#!/bin/bash -ex # Assert that we're still opted in LAST_OPT_REVISION=$(ceph config get mgr mgr/telemetry/last_opt_revision) if [ $LAST_OPT_REVISION -ne 3 ]; then echo "last_opt_revision is incorrect" exit 1 fi # Check the warning: STATUS=$(ceph -s) if ! [[ $STATUS == *"Telemetry requires re-opt-in"* ]] then ...
1,374
21.916667
108
sh
null
ceph-main/qa/workunits/test_telemetry_quincy.sh
#!/bin/bash -ex # Set up ident details for cluster ceph config set mgr mgr/telemetry/channel_ident true ceph config set mgr mgr/telemetry/organization 'ceph-qa' ceph config set mgr mgr/telemetry/description 'upgrade test cluster' #Run preview commands ceph telemetry preview ceph telemetry preview-device ceph telemet...
1,191
25.488889
108
sh
null
ceph-main/qa/workunits/test_telemetry_quincy_x.sh
#!/bin/bash -ex # For quincy, the last_opt_revision remains at 1 since last_opt_revision # was phased out for fresh installs of quincy. LAST_OPT_REVISION=$(ceph config get mgr mgr/telemetry/last_opt_revision) if [ $LAST_OPT_REVISION -ne 1 ]; then echo "last_opt_revision is incorrect" exit 1 fi # Check the war...
977
22.853659
108
sh
null
ceph-main/qa/workunits/true.sh
#!/bin/sh -ex true
20
4.25
13
sh
null
ceph-main/qa/workunits/caps/mon_commands.sh
#!/bin/sh -ex ceph-authtool --create-keyring k --gen-key -p --name client.xx ceph auth add -i k client.xx mon "allow command foo; allow command bar *; allow command baz ...; allow command foo add * mon allow\\ rwx osd allow\\ *" ( ceph -k k -n client.xx foo || true ) | grep 'unrecog' ( ceph -k k -n client.xx foo...
1,352
53.12
151
sh
null
ceph-main/qa/workunits/ceph-tests/ceph-admin-commands.sh
#!/bin/sh -ex ceph -s rados lspools rbd ls # check that the monitors work ceph osd set nodown ceph osd unset nodown exit 0
125
10.454545
30
sh
null
ceph-main/qa/workunits/cephadm/create_iscsi_disks.sh
#!/bin/bash -ex # Create some file-backed iSCSI targets and attach them locally. # Exit if it's not CentOS if ! grep -q rhel /etc/*-release; then echo "The script only supports CentOS." exit 1 fi [ -z "$SUDO" ] && SUDO=sudo # 15 GB DISK_FILE_SIZE="16106127360" $SUDO yum install -y targetcli iscsi-initiator-...
1,325
34.837838
87
sh
null
ceph-main/qa/workunits/cephadm/test_adoption.sh
#!/bin/bash -ex SCRIPT_NAME=$(basename ${BASH_SOURCE[0]}) SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CEPHADM_SRC_DIR=${SCRIPT_DIR}/../../../src/cephadm CORPUS_COMMIT=9cd9ad020d93b0b420924fec55da307aff8bd422 [ -z "$SUDO" ] && SUDO=sudo [ -d "$TMPDIR" ] || TMPDIR=$(mktemp -d tmp.$SCRIPT_NAME.XXXXXX...
1,838
29.147541
67
sh
null
ceph-main/qa/workunits/cephadm/test_cephadm.sh
#!/bin/bash -ex SCRIPT_NAME=$(basename ${BASH_SOURCE[0]}) SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # cleanup during exit [ -z "$CLEANUP" ] && CLEANUP=true FSID='00000000-0000-0000-0000-0000deadbeef' # images that are used IMAGE_MAIN=${IMAGE_MAIN:-'quay.ceph.io/ceph-ci/ceph:main'} IMAGE_PACIFIC...
15,287
31.185263
165
sh
null
ceph-main/qa/workunits/cephadm/test_dashboard_e2e.sh
#!/bin/bash -ex SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DASHBOARD_FRONTEND_DIR=${SCRIPT_DIR}/../../../src/pybind/mgr/dashboard/frontend [ -z "$SUDO" ] && SUDO=sudo install_common () { NODEJS_VERSION="16" if grep -q debian /etc/*-release; then $SUDO apt-get update # htt...
4,224
38.12037
147
sh
null
ceph-main/qa/workunits/cephadm/test_iscsi_etc_hosts.sh
#!/bin/bash # checks if the container and host's /etc/hosts files match # Necessary to avoid potential bugs caused by podman making # edits to /etc/hosts file in the container # exits with code 1 if host and iscsi container /etc/hosts do no match set -ex ISCSI_DAEMON=$(sudo /home/ubuntu/cephtest/cephadm ls | jq -r '...
819
36.272727
114
sh
null
ceph-main/qa/workunits/cephadm/test_iscsi_pids_limit.sh
#!/bin/bash # checks if the containers default pids-limit (4096) is removed and Iscsi # containers continue to run # exits 1 if fails set -ex ISCSI_CONT_IDS=$(sudo podman ps -qa --filter='name=iscsi') CONT_COUNT=$(echo ${ISCSI_CONT_IDS} | wc -w) test ${CONT_COUNT} -eq 2 for i in ${ISCSI_CONT_IDS} do test $(sudo p...
648
20.633333
77
sh
null
ceph-main/qa/workunits/cephadm/test_repos.sh
#!/bin/bash -ex SCRIPT_NAME=$(basename ${BASH_SOURCE[0]}) SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) CEPHADM_SRC_DIR=${SCRIPT_DIR}/../../../src/cephadm [ -d "$TMPDIR" ] || TMPDIR=$(mktemp -d tmp.$SCRIPT_NAME.XXXXXX) trap "$SUDO rm -rf $TMPDIR" EXIT if [ -z "$CEPHADM" ]; then CEPHADM=`mktemp -p $TMPDIR tmp.cephadm.X...
1,250
26.195652
63
sh
null
ceph-main/qa/workunits/cephtool/test.sh
#!/usr/bin/env bash # -*- mode:shell-script; tab-width:8; sh-basic-offset:2; indent-tabs-mode:t -*- # vim: ts=8 sw=8 ft=bash smarttab set -x source $(dirname $0)/../../standalone/ceph-helpers.sh set -e set -o functrace PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: ' SUDO=${SUDO:-sudo} export CEPH_DEV=1 function c...
106,096
34.460227
173
sh
null
ceph-main/qa/workunits/cephtool/test_daemon.sh
#!/usr/bin/env bash set -ex expect_false() { set -x if "$@"; then return 1; else return 0; fi } echo note: assuming mon.a is on the current host # can set to 'sudo ./ceph' to execute tests from current dir for development CEPH=${CEPH:-'sudo ceph'} ${CEPH} daemon mon.a version | grep version # get debug_ms setti...
1,184
25.931818
76
sh
null
ceph-main/qa/workunits/cephtool/test_kvstore_tool.sh
#!/usr/bin/env bash set -x source $(dirname $0)/../../standalone/ceph-helpers.sh set -e set -o functrace PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: ' SUDO=${SUDO:-sudo} export CEPH_DEV=1 echo note: test ceph_kvstore_tool with bluestore expect_false() { set -x if "$@"; then return 1; else return 0; fi...
1,976
26.458333
101
sh
null
ceph-main/qa/workunits/client/test.sh
#!/bin/sh set -ex ceph_test_client
37
5.333333
16
sh
null
ceph-main/qa/workunits/cls/test_cls_2pc_queue.sh
#!/bin/sh -e ceph_test_cls_2pc_queue exit 0
46
6.833333
23
sh
null
ceph-main/qa/workunits/cls/test_cls_cas.sh
#!/bin/sh -e GTEST_FILTER=${CLS_CAS_GTEST_FILTER:-*} ceph_test_cls_cas --gtest_filter=${GTEST_FILTER} exit 0
111
15
48
sh
null
ceph-main/qa/workunits/cls/test_cls_cmpomap.sh
#!/bin/sh -e ceph_test_cls_cmpomap exit 0
44
6.5
21
sh
null
ceph-main/qa/workunits/cls/test_cls_hello.sh
#!/bin/sh -e ceph_test_cls_hello exit 0
42
6.166667
19
sh
null
ceph-main/qa/workunits/cls/test_cls_journal.sh
#!/bin/sh -e GTEST_FILTER=${CLS_JOURNAL_GTEST_FILTER:-*} ceph_test_cls_journal --gtest_filter=${GTEST_FILTER} exit 0
119
16.142857
52
sh
null
ceph-main/qa/workunits/cls/test_cls_lock.sh
#!/bin/sh -e ceph_test_cls_lock exit 0
41
6
18
sh
null
ceph-main/qa/workunits/cls/test_cls_log.sh
#!/bin/sh -e ceph_test_cls_log exit 0
40
5.833333
17
sh
null
ceph-main/qa/workunits/cls/test_cls_numops.sh
#!/bin/sh -e ceph_test_cls_numops exit 0
43
6.333333
20
sh
null
ceph-main/qa/workunits/cls/test_cls_rbd.sh
#!/bin/sh -e GTEST_FILTER=${CLS_RBD_GTEST_FILTER:-*} ceph_test_cls_rbd --gtest_filter=${GTEST_FILTER} exit 0
111
15
48
sh
null
ceph-main/qa/workunits/cls/test_cls_refcount.sh
#!/bin/sh -e ceph_test_cls_refcount exit 0
45
6.666667
22
sh
null
ceph-main/qa/workunits/cls/test_cls_rgw.sh
#!/bin/sh -e ceph_test_cls_rgw #ceph_test_cls_rgw_meta #ceph_test_cls_rgw_log #ceph_test_cls_rgw_opstate exit 0
114
11.777778
26
sh
null
ceph-main/qa/workunits/cls/test_cls_rgw_gc.sh
#!/bin/sh -e ceph_test_cls_rgw_gc exit 0
43
6.333333
20
sh
null
ceph-main/qa/workunits/cls/test_cls_rgw_stats.sh
#!/bin/sh -e ceph_test_cls_rgw_stats exit 0
46
6.833333
23
sh
null
ceph-main/qa/workunits/cls/test_cls_sdk.sh
#!/bin/sh -e ceph_test_cls_sdk exit 0
40
5.833333
17
sh
null
ceph-main/qa/workunits/direct_io/big.sh
#!/bin/sh -ex echo "test large (16MB) dio write" dd if=/dev/zero of=foo.big bs=16M count=1 oflag=direct echo OK
114
15.428571
54
sh
null
ceph-main/qa/workunits/direct_io/direct_io_test.c
/* * 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 version 2.1, as published by the Free Software * Foundation. See file COPYING. * */ #include ...
9,251
28.559105
86
c
null
ceph-main/qa/workunits/direct_io/misc.sh
#!/bin/sh -ex # a few test cases from henry echo "test read from hole" dd if=/dev/zero of=dd3 bs=1 seek=1048576 count=0 dd if=dd3 of=/tmp/ddout1 skip=8 bs=512 count=2 iflag=direct dd if=/dev/zero of=/tmp/dd3 bs=512 count=2 cmp /tmp/dd3 /tmp/ddout1 echo "other thing" dd if=/dev/urandom of=/tmp/dd10 bs=500 count=1 dd i...
466
26.470588
64
sh
null
ceph-main/qa/workunits/direct_io/test_short_dio_read.c
#include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <stdlib.h> int main() { char buf[409600]; ssize_t r; int err; int fd = open("shortfile", O_WRONLY|O_CREAT, 0644); if (fd < 0) { err = errno; pri...
1,168
19.155172
74
c
null
ceph-main/qa/workunits/direct_io/test_sync_io.c
#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <inttypes.h> #include <linux/types.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <errno.h> //#include "../client/ioctl.h" #include <linux/ioctl.h> #define CEPH_IOCTL_MAGIC 0x97 ...
5,551
21.119522
84
c
null
ceph-main/qa/workunits/erasure-code/bench.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" > <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Erasure Code Plugins Benchmarks</title> <link href="examples.css" rel="stylesheet" type="text/css"> <script language="jav...
1,168
32.4
98
html
null
ceph-main/qa/workunits/erasure-code/bench.sh
#!/usr/bin/env bash # # Copyright (C) 2015 Red Hat <contact@redhat.com> # Copyright (C) 2013,2014 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 publi...
5,694
28.507772
96
sh
null
ceph-main/qa/workunits/erasure-code/encode-decode-non-regression.sh
#!/usr/bin/env bash # # Copyright (C) 2014 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 by # the Free Software Foundation; either version 2, or (at you...
1,196
28.195122
75
sh
null
ceph-main/qa/workunits/erasure-code/examples.css
* { padding: 0; margin: 0; vertical-align: top; } body { background: url(background.png) repeat-x; font: 18px/1.5em "proxima-nova", Helvetica, Arial, sans-serif; } a { color: #069; } a:hover { color: #28b; } h2 { margin-top: 15px; font: normal 32px "omnes-pro", Helvetica, Arial, sans-serif; } h3 { margin-left:...
1,738
16.927835
63
css
null
ceph-main/qa/workunits/fs/cephfs_mirror_ha_gen.sh
#!/bin/bash -ex # # cephfs_mirror_ha_gen.sh - generate workload to synchronize # . $(dirname $0)/cephfs_mirror_helpers.sh cleanup() { for i in `seq 1 $NR_DIRECTORIES` do local repo_name="${REPO_PATH_PFX}_$i" for j in `seq 1 $NR_SNAPSHOTS` do snap_name=$repo_name/.snap/snap_...
1,541
21.028571
85
sh
null
ceph-main/qa/workunits/fs/cephfs_mirror_ha_verify.sh
#!/bin/bash -ex # # cephfs_mirror_ha_verify.sh - verify synchronized snapshots # . $(dirname $0)/cephfs_mirror_helpers.sh echo "running verifier on secondary file system..." for i in `seq 1 $NR_DIRECTORIES` do repo_name="${REPO_PATH_PFX}_$i" for j in `seq 1 $NR_SNAPSHOTS` do for s in 1 1 2 4 4 4 ...
1,223
28.853659
67
sh
null
ceph-main/qa/workunits/fs/cephfs_mirror_helpers.sh
PRIMARY_FS='dc' BACKUP_FS='dc-backup' REPO=ceph-qa-suite REPO_DIR=ceph_repo REPO_PATH_PFX="$REPO_DIR/$REPO" NR_DIRECTORIES=4 NR_SNAPSHOTS=4 MIRROR_SUBDIR='/mirror' calc_checksum() { local path=$1 local -n ref=$2 ref=`find -L $path -type f -exec md5sum {} + | awk '{ print $1 }' | md5sum | awk '{ print $1...
1,289
18.253731
101
sh
null
ceph-main/qa/workunits/fs/fscrypt.sh
#!/usr/bin/env bash set -xe mydir=`dirname $0` if [ $# -ne 2 ] then echo "2 parameters are required!\n" echo "Usage:" echo " fscrypt.sh <type> <testdir>" echo " type: should be any of 'none', 'unlocked' or 'locked'" echo " testdir: the test direcotry name" exit 1 fi fscrypt=$1 testcase=$2 testdir=fscrypt_t...
2,581
20.516667
73
sh
null
ceph-main/qa/workunits/fs/multiclient_sync_read_eof.py
#!/usr/bin/python3 import argparse import os def main(): parser = argparse.ArgumentParser() parser.add_argument('mnt1') parser.add_argument('mnt2') parser.add_argument('fn') args = parser.parse_args() open(os.path.join(args.mnt1, args.fn), 'w') f1 = open(os.path.join(args.mnt1, args.fn), ...
854
18.883721
53
py
null
ceph-main/qa/workunits/fs/snap-hierarchy.sh
#!/bin/sh set -ex if [ -d "$1" ]; then mkdir -p -- "$1" && cd "$1" fi [ "$VERIFY" != verify ] && mkdir 1 [ "$VERIFY" != verify ] && mkdir 1/.snap/first stat 1/.snap/first [ "$VERIFY" != verify ] && mkdir 1/2 stat 1/.snap/first/2 && exit 1 [ "$VERIFY" != verify ] && mkdir 1/2/.snap/second stat 1/2/.snap/second [ "$...
589
22.6
49
sh
null
ceph-main/qa/workunits/fs/test_o_trunc.c
#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <stdlib.h> int main(int argc, char *argv[]) { char obuf[32], ibuf[1024]; int n, max = 0; if (argc > 2) max = atoi(argv[2]); if (!max) max = 600; memset(obuf, 0xff, sizeof(obu...
851
17.521739
55
c
null
ceph-main/qa/workunits/fs/test_o_trunc.sh
#!/bin/sh -ex mydir=`dirname $0` $mydir/test_o_trunc trunc.foo 600 echo OK
78
8.875
33
sh
null
ceph-main/qa/workunits/fs/test_python.sh
#!/bin/sh -ex # Running as root because the filesystem root directory will be # owned by uid 0, and that's where we're writing. sudo python3 -m nose -v $(dirname $0)/../../../src/test/pybind/test_cephfs.py exit 0
214
29.714286
77
sh
null
ceph-main/qa/workunits/fs/damage/test-first-damage.sh
#!/bin/bash set -ex FIRST_DAMAGE="first-damage.py" FS=cephfs METADATA_POOL=cephfs_meta MOUNT=~/mnt/mnt.0 PYTHON=python3 function usage { printf '%s: [--fs=<fs_name>] [--metadata-pool=<pool>] [--first-damage=</path/to/first-damage.py>]\n' exit 1 } function create { ceph config set mds mds_bal_fragment_dirs 0 ...
4,385
21.492308
125
sh
null
ceph-main/qa/workunits/fs/full/subvolume_clone.sh
#!/usr/bin/env bash set -ex # This testcase tests the 'ceph fs subvolume snapshot clone' when the osd is full. # The clone fails with 'MetadataMgrException: -28 (error in write)' and # truncates the config file of corresponding subvolume while updating the config file. # Hence the subsequent subvolume commands on the...
3,553
30.175439
133
sh
null
ceph-main/qa/workunits/fs/full/subvolume_rm.sh
#!/usr/bin/env bash set -ex # This testcase tests the scenario of the 'ceph fs subvolume rm' mgr command # when the osd is full. The command used to hang. The osd is of the size 1GB. # The subvolume is created and 500MB file is written. The full-ratios are # set below 500MB such that the osd is treated as full. Now th...
1,766
23.205479
93
sh
null
ceph-main/qa/workunits/fs/full/subvolume_snapshot_rm.sh
#!/usr/bin/env bash set -ex # This testcase tests the 'ceph fs subvolume snapshot rm' when the osd is full. # The snapshot rm fails with 'MetadataMgrException: -28 (error in write)' and # truncates the config file of corresponding subvolume. Hence the subsequent # snapshot rm of the same snapshot fails with 'Metadata...
2,595
28.83908
123
sh
null
ceph-main/qa/workunits/fs/maxentries/maxentries.sh
#!/usr/bin/env bash set -ex function expect_false() { set -x if "$@"; then return 1; else return 0; fi } function make_files() { set +x temp_dir=`mktemp -d mkfile_test_XXXXXX` for i in $(seq 1 $1) do echo -n | dd of="${temp_dir}/file_$i" conv=fsync || return 1 sync "${temp_dir}" || return 1 done ...
2,730
16.50641
64
sh
null
ceph-main/qa/workunits/fs/misc/acl.sh
#!/bin/sh -x set -e mkdir -p testdir cd testdir set +e setfacl -d -m u:nobody:rw . if test $? != 0; then echo "Filesystem does not support ACL" exit 0 fi expect_failure() { if "$@"; then return 1; else return 0; fi } set -e c=0 while [ $c -lt 100 ] do c=`expr $c + 1` # inherited ACL from parent directory's de...
919
17.039216
63
sh
null
ceph-main/qa/workunits/fs/misc/chmod.sh
#!/bin/sh -x set -e check_perms() { file=$1 r=$(ls -la ${file}) if test $? != 0; then echo "ERROR: File listing/stat failed" exit 1 fi perms=$2 if test "${perms}" != $(echo ${r} | awk '{print $1}') && \ test "${perms}." != $(echo ${r} | awk '{print $1}') && \ test "${perms}+" != $(ec...
1,039
16.04918
68
sh
null
ceph-main/qa/workunits/fs/misc/dac_override.sh
#!/bin/sh -x expect_failure() { if "$@"; then return 1; else return 0; fi } set -e mkdir -p testdir file=test_chmod.$$ echo "foo" > testdir/${file} sudo chmod 600 testdir # only root can read expect_failure cat testdir/${file} # directory read/write DAC override for root should allow read sudo cat testdir/${file...
322
15.15
62
sh
null
ceph-main/qa/workunits/fs/misc/direct_io.py
#!/usr/bin/python3 import mmap import os import subprocess def main(): path = "testfile" fd = os.open(path, os.O_RDWR | os.O_CREAT | os.O_TRUNC | os.O_DIRECT, 0o644) ino = os.fstat(fd).st_ino obj_name = "{ino:x}.00000000".format(ino=ino) pool_name = os.getxattr(path, "ceph.file.layout.pool") ...
1,025
22.860465
83
py
null
ceph-main/qa/workunits/fs/misc/dirfrag.sh
#!/usr/bin/env bash set -e DEPTH=5 COUNT=10000 kill_jobs() { jobs -p | xargs kill } trap kill_jobs INT create_files() { for i in `seq 1 $COUNT` do touch file$i done } delete_files() { for i in `ls -f` do if [[ ${i}a = file*a ]] then rm -f $i fi done } rm -rf testdir mkdir testd...
605
10.433962
41
sh
null
ceph-main/qa/workunits/fs/misc/filelock_deadlock.py
#!/usr/bin/python3 import errno import fcntl import os import signal import struct import time def handler(signum, frame): pass def lock_two(f1, f2): lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 10, 0, 0) fcntl.fcntl(f1, fcntl.F_SETLKW, lockdata) time.sleep(10) # don't wait forever ...
1,475
19.219178
67
py
null
ceph-main/qa/workunits/fs/misc/filelock_interrupt.py
#!/usr/bin/python3 from contextlib import contextmanager import errno import fcntl import signal import struct @contextmanager def timeout(seconds): def timeout_handler(signum, frame): raise InterruptedError orig_handler = signal.signal(signal.SIGALRM, timeout_handler) try: signal.alarm(s...
2,299
23.210526
74
py
null
ceph-main/qa/workunits/fs/misc/i_complete_vs_rename.sh
#!/bin/sh set -e mkdir x cd x touch a touch b touch c touch d ls chmod 777 . stat e || true touch f touch g # over existing file echo attempting rename over existing file... touch ../xx mv ../xx f ls | grep f || false echo rename over existing file is okay # over negative dentry echo attempting rename over negative...
423
12.25
46
sh
null
ceph-main/qa/workunits/fs/misc/layout_vxattrs.sh
#!/usr/bin/env bash set -ex # detect data pool datapool= dir=. while true ; do echo $dir datapool=$(getfattr -n ceph.dir.layout.pool $dir --only-values) && break dir=$dir/.. done # file rm -f file file2 touch file file2 getfattr -n ceph.file.layout file getfattr -n ceph.file.layout file | grep -q object...
4,935
41.551724
132
sh
null
ceph-main/qa/workunits/fs/misc/mkpool_layout_vxattrs.sh
#!/usr/bin/env bash set -e touch foo.$$ ceph osd pool create foo.$$ 8 ceph fs add_data_pool cephfs foo.$$ setfattr -n ceph.file.layout.pool -v foo.$$ foo.$$ # cleanup rm foo.$$ ceph fs rm_data_pool cephfs foo.$$ ceph osd pool rm foo.$$ foo.$$ --yes-i-really-really-mean-it echo OK
285
16.875
60
sh
null
ceph-main/qa/workunits/fs/misc/multiple_rsync.sh
#!/bin/sh -ex # Populate with some arbitrary files from the local system. Take # a copy to protect against false fails from system updates during test. export PAYLOAD=/tmp/multiple_rsync_payload.$$ sudo cp -r /usr/lib/ $PAYLOAD set -e sudo rsync -av $PAYLOAD payload.1 sudo rsync -av $PAYLOAD payload.2 # this shou...
644
23.807692
72
sh
null
ceph-main/qa/workunits/fs/misc/rstats.sh
#!/usr/bin/env bash set -x timeout=30 old_value="" new_value="" wait_until_changed() { name=$1 wait=0 while [ $wait -lt $timeout ]; do new_value=`getfattr --only-value -n ceph.dir.$name .` [ $new_value == $old_value ] || return 0 sleep 1 wait=$(($wait + 1)) done return 1 } check_rctime() { old_sec=$(e...
1,836
21.679012
78
sh
null
ceph-main/qa/workunits/fs/misc/trivial_sync.sh
#!/usr/bin/env bash set -e mkdir foo echo foo > bar sync
59
6.5
19
sh
null
ceph-main/qa/workunits/fs/misc/xattrs.sh
#!/bin/sh -x set -e touch file setfattr -n user.foo -v foo file setfattr -n user.bar -v bar file setfattr -n user.empty file getfattr -d file | grep foo getfattr -d file | grep bar getfattr -d file | grep empty echo OK.
224
14
32
sh
null
ceph-main/qa/workunits/fs/norstats/kernel_untar_tar.sh
#!/usr/bin/env bash # check if there is file changed while being archived set -ex KERNEL=linux-4.0.5 wget -q http://download.ceph.com/qa/$KERNEL.tar.xz mkdir untar_tar cd untar_tar tar Jxvf ../$KERNEL.tar.xz $KERNEL/Documentation/ tar cf doc.tar $KERNEL tar xf doc.tar sync tar c $KERNEL >/dev/null rm -rf $KERNEL...
376
12.962963
53
sh
null
ceph-main/qa/workunits/fs/quota/quota.sh
#!/usr/bin/env bash set -ex function expect_false() { set -x if "$@"; then return 1; else return 0; fi } function write_file() { set +x for ((i=1;i<=$2;i++)) do dd if=/dev/zero of=$1 bs=1M count=1 conv=notrunc oflag=append 2>/dev/null >/dev/null if [ $? != 0 ]; then echo Try to write $(($i * 1048576)) ...
3,702
26.029197
86
sh
null
ceph-main/qa/workunits/fs/snaps/snap-rm-diff.sh
#!/bin/sh -ex wget -q http://download.ceph.com/qa/linux-2.6.33.tar.bz2 mkdir foo cp linux* foo mkdir foo/.snap/barsnap rm foo/linux* diff -q foo/.snap/barsnap/linux* linux* && echo "passed: files are identical" rmdir foo/.snap/barsnap echo OK
244
21.272727
77
sh
null
ceph-main/qa/workunits/fs/snaps/snaptest-1.sh
#!/usr/bin/env bash set -ex echo 1 > file1 echo 2 > file2 echo 3 > file3 [ -e file4 ] && rm file4 mkdir .snap/snap1 echo 4 > file4 now=`ls` then=`ls .snap/snap1` rmdir .snap/snap1 if [ "$now" = "$then" ]; then echo live and snap contents are identical? false fi # do it again echo 1 > file1 echo 2 > file2 ech...
402
12.433333
46
sh
null
ceph-main/qa/workunits/fs/snaps/snaptest-2.sh
#!/usr/bin/env bash echo "Create dir 100 to 199 ..." for i in $(seq 100 199); do echo " create dir $i" mkdir "$i" for y in $(seq 10 20); do echo "This is a test file before any snapshot was taken." >"$i/$y" done done echo "Take first snapshot .snap/test1" mkdir .snap/test1 echo "Create dir 200 to 299 ..." f...
1,522
24.383333
96
sh
null
ceph-main/qa/workunits/fs/snaps/snaptest-authwb.sh
#!/bin/sh -x set -e touch foo chmod +x foo mkdir .snap/s find .snap/s/foo -executable | grep foo rmdir .snap/s rm foo echo OK
129
9
39
sh