From 67710a65c7cd1173c73c40241572d615dd7da1f3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 13 Jun 2012 11:24:19 -0700 Subject: [PATCH] rbd: fix usage test Fixes: #2347 Signed-off-by: Sage Weil --- src/rbd.cc | 46 +-- src/test/cli/rbd/help.t | 46 +-- src/test/cli/rbd/invalid-snap-usage.t | 414 +++++++++++++------------- 3 files changed, 253 insertions(+), 253 deletions(-) diff --git a/src/rbd.cc b/src/rbd.cc index 17a4bbae47617..f87a30245deb5 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -64,29 +64,29 @@ void usage() { cout << "usage: rbd [-n ] [OPTIONS] ...\n" << "where 'pool' is a rados pool name (default is 'rbd') and 'cmd' is one of:\n" - << " [pool-name] list rbd images\n" - << " info <--snap=name> [image-name] show information about image size,\n" - << " striping, etc.\n" - << " create <--order=bits> [--size MB] [name] create an empty image\n" - << " resize [--size MB] [image-name] resize (expand or contract) image\n" - << " rm [image-name] delete an image\n" - << " export <--snap=name> [image-name] [path] export image to file\n" - << " import [path] [dst-image] import image from file (dest defaults\n" - << " as the filename part of file)\n" - << " <--snap=name> [src] [dest] copy src image to dest\n" - << " [src] [dest] rename src image to dest\n" - << " snap ls [image-name] dump list of image snapshots\n" - << " snap create <--snap=name> [image-name] create a snapshot\n" - << " snap rollback <--snap=name> [image-name] rollback image head to snapshot\n" - << " snap rm <--snap=name> [image-name] deletes a snapshot\n" - << " snap purge [image-name] deletes all snapshots\n" - << " watch [image-name] watch events on image\n" - << " map [image-name] map the image to a block device\n" - << " using the kernel\n" - << " unmap [device] unmap a rbd device that was\n" - << " mapped by the kernel\n" - << " showmapped show the rbd images mapped\n" - << " by the kernel\n" + << " (ls | list) [pool-name] list rbd images\n" + << " info [--snap ] show information about image size,\n" + << " striping, etc.\n" + << " create [--order ] --size create an empty image\n" + << " resize --size resize (expand or contract) image\n" + << " rm delete an image\n" + << " export [--snap ] export image to file\n" + << " import import image from file (dest defaults\n" + << " as the filename part of file)\n" + << " (cp | copy) [--snap ] copy src image to dest\n" + << " (mv | rename) rename src image to dest\n" + << " snap ls dump list of image snapshots\n" + << " snap create --snap create a snapshot\n" + << " snap rollback --snap rollback image head to snapshot\n" + << " snap rm --snap deletes a snapshot\n" + << " snap purge deletes all snapshots\n" + << " watch watch events on image\n" + << " map map the image to a block device\n" + << " using the kernel\n" + << " unmap unmap a rbd device that was\n" + << " mapped by the kernel\n" + << " showmapped show the rbd images mapped\n" + << " by the kernel\n" << "\n" << "Other input options:\n" << " -p, --pool source pool name\n" diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t index 3c804457b97b3..3c916f1659632 100644 --- a/src/test/cli/rbd/help.t +++ b/src/test/cli/rbd/help.t @@ -1,29 +1,29 @@ $ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name diff --git a/src/test/cli/rbd/invalid-snap-usage.t b/src/test/cli/rbd/invalid-snap-usage.t index 771e4c2fd2b52..678b0ba3757a8 100644 --- a/src/test/cli/rbd/invalid-snap-usage.t +++ b/src/test/cli/rbd/invalid-snap-usage.t @@ -2,29 +2,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -45,29 +45,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -88,29 +88,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -131,29 +131,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -174,29 +174,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -217,29 +217,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -260,29 +260,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -303,29 +303,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name @@ -346,29 +346,29 @@ 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 <--order=bits> [--size MB] [name] create an empty image - resize [--size MB] [image-name] resize (expand or contract) image - 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 - snap purge [image-name] deletes all snapshots - 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 - showmapped show the rbd images mapped - by the kernel + (ls | list) [pool-name] list rbd images + info [--snap ] show information about image size, + striping, etc. + create [--order ] --size create an empty image + resize --size resize (expand or contract) image + rm delete an image + export [--snap ] export image to file + import import image from file (dest defaults + as the filename part of file) + (cp | copy) [--snap ] copy src image to dest + (mv | rename) rename src image to dest + snap ls dump list of image snapshots + snap create --snap create a snapshot + snap rollback --snap rollback image head to snapshot + snap rm --snap deletes a snapshot + snap purge deletes all snapshots + watch watch events on image + map map the image to a block device + using the kernel + unmap unmap a rbd device that was + mapped by the kernel + showmapped show the rbd images mapped + by the kernel Other input options: -p, --pool source pool name -- 2.39.5