ceph/qa/workunits/rados/test_pool_access.sh
Alan Somers 3aae5ca6fd scripts: fix bash path in shebangs
/bin/bash is a Linuxism.  Other operating systems install bash to
different paths.  Use /usr/bin/env in shebangs to find bash.

Signed-off-by: Alan Somers <asomers@gmail.com>
2017-07-27 13:24:26 -06:00

24 lines
552 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
expect_1()
{
set -x
set +e
"$@"
if [ $? == 1 ]; then return 0; else return 1; fi
}
key=`ceph auth get-or-create-key client.poolaccess1 mon 'allow r' osd 'allow *'`
rados --id poolaccess1 --key $key -p rbd ls
key=`ceph auth get-or-create-key client.poolaccess2 mon 'allow r' osd 'allow * pool=nopool'`
expect_1 rados --id poolaccess2 --key $key -p rbd ls
key=`ceph auth get-or-create-key client.poolaccess3 mon 'allow r' osd 'allow rw pool=nopool'`
expect_1 rados --id poolaccess3 --key $key -p rbd ls
echo OK