]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: misc -> fs/misc
authorSage Weil <sage@inktank.com>
Fri, 14 Mar 2014 00:38:08 +0000 (17:38 -0700)
committerSage Weil <sage@inktank.com>
Fri, 14 Mar 2014 00:38:08 +0000 (17:38 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
16 files changed:
qa/workunits/fs/misc/chmod.sh [new file with mode: 0755]
qa/workunits/fs/misc/dirfrag.sh [new file with mode: 0755]
qa/workunits/fs/misc/i_complete_vs_rename.sh [new file with mode: 0755]
qa/workunits/fs/misc/layout_vxattrs.sh [new file with mode: 0755]
qa/workunits/fs/misc/mkpool_layout_vxattrs.sh [new file with mode: 0755]
qa/workunits/fs/misc/multiple_rsync.sh [new file with mode: 0755]
qa/workunits/fs/misc/trivial_sync.sh [new file with mode: 0755]
qa/workunits/fs/misc/xattrs.sh [new file with mode: 0755]
qa/workunits/misc/chmod.sh [deleted file]
qa/workunits/misc/dirfrag.sh [deleted file]
qa/workunits/misc/i_complete_vs_rename.sh [deleted file]
qa/workunits/misc/layout_vxattrs.sh [deleted file]
qa/workunits/misc/mkpool_layout_vxattrs.sh [deleted file]
qa/workunits/misc/multiple_rsync.sh [deleted file]
qa/workunits/misc/trivial_sync.sh [deleted file]
qa/workunits/misc/xattrs.sh [deleted file]

diff --git a/qa/workunits/fs/misc/chmod.sh b/qa/workunits/fs/misc/chmod.sh
new file mode 100755 (executable)
index 0000000..dd0552d
--- /dev/null
@@ -0,0 +1,58 @@
+#!/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}'); then
+               echo "ERROR: Permissions should be ${perms}"
+               exit 1
+       fi
+}
+
+file=test_chmod.$$
+
+echo "foo" > ${file}
+if test $? != 0; then
+       echo "ERROR: Failed to create file ${file}"
+       exit 1
+fi
+
+chmod 400 ${file}
+if test $? != 0; then
+       echo "ERROR: Failed to change mode of ${file}"
+       exit 1
+fi
+
+check_perms ${file} "-r--------"
+
+set +e
+echo "bar" >> ${file}
+if test $? = 0; then
+       echo "ERROR: Write to read-only file should Fail"
+       exit 1
+fi
+
+set -e
+chmod 600 ${file}
+echo "bar" >> ${file}
+if test $? != 0; then
+       echo "ERROR: Write to writeable file failed"
+       exit 1
+fi
+
+check_perms ${file} "-rw-------"
+
+echo "foo" >> ${file}
+if test $? != 0; then
+       echo "ERROR: Failed to write to file"
+       exit 1
+fi
diff --git a/qa/workunits/fs/misc/dirfrag.sh b/qa/workunits/fs/misc/dirfrag.sh
new file mode 100755 (executable)
index 0000000..3936674
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/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 testdir
+cd testdir
+
+for i in `seq 1 $DEPTH`; do
+  mkdir dir$i
+  cd dir$i
+  create_files &
+done
+wait
+
+for i in `seq 1 $DEPTH`; do
+  delete_files &
+  cd ..
+done
+wait
+
+cd ..
+rm -rf testdir
diff --git a/qa/workunits/fs/misc/i_complete_vs_rename.sh b/qa/workunits/fs/misc/i_complete_vs_rename.sh
new file mode 100755 (executable)
index 0000000..a9b9827
--- /dev/null
@@ -0,0 +1,31 @@
+#!/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 dentry...
+touch ../xx
+mv ../xx e
+ls | grep e || false
+echo rename over negative dentry is ok
+
+echo OK
diff --git a/qa/workunits/fs/misc/layout_vxattrs.sh b/qa/workunits/fs/misc/layout_vxattrs.sh
new file mode 100755 (executable)
index 0000000..e6c7c65
--- /dev/null
@@ -0,0 +1,85 @@
+#!/bin/bash -x
+
+set -e
+
+# file
+rm -f file file2
+touch file file2
+
+getfattr -d -m - file | grep -q ceph.file.layout
+getfattr -d -m - file | grep -q ceph.file.layout.pool   && exit 1 || true
+
+getfattr -n ceph.file.layout file
+getfattr -n ceph.file.layout file | grep -q object_size=
+getfattr -n ceph.file.layout file | grep -q stripe_count=
+getfattr -n ceph.file.layout file | grep -q stripe_unit=
+getfattr -n ceph.file.layout file | grep -q pool=
+getfattr -n ceph.file.layout.pool file
+getfattr -n ceph.file.layout.stripe_unit file
+getfattr -n ceph.file.layout.stripe_count file
+getfattr -n ceph.file.layout.object_size file
+
+getfattr -n ceph.file.layout.bogus file   2>&1 | grep -q 'No such attribute'
+getfattr -n ceph.dir.layout file    2>&1 | grep -q 'No such attribute'
+
+setfattr -n ceph.file.layout.stripe_unit -v 1048576 file2
+setfattr -n ceph.file.layout.stripe_count -v 8 file2
+setfattr -n ceph.file.layout.object_size -v 10485760 file2
+setfattr -n ceph.file.layout.pool -v data file2
+setfattr -n ceph.file.layout.pool -v 0 file2
+getfattr -n ceph.file.layout.pool file2 | grep -q data
+getfattr -n ceph.file.layout.stripe_unit file2 | grep -q 1048576
+getfattr -n ceph.file.layout.stripe_count file2 | grep -q 8
+getfattr -n ceph.file.layout.object_size file2 | grep -q 10485760
+
+setfattr -n ceph.file.layout -v "stripe_unit=4194304 stripe_count=16 object_size=41943040 pool=data" file2
+getfattr -n ceph.file.layout.stripe_unit file2 | grep -q 4194304
+getfattr -n ceph.file.layout.stripe_count file2 | grep -q 16
+getfattr -n ceph.file.layout.object_size file2 | grep -q 41943040
+getfattr -n ceph.file.layout.pool file2 | grep -q data
+
+setfattr -n ceph.file.layout -v "stripe_unit=1048576" file2
+getfattr -n ceph.file.layout.stripe_unit file2 | grep -q 1048576
+getfattr -n ceph.file.layout.stripe_count file2 | grep -q 16
+getfattr -n ceph.file.layout.object_size file2 | grep -q 41943040
+getfattr -n ceph.file.layout.pool file2 | grep -q data
+
+# dir
+rm -f dir/file || true
+rmdir dir || true
+mkdir -p dir
+
+getfattr -d -m - dir | grep -q ceph.dir.layout       && exit 1 || true
+getfattr -d -m - dir | grep -q ceph.file.layout      && exit 1 || true
+
+setfattr -n ceph.dir.layout.stripe_unit -v 1048576 dir
+setfattr -n ceph.dir.layout.stripe_count -v 8 dir
+setfattr -n ceph.dir.layout.object_size -v 10485760 dir
+setfattr -n ceph.dir.layout.pool -v data dir
+setfattr -n ceph.dir.layout.pool -v 0 dir
+getfattr -n ceph.dir.layout dir
+getfattr -n ceph.dir.layout dir | grep -q object_size=10485760
+getfattr -n ceph.dir.layout dir | grep -q stripe_count=8
+getfattr -n ceph.dir.layout dir | grep -q stripe_unit=1048576
+getfattr -n ceph.dir.layout dir | grep -q pool=data
+getfattr -n ceph.dir.layout.pool dir | grep -q data
+getfattr -n ceph.dir.layout.stripe_unit dir | grep -q 1048576
+getfattr -n ceph.dir.layout.stripe_count dir | grep -q 8
+getfattr -n ceph.dir.layout.object_size dir | grep -q 10485760
+
+setfattr -n ceph.file.layout -v "stripe_count=16" file2
+getfattr -n ceph.file.layout.stripe_count file2 | grep -q 16
+setfattr -n ceph.file.layout -v "object_size=10485760 stripe_count=8 stripe_unit=1048576 pool=data" file2
+getfattr -n ceph.file.layout.stripe_count file2 | grep -q 8
+
+touch dir/file
+getfattr -n ceph.file.layout.pool dir/file | grep -q data
+getfattr -n ceph.file.layout.stripe_unit dir/file | grep -q 1048576
+getfattr -n ceph.file.layout.stripe_count dir/file | grep -q 8
+getfattr -n ceph.file.layout.object_size dir/file | grep -q 10485760
+
+setfattr -x ceph.dir.layout dir
+getfattr -n ceph.dir.layout dir     2>&1 | grep -q 'No such attribute'
+
+echo OK
+
diff --git a/qa/workunits/fs/misc/mkpool_layout_vxattrs.sh b/qa/workunits/fs/misc/mkpool_layout_vxattrs.sh
new file mode 100755 (executable)
index 0000000..91d3166
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+
+touch foo.$$
+rados mkpool foo.$$
+ceph mds add_data_pool foo.$$
+setfattr -n ceph.file.layout.pool -v foo.$$ foo.$$
+
+# cleanup
+rm foo.$$
+ceph mds remove_data_pool foo.$$
+rados rmpool foo.$$ foo.$$ --yes-i-really-really-mean-it
+
+echo OK
diff --git a/qa/workunits/fs/misc/multiple_rsync.sh b/qa/workunits/fs/misc/multiple_rsync.sh
new file mode 100755 (executable)
index 0000000..089db63
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh -ex
+
+rsync -av --exclude local/ /usr/ usr.1
+rsync -av --exclude local/ /usr/ usr.2
+
+# this shouldn't transfer any additional files
+echo we should get 4 here if no additional files are transfered
+rsync -auv --exclude local/ /usr/ usr.1 | tee /tmp/$$
+hexdump -C /tmp/$$
+wc -l /tmp/$$ | grep 4
+rsync -auv --exclude local/ /usr/ usr.2 | tee /tmp/$$
+hexdump -C /tmp/$$
+wc -l /tmp/$$ | grep 4
+rm /tmp/$$
+
+echo OK
\ No newline at end of file
diff --git a/qa/workunits/fs/misc/trivial_sync.sh b/qa/workunits/fs/misc/trivial_sync.sh
new file mode 100755 (executable)
index 0000000..68e4072
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+mkdir foo
+echo foo > bar
+sync
diff --git a/qa/workunits/fs/misc/xattrs.sh b/qa/workunits/fs/misc/xattrs.sh
new file mode 100755 (executable)
index 0000000..ec78bf2
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh -x
+
+set -e
+
+touch file
+
+setfattr -n user.bare -v bare file
+setfattr -n user.bar -v bar file
+getfattr -d file | grep bare
+
+echo OK.
diff --git a/qa/workunits/misc/chmod.sh b/qa/workunits/misc/chmod.sh
deleted file mode 100755 (executable)
index dd0552d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/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}'); then
-               echo "ERROR: Permissions should be ${perms}"
-               exit 1
-       fi
-}
-
-file=test_chmod.$$
-
-echo "foo" > ${file}
-if test $? != 0; then
-       echo "ERROR: Failed to create file ${file}"
-       exit 1
-fi
-
-chmod 400 ${file}
-if test $? != 0; then
-       echo "ERROR: Failed to change mode of ${file}"
-       exit 1
-fi
-
-check_perms ${file} "-r--------"
-
-set +e
-echo "bar" >> ${file}
-if test $? = 0; then
-       echo "ERROR: Write to read-only file should Fail"
-       exit 1
-fi
-
-set -e
-chmod 600 ${file}
-echo "bar" >> ${file}
-if test $? != 0; then
-       echo "ERROR: Write to writeable file failed"
-       exit 1
-fi
-
-check_perms ${file} "-rw-------"
-
-echo "foo" >> ${file}
-if test $? != 0; then
-       echo "ERROR: Failed to write to file"
-       exit 1
-fi
diff --git a/qa/workunits/misc/dirfrag.sh b/qa/workunits/misc/dirfrag.sh
deleted file mode 100755 (executable)
index 3936674..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/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 testdir
-cd testdir
-
-for i in `seq 1 $DEPTH`; do
-  mkdir dir$i
-  cd dir$i
-  create_files &
-done
-wait
-
-for i in `seq 1 $DEPTH`; do
-  delete_files &
-  cd ..
-done
-wait
-
-cd ..
-rm -rf testdir
diff --git a/qa/workunits/misc/i_complete_vs_rename.sh b/qa/workunits/misc/i_complete_vs_rename.sh
deleted file mode 100755 (executable)
index a9b9827..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/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 dentry...
-touch ../xx
-mv ../xx e
-ls | grep e || false
-echo rename over negative dentry is ok
-
-echo OK
diff --git a/qa/workunits/misc/layout_vxattrs.sh b/qa/workunits/misc/layout_vxattrs.sh
deleted file mode 100755 (executable)
index e6c7c65..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash -x
-
-set -e
-
-# file
-rm -f file file2
-touch file file2
-
-getfattr -d -m - file | grep -q ceph.file.layout
-getfattr -d -m - file | grep -q ceph.file.layout.pool   && exit 1 || true
-
-getfattr -n ceph.file.layout file
-getfattr -n ceph.file.layout file | grep -q object_size=
-getfattr -n ceph.file.layout file | grep -q stripe_count=
-getfattr -n ceph.file.layout file | grep -q stripe_unit=
-getfattr -n ceph.file.layout file | grep -q pool=
-getfattr -n ceph.file.layout.pool file
-getfattr -n ceph.file.layout.stripe_unit file
-getfattr -n ceph.file.layout.stripe_count file
-getfattr -n ceph.file.layout.object_size file
-
-getfattr -n ceph.file.layout.bogus file   2>&1 | grep -q 'No such attribute'
-getfattr -n ceph.dir.layout file    2>&1 | grep -q 'No such attribute'
-
-setfattr -n ceph.file.layout.stripe_unit -v 1048576 file2
-setfattr -n ceph.file.layout.stripe_count -v 8 file2
-setfattr -n ceph.file.layout.object_size -v 10485760 file2
-setfattr -n ceph.file.layout.pool -v data file2
-setfattr -n ceph.file.layout.pool -v 0 file2
-getfattr -n ceph.file.layout.pool file2 | grep -q data
-getfattr -n ceph.file.layout.stripe_unit file2 | grep -q 1048576
-getfattr -n ceph.file.layout.stripe_count file2 | grep -q 8
-getfattr -n ceph.file.layout.object_size file2 | grep -q 10485760
-
-setfattr -n ceph.file.layout -v "stripe_unit=4194304 stripe_count=16 object_size=41943040 pool=data" file2
-getfattr -n ceph.file.layout.stripe_unit file2 | grep -q 4194304
-getfattr -n ceph.file.layout.stripe_count file2 | grep -q 16
-getfattr -n ceph.file.layout.object_size file2 | grep -q 41943040
-getfattr -n ceph.file.layout.pool file2 | grep -q data
-
-setfattr -n ceph.file.layout -v "stripe_unit=1048576" file2
-getfattr -n ceph.file.layout.stripe_unit file2 | grep -q 1048576
-getfattr -n ceph.file.layout.stripe_count file2 | grep -q 16
-getfattr -n ceph.file.layout.object_size file2 | grep -q 41943040
-getfattr -n ceph.file.layout.pool file2 | grep -q data
-
-# dir
-rm -f dir/file || true
-rmdir dir || true
-mkdir -p dir
-
-getfattr -d -m - dir | grep -q ceph.dir.layout       && exit 1 || true
-getfattr -d -m - dir | grep -q ceph.file.layout      && exit 1 || true
-
-setfattr -n ceph.dir.layout.stripe_unit -v 1048576 dir
-setfattr -n ceph.dir.layout.stripe_count -v 8 dir
-setfattr -n ceph.dir.layout.object_size -v 10485760 dir
-setfattr -n ceph.dir.layout.pool -v data dir
-setfattr -n ceph.dir.layout.pool -v 0 dir
-getfattr -n ceph.dir.layout dir
-getfattr -n ceph.dir.layout dir | grep -q object_size=10485760
-getfattr -n ceph.dir.layout dir | grep -q stripe_count=8
-getfattr -n ceph.dir.layout dir | grep -q stripe_unit=1048576
-getfattr -n ceph.dir.layout dir | grep -q pool=data
-getfattr -n ceph.dir.layout.pool dir | grep -q data
-getfattr -n ceph.dir.layout.stripe_unit dir | grep -q 1048576
-getfattr -n ceph.dir.layout.stripe_count dir | grep -q 8
-getfattr -n ceph.dir.layout.object_size dir | grep -q 10485760
-
-setfattr -n ceph.file.layout -v "stripe_count=16" file2
-getfattr -n ceph.file.layout.stripe_count file2 | grep -q 16
-setfattr -n ceph.file.layout -v "object_size=10485760 stripe_count=8 stripe_unit=1048576 pool=data" file2
-getfattr -n ceph.file.layout.stripe_count file2 | grep -q 8
-
-touch dir/file
-getfattr -n ceph.file.layout.pool dir/file | grep -q data
-getfattr -n ceph.file.layout.stripe_unit dir/file | grep -q 1048576
-getfattr -n ceph.file.layout.stripe_count dir/file | grep -q 8
-getfattr -n ceph.file.layout.object_size dir/file | grep -q 10485760
-
-setfattr -x ceph.dir.layout dir
-getfattr -n ceph.dir.layout dir     2>&1 | grep -q 'No such attribute'
-
-echo OK
-
diff --git a/qa/workunits/misc/mkpool_layout_vxattrs.sh b/qa/workunits/misc/mkpool_layout_vxattrs.sh
deleted file mode 100755 (executable)
index 91d3166..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-set -e
-
-touch foo.$$
-rados mkpool foo.$$
-ceph mds add_data_pool foo.$$
-setfattr -n ceph.file.layout.pool -v foo.$$ foo.$$
-
-# cleanup
-rm foo.$$
-ceph mds remove_data_pool foo.$$
-rados rmpool foo.$$ foo.$$ --yes-i-really-really-mean-it
-
-echo OK
diff --git a/qa/workunits/misc/multiple_rsync.sh b/qa/workunits/misc/multiple_rsync.sh
deleted file mode 100755 (executable)
index 089db63..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh -ex
-
-rsync -av --exclude local/ /usr/ usr.1
-rsync -av --exclude local/ /usr/ usr.2
-
-# this shouldn't transfer any additional files
-echo we should get 4 here if no additional files are transfered
-rsync -auv --exclude local/ /usr/ usr.1 | tee /tmp/$$
-hexdump -C /tmp/$$
-wc -l /tmp/$$ | grep 4
-rsync -auv --exclude local/ /usr/ usr.2 | tee /tmp/$$
-hexdump -C /tmp/$$
-wc -l /tmp/$$ | grep 4
-rm /tmp/$$
-
-echo OK
\ No newline at end of file
diff --git a/qa/workunits/misc/trivial_sync.sh b/qa/workunits/misc/trivial_sync.sh
deleted file mode 100755 (executable)
index 68e4072..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-set -e
-
-mkdir foo
-echo foo > bar
-sync
diff --git a/qa/workunits/misc/xattrs.sh b/qa/workunits/misc/xattrs.sh
deleted file mode 100755 (executable)
index ec78bf2..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh -x
-
-set -e
-
-touch file
-
-setfattr -n user.bare -v bare file
-setfattr -n user.bar -v bar file
-getfattr -d file | grep bare
-
-echo OK.