Skip to content
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

liuchang0812
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@liuchang0812
Copy link
Contributor Author

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

add a parameter "--offset" for put command
add a test case for rados put command

Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
@liuchang0812
Copy link
Contributor Author

fixed test error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants