#!/bin/bash die() { echo "$@" exit 1 } usage() { cat < $V1 expect_false $RADOS_TOOL -p $POOL setxattr $OBJ 2>/dev/null expect_false $RADOS_TOOL -p $POOL setxattr $OBJ foo fooval extraarg 2>/dev/null $RADOS_TOOL -p $POOL setxattr $OBJ foo fooval $RADOS_TOOL -p $POOL getxattr $OBJ foo > $V2 cmp $V1 $V2 cat $V1 | $RADOS_TOOL -p $POOL setxattr $OBJ bar $RADOS_TOOL -p $POOL getxattr $OBJ bar > $V2 cmp $V1 $V2 $RADOS_TOOL -p $POOL listxattr $OBJ > $V1 grep -q foo $V1 grep -q bar $V1 wc -l $V1 | grep -q "^2 " rm $V1 $V2 cleanup } test_rmobj() { p=`uuidgen` ceph osd pool create $p 1 ceph osd pool set-quota $p max_objects 1 V1=`mktemp fooattrXXXXXXX` rados put $OBJ $V1 -p $p while ! ceph osd dump | grep 'full max_objects' do sleep 2 done rados -p $p rm $OBJ --force-full rados rmpool $p $p --yes-i-really-really-mean-it rm $V1 } test_xattr test_omap test_rmobj echo "SUCCESS!" exit 0