@orbit @orbitdownloads @new-qemu-image Feature: Authenticated download of images from orbit In order to download images from orbit 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 And a container called "test" Scenario: qcow download no conversion, no cache When I retrieve "img-qcow2" from container "test" into "file:///tmp/uricp/srv-test1" Then a file named "/tmp/uricp/srv-test1" should exist And the file named "/tmp/uricp/srv-test1" should have a file format of "qcow2v3" Scenario: lz4 download no conversion, no cache When I retrieve "img-lz4cy" from container "test" into "file:///tmp/uricp/srv-test2" Then a file named "/tmp/uricp/srv-test2" should exist And the file named "/tmp/uricp/srv-test2" should have a file format of "lz4" Scenario: qcow download no conversion, cache Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-qcow2" with options "--cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test3" Then a file named "/tmp/uricp/srv-test3" should exist And the file named "/tmp/uricp/srv-test3" should have a file format of "qcow2v3" And a file named "/tmp/uricp/cache/img-qcow2" should exist And the file named "/tmp/uricp/cache/img-qcow2" should have a file format of "qcow2v3" Scenario: zero download convert to qcow2, cache Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-zeroy" with options "--target-format=qcow2 --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-testz" Then a file named "/tmp/uricp/srv-testz" should exist And the file named "/tmp/uricp/srv-testz" should have a file format of "qcow2" And a 0 byte file named "/tmp/uricp/cache/img-zeroy" should exist And the file named "/tmp/uricp/cache/img-zeroy" should have a file format of "raw" Scenario: qcow download convert to raw, cache Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-qcow2" with options "--target-format=raw --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test4" Then a file named "/tmp/uricp/srv-test4" should exist And the file named "/tmp/uricp/srv-test4" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-qcow2" should exist And the file named "/tmp/uricp/cache/img-qcow2" should have a file format of "qcow2v3" Scenario: qcow download convert to raw, cache, within size Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-qcow2" with options "--target-format=raw --cache=/tmp/uricp --max-cache 10MB" from container "test" into "file:///tmp/uricp/srv-testq" Then a file named "/tmp/uricp/srv-testq" should exist And the file named "/tmp/uricp/srv-testq" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-qcow2" should exist And the file named "/tmp/uricp/cache/img-qcow2" should have a file format of "qcow2v3" Scenario: qcow download convert to raw, cache, size limited Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-qcow2" with options "--target-format=raw --cache=/tmp/uricp --max-cache 100kB" from container "test" into "file:///tmp/uricp/srv-testj" Then a file named "/tmp/uricp/srv-testj" should exist And the file named "/tmp/uricp/srv-testj" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-qcow2" should not exist Scenario: qcow download convert to qcow2, cache Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-qcow2" with options "--target-format=qcow2 --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test5" Then a file named "/tmp/uricp/srv-test5" should exist And the file named "/tmp/uricp/srv-test5" should have a file format of "qcow2" And a file named "/tmp/uricp/cache/img-qcow2" should exist And the file named "/tmp/uricp/cache/img-qcow2" should have a file format of "qcow2v3" Scenario: qcow download no conversion, from cache Given a correctly initialised cache at "/tmp/uricp" And a cache of "img-qcow2" from container "test" at "/tmp/uricp" When I retrieve "img-qcow2" with options "--cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test6" Then a file named "/tmp/uricp/srv-test6" should exist And the file named "/tmp/uricp/srv-test6" should have a file format of "qcow2v3" And a file named "/tmp/uricp/cache/img-qcow2" should exist And the file named "/tmp/uricp/cache/img-qcow2" should have a file format of "qcow2v3" Scenario: qcow download convert to raw from cache Given a correctly initialised cache at "/tmp/uricp" And a cache of "img-qcow2" from container "test" at "/tmp/uricp" When I retrieve "img-qcow2" with options "--target-format=raw --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test7" Then a file named "/tmp/uricp/srv-test7" should exist And the file named "/tmp/uricp/srv-test7" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-qcow2" should exist And the file named "/tmp/uricp/cache/img-qcow2" should have a file format of "qcow2v3" Scenario: qcow download convert to qcow2 from cache Given a correctly initialised cache at "/tmp/uricp" And a cache of "img-qcow2" from container "test" at "/tmp/uricp" When I retrieve "img-qcow2" with options "--target-format=qcow2 --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test8" Then a file named "/tmp/uricp/srv-test8" should exist And the file named "/tmp/uricp/srv-test8" should have a file format of "qcow2" And a file named "/tmp/uricp/cache/img-qcow2" should exist And the file named "/tmp/uricp/cache/img-qcow2" should have a file format of "qcow2v3" Scenario: lz4 download convert to raw, cache Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-lz4cy" with options "--target-format=raw --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-test9" Then a file named "/tmp/uricp/srv-test9" should exist And the file named "/tmp/uricp/srv-test9" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-lz4cy" should exist And the file named "/tmp/uricp/cache/img-lz4cy" should have a file format of "lz4" Scenario: lz4 download convert to raw, cache, size limited Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-lz4cy" with options "--target-format=raw --cache=/tmp/uricp --max-cache 2MB" from container "test" into "file:///tmp/uricp/srv-testf" Then a file named "/tmp/uricp/srv-testf" should exist And the file named "/tmp/uricp/srv-testf" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-lz4cy" should not exist Scenario: lz4 download convert to raw, cache, within size Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-lz4cy" with options "--target-format=raw --cache=/tmp/uricp --max-cache 10MB" from container "test" into "file:///tmp/uricp/srv-test9" Then a file named "/tmp/uricp/srv-test9" should exist And the file named "/tmp/uricp/srv-test9" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-lz4cy" should exist And the file named "/tmp/uricp/cache/img-lz4cy" should have a file format of "lz4" Scenario: lz4 download convert to raw, from cache Given a correctly initialised cache at "/tmp/uricp" And a cache of "img-lz4cy" from container "test" at "/tmp/uricp" When I retrieve "img-lz4cy" with options "--target-format=raw --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-testa" Then a file named "/tmp/uricp/srv-testa" should exist And the file named "/tmp/uricp/srv-testa" should have a file format of "raw" And a file named "/tmp/uricp/cache/img-lz4cy" should exist And the file named "/tmp/uricp/cache/img-lz4cy" should have a file format of "lz4" Scenario: lz4 download convert to qcow2, cache Given a correctly initialised cache at "/tmp/uricp" When I retrieve "img-lz4cy" with options "--target-format=qcow2 --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-testb" Then a file named "/tmp/uricp/srv-testb" should exist And the file named "/tmp/uricp/srv-testb" should have a file format of "qcow2" And a file named "/tmp/uricp/cache/img-lz4cy" should exist And the file named "/tmp/uricp/cache/img-lz4cy" should have a file format of "lz4" Scenario: lz4 download convert to qcow2, from cache Given a correctly initialised cache at "/tmp/uricp" And a cache of "img-lz4cy" from container "test" at "/tmp/uricp" When I retrieve "img-lz4cy" with options "--target-format=qcow2 --cache=/tmp/uricp" from container "test" into "file:///tmp/uricp/srv-testa" Then a file named "/tmp/uricp/srv-testa" should exist And the file named "/tmp/uricp/srv-testa" should have a file format of "qcow2" And a file named "/tmp/uricp/cache/img-lz4cy" should exist And the file named "/tmp/uricp/cache/img-lz4cy" should have a file format of "lz4"