Project

General

Profile

Actions

Bug #2862

closed

CLI: rbd create command throws inappropriate error messages

Added by Tamilarasi muthamizhan over 11 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Q/A
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Ceph Version: 0.48

When tried a few negative test cases using "rbd create command", found that the command displayed inappropriate error messages.

1. Creating a RBD image with size=-1 creates RBD image with size 15 EB.

ubuntu@burnupi64:~$ rbd create rbd/rbd_img1 --size -1
ubuntu@burnupi64:~$ rbd info rbd_img1
rbd image 'rbd_img1':
size 15 EB in 4398046511103 objects
order 22 (4096 KB objects)
block_name_prefix: rb.0.6
parent: (pool -1)

Expected output: Error message "invalid value for size" should be displayed

2. Create RBD image with order=0 creates a RBD image with default order 22.

ubuntu@burnupi64:~$ rbd create rbd/rbd_img3 --size 10 --order 0
ubuntu@burnupi64:~$ rbd info rbd_img3
rbd image 'rbd_img3':
size 10240 KB in 2 objects
order 22 (4096 KB objects)
block_name_prefix: rb.0.8
parent: (pool -1)

Expected Output: Error message should be displayed "order must be between 12 (4 KB) and 25 (32 MB)"

3. Creating a RBD image with no value for size followed by image name throws inappropriate error message

ubuntu@burnupi64:~$ rbd create --size --image rbd_10
strict_strtoll: expected integer, got: '--image'

Expected Output: Error message displayed should be "Option --size requires an argument".

NOTE: Please note that this error message is displayed only when the order of the parameters is changed. The following command returns expected output.

ubuntu@burnupi64:~$ rbd create --image rbd_img4 --size
Option --size requires an argument.

4. Creating a rbd image with invalid values for "size" parameter throws inappropriate error message.

ubuntu@burnupi64:~$ rbd create rbd/img_abc --size 10g
strict_strtoll: garbage at end of string. got: '10g'
ubuntu@burnupi64:~$ rbd create rbd/img_abc --size 10.12
strict_strtoll: garbage at end of string. got: '10.12'
ubuntu@burnupi64:~$ rbd create rbd/img_abc --size 10#@#
strict_strtoll: garbage at end of string. got: '10#
@#'

Expected Output: Error message displayed should be "Invalid value for option size"

5. Create RBD image with a huge value for size reports error as mentioned below,
ubuntu@burnupi64:~$ rbd create rbd/rbd_img2 --size 10240000000000000000
strict_strtoll: integer underflow or overflow parsing '10240000000000000000'

Expected output: Error message displayed should be appropriate.

Actions #1

Updated by Sage Weil about 11 years ago

  • Project changed from Ceph to rbd
Actions #2

Updated by Sage Weil over 10 years ago

  • Assignee set to Tamilarasi muthamizhan
Actions #3

Updated by Tamilarasi muthamizhan over 10 years ago

  • Assignee changed from Tamilarasi muthamizhan to Josh Durgin

all the test cases mentioned in the bug except the first one still behaves in the same manner, when tested on dumpling [v0.69]

assigining back to Josh to fix these issues

Actions #4

Updated by Josh Durgin about 9 years ago

  • Assignee deleted (Josh Durgin)
Actions #5

Updated by Josh Durgin about 9 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF