New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/rados: add a parameter "--offset" to rados put command #12674

Merged
merged 1 commit into from Dec 27, 2016

Conversation

Projects
None yet
3 participants
@Liuchang0812
Contributor

Liuchang0812 commented Dec 27, 2016

ref to #8269 , I have rebased the code, add a test case for it.

build pass and test pass.

@majianpeng @yangdongsheng @tchaikov need review please 馃槃

{
# rados put test:
# replicated pool
$CEPH_TOOL osd pool create rados_put 100 100 replicated

This comment has been minimized.

@tchaikov

tchaikov Dec 27, 2016

Contributor

why not just use $POOL, which is already created in this test? if we do the cleanup right, there is no need to create another pool just for this test.

This comment has been minimized.

@Liuchang0812

Liuchang0812 Dec 27, 2016

Contributor

ok, i saw that test_append creates a new pool, I will try to fix those comments. Very thanks!

$RADOS_TOOL -p rados_put put rados_put_obj ./rados_object_1k
$RADOS_TOOL -p rados_put get rados_put_obj ./rados_object_1k_out
diff ./rados_object_1k ./rados_object_1k_out > /dev/null
if [ $? == 0 ]; then

This comment has been minimized.

@tchaikov

tchaikov Dec 27, 2016

Contributor

no need to check the return value explicitly. we have set -e at line 269.

# test put command
$RADOS_TOOL -p rados_put put rados_put_obj ./rados_object_1k
$RADOS_TOOL -p rados_put get rados_put_obj ./rados_object_1k_out
diff ./rados_object_1k ./rados_object_1k_out > /dev/null

This comment has been minimized.

@tchaikov

tchaikov Dec 27, 2016

Contributor

might want to use cmp to compare binary files.

# test put command with offset 100
$RADOS_TOOL -p rados_put put rados_put_obj_offset_100 ./rados_object_1k --offset 100
$RADOS_TOOL -p rados_put get rados_put_obj_offset_100 ./rados_object_offset_100_out
dd if=rados_object_1k seek=100 bs=1c of=rados_object_offset_100_local > /dev/null

This comment has been minimized.

@tchaikov

tchaikov Dec 27, 2016

Contributor

better off using cmp which allows us to specify the bytes to skip for FILE1 and FILE2 separately.

fi
$CEPH_TOOL osd pool delete rados_put rados_put --yes-i-really-really-mean-it
rm -rf ./rados_object_1k ./rados_object_1k_out ./rados_object_offset_0_out ./rados_object_offset_100_out

This comment has been minimized.

@tchaikov

tchaikov Dec 27, 2016

Contributor

could also reuse $OBJ and cleanup to perform this test.

@Liuchang0812

This comment has been minimized.

Contributor

Liuchang0812 commented Dec 27, 2016

@tchaikov I fix those comments. I would like to fix similar problems in test_append/omap in another PR.

tools/rados: add parameter offset for put cmd and test case for it
add a parameter "--offset" for put command
add a test case for rados put command

Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
@Liuchang0812

This comment has been minimized.

Contributor

Liuchang0812 commented Dec 27, 2016

fixed test error

@tchaikov tchaikov added the needs-qa label Dec 27, 2016

@liewegas liewegas merged commit 2e1a096 into ceph:master Dec 27, 2016

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment