@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' || { [ $? -eq 22 ] && rbd create --id libvirt -s 0 '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 partial rbd caches Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --dry-cache=partial_rbd --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 import --no-progress --id libvirt - 'servers/srv-testy' """ Scenario: HTTP URI to rbd via populated cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --dry-cache=rbd --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: file URI to rbd via cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --target-format 'raw' --cache '/tmp/uricp' --max-cache '1073741824B' 'file:///dev/servers/srv-testy-vol_frozen' 'rbd:/servers/srv-testy-vol'` And the output should contain: """ rbd import --no-progress --id libvirt - <'/dev/servers/srv-testy-vol_frozen' 'servers/srv-testy-vol' """ And the output should not contain: """ snap create """ And the output should not contain: """ snap protect """ And the output should not contain: """ rbd clone """ 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 - partial cache Given a correctly initialised cache at "/tmp/uricp" When I run `uricp --dry-run --dry-cache=partial_rbd --cache=/tmp/uricp rbd:///servers/srv-testy rbd:///servers/img-testy` Then the exit status should be 70 And the output should contain: """ Unsupported transfer """ Scenario: rbd to rbd - populated cache Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --dry-cache=rbd --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=rbd --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 - partial cache Given a correctly initialised cache at "/tmp/uricp" When I run `uricp --dry-run --dry-cache=partial_rbd --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' """ Scenario: RBD export and upload to HTTPS Given a correctly initialised cache at "/tmp/uricp" When I successfully run `uricp --dry-run --auth-token 'd75945e3b9159f1f14e91b2022bc53ea10481ed15e4a' --target-format 'raw' --compress --segment-size '1073741824B' --cache '/var/cache/domtrix' rbd:/servers/vol-yd63x https://orbit.gb1s.brightbox.com/v1/acc-8tgbq/images/img-cfwe0` And the output should contain: """ rbd snap create --id libvirt 'servers/vol-yd63x@uricp_snap' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/vol-yd63x@uricp_snap' """ And the output should not contain: """ rbd snap unprotect --id libvirt 'servers/vol-yd63x@uricp_snap' """ And the output should not contain: """ rbd snap rm --id libvirt 'servers/vol-yd63x@uricp_snap' """ And the output should not contain: """ rbd export --no-progress --id libvirt 'servers/vol-yd63x@uricp_snap' - """ And the output should contain: """ rbd clone --id libvirt 'servers/vol-yd63x@uricp_snap' 'servers/img-cfwe0' """ And the output should contain: """ rbd export --no-progress --id libvirt 'servers/img-cfwe0@base' - """ And the output should contain: """ rbd snap create --id libvirt 'servers/img-cfwe0@base' """ And the output should contain: """ rbd snap protect --id libvirt 'servers/img-cfwe0@base' """ And the output should contain: """ rbd export --no-progress --id libvirt 'servers/img-cfwe0@base' - """ And the output should contain: """ lz4 """ And the output should contain: """ segment_upload --segment-size '1073741824.00 B' https://orbit.gb1s.brightbox.com/v1/acc-8tgbq/images/img-cfwe0 """