From: Josh Durgin Date: Fri, 21 Oct 2011 20:28:30 +0000 (-0700) Subject: clitests: add rbd usage and invalid snap usage tests X-Git-Tag: v0.38~57^2~3^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e2296c3a3cf299e736ae3681ec0d81eaaa983cf8;p=ceph.git clitests: add rbd usage and invalid snap usage tests Signed-off-by: Josh Durgin --- diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t new file mode 100644 index 000000000000..6c86e7ea6f2a --- /dev/null +++ b/src/test/cli/rbd/help.t @@ -0,0 +1,38 @@ + $ rbd --help + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx diff --git a/src/test/cli/rbd/invalid-snap-usage.t b/src/test/cli/rbd/invalid-snap-usage.t new file mode 100644 index 000000000000..c97d6cb2e2be --- /dev/null +++ b/src/test/cli/rbd/invalid-snap-usage.t @@ -0,0 +1,360 @@ + $ rbd resize --snap=snap1 img + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd resize img@snap + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd import --snap=snap1 /bin/ls ls + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd create --snap=snap img + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd rm --snap=snap img + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd rename --snap=snap img + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd ls --snap=snap rbd + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd snap ls --snap=snap img + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1] + $ rbd watch --snap=snap img + error: snapname specified for a command that doesn't use it + usage: rbd [-n ] [OPTIONS] ... + where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of: + [pool-name] list rbd images + info <--snap=name> [image-name] show information about image size, + striping, etc. + create [image-name] create an empty image (requires size + param) + resize [image-name] resize (expand or contract) image + (requires size param) + rm [image-name] delete an image + export <--snap=name> [image-name] [path] export image to file + import [path] [dst-image] import image from file (dest defaults + as the filename part of file) + <--snap=name> [src] [dest] copy src image to dest + [src] [dest] rename src image to dest + snap ls [image-name] dump list of image snapshots + snap create <--snap=name> [image-name] create a snapshot + snap rollback <--snap=name> [image-name] rollback image head to snapshot + snap rm <--snap=name> [image-name] deletes a snapshot + watch [image-name] watch events on image + map [image-name] map the image to a block device + using the kernel + unmap [device] unmap a rbd device that was + mapped by the kernel + + Other input options: + -p, --pool source pool name + --image image name + --dest destination [pool and] image name + --snap specify snapshot name + --dest-pool destination pool name + --path path name for import/export (if not specified) + --size size parameter for create and resize commands + + For the map command: + --user rados user to authenticate as + --secret file containing secret key for use with authx + [1]