qa/workunits/rados: test cache-{flush,evict,flush-evict-all}

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2013-12-10 09:57:57 -08:00
parent 71cd4a2278
commit ea519b48c0

34
qa/workunits/rados/caching_redirects.sh Executable file → Normal file
View File

@ -78,4 +78,36 @@ expect_false rados -p base_pool get bazobj tmp.txt
rados -p empty_cache ls > tmp.txt
expect_false diff -q tmp.txt empty.txt
rados -p base_pool ls > tmp2.txt
diff -q tmp.txt tmp2.txt
diff -q tmp.txt tmp2.txt
## set of base, cache
ceph osd pool create base 8
ceph osd pool create cache 8
ceph osd tier add base cache
ceph osd tier cache-mode cache writeback
ceph osd tier set-overlay base cache
# cache-flush, cache-evict
rados -p base put foo /etc/passwd
expect_false rados -p base cache-evict foo
rados -p base cache-flush foo
rados -p base cache-evict foo
rados -p cache ls - | wc -l | grep 0
# cache-flush-evict-all
rados -p base put bar /etc/passwd
rados -p cache ls - | wc -l | grep 1
rados -p base cache-flush-evict-all
rados -p cache ls - | wc -l | grep 0
# cleanup
ceph osd tier remove-overlay base
ceph osd tier cache-mode cache none
ceph osd tier remove base cache
ceph osd pool delete cache cache --yes-i-really-really-mean-it
ceph osd pool delete cache base --yes-i-really-really-mean-it
echo OK