@rbd Feature: Manipulate file images in ceph in order to manipulate file images in ceph as a command line user I want to retrieve the uri via an optional cache and copy correctly to target in the right format background: given an empty directory named "/tmp/uricp" and the default aruba timeout is 15 seconds Scenario: HTTP URI qcow2 to rbd - no cache When I successfully run `uricp --dry-run http://orbit.brightbox.com/v1/acc-tqs4c/downloads/freedos.qcow2 rbd:///servers/srv-testy` And the output should contain: """ rbd import --no-progress --id libvirt - 'servers/srv-testy' """ Scenario: HTTP URI qcow2 to raw via unpopulated rbd cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --target-format=raw --cache=/tmp/uricp http://orbit.brightbox.com/v1/acc-tqs4c/downloads/freedos.qcow2 rbd:///servers/srv-testy` And the output should contain: """ rbd import --no-progress --id libvirt - 'servers/freedos.qcow2' """ And the output should contain: """ rbd snap create --id libvirt 'servers/freedos.qcow2@base' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/freedos.qcow2@base' """ And the output should contain: """ rbd clone --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy' """ Scenario: HTTP URI from file cache via unpopulated rbd cache Given a correctly initialised cache at "/tmp/uricp" And a 102400 byte file named "/tmp/uricp/cache/freedos.qcow2" When I successfully run `uricp --dry-run --target-format=raw --cache=/tmp/uricp http://orbit.brightbox.com/v1/acc-tqs4c/downloads/freedos.qcow2 rbd:///servers/srv-testy` And the output should contain: """ rbd import --no-progress --id libvirt '/tmp/uricp/cache/freedos.qcow2' 'servers/freedos.qcow2' """ And the output should contain: """ rbd snap create --id libvirt 'servers/freedos.qcow2@base' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/freedos.qcow2@base' """ And the output should contain: """ rbd clone --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy' """ Scenario: HTTP URI to rbd via populated caches Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --dry-cache --target-format=raw --cache=/tmp/uricp http://orbit.brightbox.com/v1/acc-tqs4c/downloads/freedos.qcow2 rbd:///servers/srv-testy` And the output should not contain: """ snap create """ And the output should contain: """ rbd clone --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy' """ Scenario: rbd to rbd - no cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run rbd:///servers/img-testy rbd:///servers/srv-testy` And the output should contain: """ rbd snap create --id libvirt 'servers/img-testy@uricp_snap' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/img-testy@uricp_snap' """ And the output should not contain: """ rbd snap unprotect --id libvirt 'servers/img-testy@uricp_snap' """ And the output should not contain: """ rbd snap rm --id libvirt 'servers/img-testy@uricp_snap' """ And the output should contain: """ rbd clone --id libvirt 'servers/img-testy@uricp_snap' 'servers/srv-testy' """ Scenario: rbd to rbd - unpopulated cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --cache=/tmp/uricp rbd:///servers/srv-testy rbd:///servers/img-testy` And the output should contain: """ rbd snap create --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should not contain: """ rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should not contain: """ rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should not contain: """ rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' - """ And the output should contain: """ rbd clone --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy' """ And the output should not contain: """ rbd export --no-progress --id libvirt 'servers/img-testy@base' - """ And the output should contain: """ rbd snap create --id libvirt 'servers/img-testy@base' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/img-testy@base' """ Scenario: rbd to rbd - populated cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --dry-cache --cache=/tmp/uricp rbd:///servers/img-testy rbd:///servers/srv-testy` And the output should not contain: """ snap create """ And the output should contain: """ rbd clone --id libvirt 'servers/img-testy@base' 'servers/srv-testy' """ Scenario: RBD export. Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --compress rbd:///servers/srv-testy file:///tmp/img-testy` And the output should contain: """ rbd snap create --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should contain: """ rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should contain: """ rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should contain: """ rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' - """ Scenario: RBD export with cacheing - populated cache Given a correctly initialised cache at "/tmp/uricp" When I run `uricp --dry-run --dry-cache --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy` Then the exit status should be 70 And the output should contain: """ Unsupported transfer """ Scenario: RBD export with cacheing - empty cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy` And the output should contain: """ rbd snap create --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should not contain: """ rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should not contain: """ rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap' """ And the output should not contain: """ rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' - """ And the output should contain: """ rbd clone --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy' """ And the output should contain: """ rbd export --no-progress --id libvirt 'servers/img-testy@base' - """ And the output should contain: """ rbd snap create --id libvirt 'servers/img-testy@base' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/img-testy@base' """