uricp 0.0.18 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9944582044883ff45f3847042ca62016416d06198a0af41751de93ab992c646
4
- data.tar.gz: 19c14777647bb01fec3a4e6214e8183b29432843bf47b8b0c818d0401dafaea1
3
+ metadata.gz: e77694a18e045d2917d254afcb2db0a2c4cb7d81471d3ccabfe5c232bc340408
4
+ data.tar.gz: c063c5315485f25194e2f195c821470f0cc840cc242a0f88c174653a3a3bf167
5
5
  SHA512:
6
- metadata.gz: c157e985f79891ca962fb0b792dab2a4fab89bd651c15b940e75ba4baf0e86a42922b9dc8a0f96fa53b8de4151d3e9b6aeefac256ffe59faa2ed6ad5becfad47
7
- data.tar.gz: 45444dfcbc92079f7221d0f239315db22f6af749843f6a89312e949c1f12068a2254f6ffd8830a4ab00833e3b66d16d259cfcccb9388f24dde9ff23fbad99ee2
6
+ metadata.gz: e8af0949b1de2c8c414d8c60f69390ebc5c722189ff9d86b3c0201c3a30aecded256c8c38be244516834ba97ca7e3ee58c325444304f766cef55b11053d018af
7
+ data.tar.gz: db89854277d707b488ef4c86bad899407445ff62bd9815aa60259f636b473e17905a83bd53b120f287eabe60012cb20681015a45ef752d3d98660ed6e4b01f71
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uricp (0.0.18)
4
+ uricp (0.0.20)
5
+ childprocess (~> 1.0)
5
6
  filesize (= 0.0.2)
6
- methadone (~> 2.0.0)
7
+ methadone (~> 2.0.2)
7
8
  open4 (~> 1.3.0)
8
9
  sendfile (~> 1.2.0)
9
10
 
data/Jenkinsfile CHANGED
@@ -2,6 +2,8 @@ pipeline {
2
2
  environment {
3
3
  ORBIT = credentials('ced8ecd0-dbe4-4bf6-bdde-101a661565f5')
4
4
  ORBIT_URL = credentials('c0c95c56-b4e9-45c2-85c5-bf292aef7301')
5
+ RBD = credentials('9bfb46f5-65eb-40c3-bfda-7ac5fe469ff4')
6
+ CEPH_MON = credentials('ceph-mon')
5
7
  ORBIT_USER = "${ORBIT_USR}"
6
8
  ORBIT_KEY = "${ORBIT_PSW}"
7
9
  }
@@ -14,100 +16,128 @@ pipeline {
14
16
  }
15
17
  agent none
16
18
  stages {
19
+ stage("AlmaLinux 8") {
20
+ agent {
21
+ dockerfile {
22
+ dir 'almalinux8'
23
+ label "docker"
24
+ additionalBuildArgs '--build-arg CEPH_MON --build-arg RBD_USR --build-arg RBD_PSW'
25
+ }
26
+ }
27
+ steps {
28
+ sh 'rbd --id "${RBD_USR}" ls servers'
29
+ sh 'bundle install --deployment'
30
+ sh 'bundle exec rake features:new_qemu'
31
+ }
32
+ post {
33
+ always {
34
+ sh 'bundle exec rake features:clean'
35
+ }
36
+ failure {
37
+ mail to: 'sysadmin@brightbox.co.uk',
38
+ subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
39
+ body: "${env.BUILD_URL}"
40
+ }
41
+ }
42
+ }
17
43
  stage("CentOS 7") {
18
44
  agent {
19
- dockerfile {
20
- dir 'centos7'
21
- label "docker"
22
- }
45
+ dockerfile {
46
+ dir 'centos7'
47
+ label "docker"
48
+ additionalBuildArgs '--build-arg CEPH_MON --build-arg RBD_USR --build-arg RBD_PSW'
49
+ }
23
50
  }
24
51
  steps {
25
- sh 'bundle install --deployment'
26
- sh 'bundle exec rake features:new_qemu'
52
+ sh 'rbd --id "${RBD_USR}" ls servers'
53
+ sh 'bundle install --deployment'
54
+ sh 'bundle exec rake features:new_qemu'
27
55
  }
28
56
  post {
29
57
  always {
30
- sh 'bundle exec rake features:clean'
31
- }
32
- failure {
33
- mail to: 'sysadmin@brightbox.co.uk',
34
- subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
35
- body: "${env.BUILD_URL}"
36
- }
58
+ sh 'bundle exec rake features:clean'
59
+ }
60
+ failure {
61
+ mail to: 'sysadmin@brightbox.co.uk',
62
+ subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
63
+ body: "${env.BUILD_URL}"
64
+ }
37
65
  }
38
66
  }
39
- stage("Xenial, Ruby 2.3.1") {
67
+ stage("Focal, Ruby 2.7.0") {
40
68
  agent {
41
- dockerfile {
42
- dir 'xenial'
43
- label "docker"
44
- }
69
+ dockerfile {
70
+ dir 'focal'
71
+ label "docker"
72
+ additionalBuildArgs '--build-arg CEPH_MON --build-arg RBD_USR --build-arg RBD_PSW'
73
+ }
45
74
  }
46
75
  steps {
47
- sh 'bundle install --deployment'
48
- sh 'bundle exec rake features:new_qemu'
76
+ sh 'rbd --id "${RBD_USR}" ls servers'
77
+ sh 'bundle install --deployment'
78
+ sh 'bundle exec rake features:new_qemu'
49
79
  }
50
80
  post {
51
81
  always {
52
- sh 'bundle exec rake features:clean'
53
- }
54
- failure {
55
- mail to: 'sysadmin@brightbox.co.uk',
56
- subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
57
- body: "${env.BUILD_URL}"
58
- }
82
+ sh 'bundle exec rake features:clean'
83
+ }
84
+ failure {
85
+ mail to: 'sysadmin@brightbox.co.uk',
86
+ subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
87
+ body: "${env.BUILD_URL}"
88
+ }
59
89
  }
60
90
  }
61
- stage("Bionic, Ruby 2.5.1") {
91
+ stage("Xenial, Ruby 2.3.1") {
62
92
  agent {
63
- dockerfile {
64
- dir 'bionic'
65
- label "docker"
66
- }
93
+ dockerfile {
94
+ dir 'xenial'
95
+ label "docker"
96
+ }
67
97
  }
68
98
  steps {
69
- sh 'bundle install --deployment'
70
- sh 'bundle exec rake features:new_qemu'
99
+ sh 'bundle install --deployment'
100
+ sh 'bundle exec rake features:new_qemu'
71
101
  }
72
102
  post {
73
103
  always {
74
- sh 'bundle exec rake features:clean'
75
- }
76
- failure {
77
- mail to: 'sysadmin@brightbox.co.uk',
78
- subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
79
- body: "${env.BUILD_URL}"
80
- }
104
+ sh 'bundle exec rake features:clean'
105
+ }
106
+ failure {
107
+ mail to: 'sysadmin@brightbox.co.uk',
108
+ subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
109
+ body: "${env.BUILD_URL}"
110
+ }
81
111
  }
82
112
  }
83
- stage("Focal, Ruby 2.7.0") {
113
+ stage("Bionic, Ruby 2.5.1") {
84
114
  agent {
85
- dockerfile {
86
- dir 'focal'
87
- label "docker"
88
- }
115
+ dockerfile {
116
+ dir 'bionic'
117
+ label "docker"
118
+ }
89
119
  }
90
120
  steps {
91
- sh 'bundle install --deployment'
92
- sh 'bundle exec rake features:new_qemu'
121
+ sh 'bundle install --deployment'
122
+ sh 'bundle exec rake features:new_qemu'
93
123
  }
94
124
  post {
95
125
  always {
96
- sh 'bundle exec rake features:clean'
97
- }
98
- failure {
99
- mail to: 'sysadmin@brightbox.co.uk',
100
- subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
101
- body: "${env.BUILD_URL}"
102
- }
126
+ sh 'bundle exec rake features:clean'
127
+ }
128
+ failure {
129
+ mail to: 'sysadmin@brightbox.co.uk',
130
+ subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
131
+ body: "${env.BUILD_URL}"
132
+ }
103
133
  }
104
134
  }
105
135
  }
106
136
  post {
107
137
  failure {
108
- mail to: 'sysadmin@brightbox.co.uk',
109
- subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
110
- body: "${env.BUILD_URL}"
138
+ mail to: 'sysadmin@brightbox.co.uk',
139
+ subject: "Uricp Tests Failed: ${currentBuild.fullDisplayName}",
140
+ body: "${env.BUILD_URL}"
111
141
  }
112
142
  }
113
143
  }
data/Rakefile CHANGED
@@ -48,6 +48,11 @@ namespace(:features) do
48
48
  t.fork = false
49
49
  t.profile = 'old-qemu-image'
50
50
  end
51
+ Cucumber::Rake::Task.new(:rbd) do |t|
52
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x"
53
+ t.fork = false
54
+ t.profile = 'rbd'
55
+ end
51
56
 
52
57
  task(:clean) do
53
58
  if ENV['ORBIT_USER'] && ENV['ORBIT_KEY']
@@ -0,0 +1,26 @@
1
+ FROM almalinux:8
2
+ MAINTAINER support@brightbox.co.uk
3
+
4
+ RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
5
+ RUN dnf -y install dnf-plugins-core
6
+ RUN dnf config-manager --add-repo https://repo.almalinux.org/almalinux/8.4/devel/almalinux-devel.repo
7
+ RUN dnf -y update
8
+ RUN dnf config-manager --set-enabled powertools,devel
9
+ RUN dnf -y group install "Development Tools"
10
+ RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
11
+ RUN dnf -y install https://www.rdoproject.org/repos/rdo-release.el8.rpm
12
+ RUN dnf -y install \
13
+ git \
14
+ lz4 \
15
+ qemu-img \
16
+ ruby-devel \
17
+ rubygems \
18
+ rubygem-bundler \
19
+ python3-swiftclient \
20
+ ceph-common
21
+ RUN mkdir -p /etc/ceph
22
+ ARG RBD_USR=libvirt
23
+ ARG RBD_PSW
24
+ ARG CEPH_MON
25
+ RUN echo -e "[client.$RBD_USR]\nkey = $RBD_PSW\n" > /etc/ceph/ceph.client.$RBD_USR.keyring
26
+ RUN echo -e "[global]\nmon_host = $CEPH_MON\n" > /etc/ceph/ceph.conf
data/bin/uricp CHANGED
@@ -4,7 +4,7 @@ require 'optparse'
4
4
  require 'uri'
5
5
  require 'methadone'
6
6
  require 'filesize'
7
- require 'uricp.rb'
7
+ require 'uricp'
8
8
 
9
9
  class App
10
10
  include Methadone::Main
@@ -52,20 +52,32 @@ class App
52
52
  def self.build_command
53
53
  command_sequence = Uricp::UriStrategy.choose_strategy(options)
54
54
  debug "#{self.name} Command sequence is #{command_sequence.inspect}"
55
- command_sequence.map{|c| c.command}.join('')
55
+ command_sequence.map do |c|
56
+ debug c.class.name
57
+ c.command
58
+ end.join('')
56
59
  end
57
60
 
58
61
  def self.validate_options
59
- unless options['cache']
60
- case
61
- when options['target-format']
62
- raise ::OptionParser::MissingArgument,
63
- "'target-format' requires 'cache' option"
64
- when options['max-cache']
65
- raise ::OptionParser::MissingArgument,
66
- "'max-cache' requires 'cache' option"
67
- end
62
+ case
63
+ when options['from_uri'].path.nil?
64
+ raise ::OptionParser::InvalidArgument,
65
+ "'from_uri' has missing path"
66
+ when options['to_uri'].path.nil?
67
+ raise ::OptionParser::InvalidArgument,
68
+ "'to_uri' has missing path"
68
69
  end
70
+ return if options['cache']
71
+
72
+ case
73
+ when options['target-format']
74
+ raise ::OptionParser::MissingArgument,
75
+ "'target-format' requires 'cache' option"
76
+ when options['max-cache']
77
+ raise ::OptionParser::MissingArgument,
78
+ "'max-cache' requires 'cache' option"
79
+ end
80
+
69
81
  end
70
82
 
71
83
  def self.add_cache_name
@@ -109,6 +121,8 @@ class App
109
121
  "Compress output")
110
122
  on("--[no-]dry-run",
111
123
  "Show what would be run,", "but don't run the command")
124
+ on("--[no-]dry-cache",
125
+ "On dry runs assume the cache is populated")
112
126
  on("--[no-]force",
113
127
  "Always write sparsely")
114
128
  #Arguments
data/bionic/Dockerfile CHANGED
@@ -1,6 +1,8 @@
1
1
  FROM ubuntu:bionic
2
2
  MAINTAINER support@brightbox.co.uk
3
3
 
4
+ RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
5
+
4
6
  RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq software-properties-common
5
7
 
6
8
  #RUN apt-add-repository ppa:brightbox/ruby-ng
@@ -16,5 +18,4 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
16
18
  python-swiftclient \
17
19
  ruby-bundler
18
20
 
19
- RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
20
21
 
data/centos7/Dockerfile CHANGED
@@ -1,18 +1,25 @@
1
1
  FROM centos:7
2
2
  MAINTAINER support@brightbox.co.uk
3
3
 
4
- RUN yum update -y && yum -y install \
5
- epel-release \
4
+ RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
5
+ RUN yum update -y
6
+ RUN yum -y install \
7
+ centos-release-openstack-train \
8
+ epel-release
9
+ RUN yum -y install \
6
10
  gcc \
7
11
  make \
8
12
  git \
9
13
  qemu-img \
14
+ lz4 \
10
15
  ruby-devel \
11
16
  rubygems \
12
- rubygem-bundler
13
-
14
- RUN yum -y install centos-release-openstack-train && \
15
- yum -y install python-swiftclient
16
-
17
- RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
18
-
17
+ rubygem-bundler \
18
+ ceph-common \
19
+ python-swiftclient
20
+ RUN mkdir -p /etc/ceph
21
+ ARG RBD_USR=libvirt
22
+ ARG RBD_PSW
23
+ ARG CEPH_MON
24
+ RUN echo -e "[client.$RBD_USR]\nkey = $RBD_PSW\n" > /etc/ceph/ceph.client.$RBD_USR.keyring
25
+ RUN echo -e "[global]\nmon_host = $CEPH_MON\n" > /etc/ceph/ceph.conf
data/cucumber.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  default: --profile new-qemu-image
2
2
  new-qemu-image: --tags ~@old-qemu-image
3
3
  old-qemu-image: --tags ~@new-qemu-image
4
+ rbd: --tags @rbd
@@ -0,0 +1,14 @@
1
+ Feature: Check URI paths
2
+ In order to ensure reliable uricp usage
3
+ As a command line user
4
+ I want to reject badly formed URIs
5
+
6
+ Scenario: source URI is incorrectly formatted
7
+ When I run `uricp --dry-run file:fred rbd:///servers/fred`
8
+ Then the exit status should not be 0
9
+ And the stderr should contain "invalid argument: 'from_uri' has missing path"
10
+
11
+ Scenario: target URI is incorrectly formatted
12
+ When I run `uricp --dry-run file:///fred rbd:servers/fred`
13
+ Then the exit status should not be 0
14
+ And the stderr should contain "invalid argument: 'to_uri' has missing path"
@@ -0,0 +1,226 @@
1
+ @rbd
2
+ Feature: Manipulate file images in ceph
3
+ in order to manipulate file images in ceph
4
+ as a command line user
5
+ I want to retrieve the uri via an optional cache and copy correctly to target in the right format
6
+
7
+ background:
8
+ given an empty directory named "/tmp/uricp"
9
+ and the default aruba timeout is 15 seconds
10
+
11
+ Scenario: HTTP URI qcow2 to rbd - no cache
12
+ When I successfully run `uricp --dry-run http://orbit.brightbox.com/v1/acc-tqs4c/downloads/freedos.qcow2 rbd:///servers/srv-testy`
13
+ And the output should contain:
14
+ """
15
+ rbd import --no-progress --id libvirt - 'servers/srv-testy'
16
+ """
17
+
18
+ Scenario: HTTP URI qcow2 to raw via unpopulated rbd cache
19
+ Given a correctly initialised cache at "/tmp/uricp"
20
+ 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`
21
+ And the output should contain:
22
+ """
23
+ rbd import --no-progress --id libvirt - 'servers/freedos.qcow2'
24
+ """
25
+ And the output should contain:
26
+ """
27
+ rbd snap create --id libvirt 'servers/freedos.qcow2@base'
28
+ """
29
+ And the output should contain:
30
+ """
31
+ rbd snap protect --id libvirt 'servers/freedos.qcow2@base'
32
+ """
33
+ And the output should contain:
34
+ """
35
+ rbd clone --no-progress --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy'
36
+ """
37
+
38
+ Scenario: HTTP URI from file cache via unpopulated rbd cache
39
+ Given a correctly initialised cache at "/tmp/uricp"
40
+ And a 102400 byte file named "/tmp/uricp/cache/freedos.qcow2"
41
+ 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`
42
+ And the output should contain:
43
+ """
44
+ rbd import --no-progress --id libvirt '/tmp/uricp/cache/freedos.qcow2' 'servers/freedos.qcow2'
45
+ """
46
+ And the output should contain:
47
+ """
48
+ rbd snap create --id libvirt 'servers/freedos.qcow2@base'
49
+ """
50
+ And the output should contain:
51
+ """
52
+ rbd snap protect --id libvirt 'servers/freedos.qcow2@base'
53
+ """
54
+ And the output should contain:
55
+ """
56
+ rbd clone --no-progress --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy'
57
+ """
58
+
59
+ Scenario: HTTP URI to rbd via populated caches
60
+ Given a correctly initialised cache at "/tmp/uricp"
61
+ 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`
62
+ And the output should not contain:
63
+ """
64
+ snap create
65
+ """
66
+ And the output should contain:
67
+ """
68
+ rbd clone --no-progress --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy'
69
+ """
70
+
71
+ Scenario: rbd to rbd - no cache
72
+ Given a correctly initialised cache at "/tmp/uricp"
73
+ When I successfully run `uricp --dry-run rbd:///servers/img-testy rbd:///servers/srv-testy`
74
+ And the output should contain:
75
+ """
76
+ rbd snap create --id libvirt 'servers/img-testy@uricp_snap'
77
+ """
78
+ And the output should contain:
79
+ """
80
+ rbd snap protect --id libvirt 'servers/img-testy@uricp_snap'
81
+ """
82
+ And the output should contain:
83
+ """
84
+ rbd snap unprotect --id libvirt 'servers/img-testy@uricp_snap'
85
+ """
86
+ And the output should contain:
87
+ """
88
+ rbd snap rm --id libvirt 'servers/img-testy@uricp_snap';
89
+ """
90
+ And the output should contain:
91
+ """
92
+ rbd clone --no-progress --id libvirt 'servers/img-testy@uricp_snap' 'servers/srv-testy'
93
+ """
94
+
95
+ Scenario: rbd to rbd - unpopulated cache
96
+ Given a correctly initialised cache at "/tmp/uricp"
97
+ When I successfully run `uricp --dry-run --cache=/tmp/uricp rbd:///servers/srv-testy rbd:///servers/img-testy`
98
+ And the output should contain:
99
+ """
100
+ rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
101
+ """
102
+ And the output should contain:
103
+ """
104
+ rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
105
+ """
106
+ And the output should contain:
107
+ """
108
+ rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
109
+ """
110
+ And the output should contain:
111
+ """
112
+ rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap';
113
+ """
114
+ And the output should not contain:
115
+ """
116
+ rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
117
+ """
118
+ And the output should contain:
119
+ """
120
+ rbd clone --no-progress --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy'
121
+ """
122
+ And the output should not contain:
123
+ """
124
+ rbd export --no-progress --id libvirt 'servers/img-testy@base' -
125
+ """
126
+ And the output should contain:
127
+ """
128
+ rbd snap create --id libvirt 'servers/img-testy@base'
129
+ """
130
+ And the output should contain:
131
+ """
132
+ rbd snap protect --id libvirt 'servers/img-testy@base'
133
+ """
134
+ And the output should contain:
135
+ """
136
+ rbd flatten --id libvirt --no-progress 'servers/img-testy'
137
+ """
138
+
139
+ Scenario: rbd to rbd - populated cache
140
+ Given a correctly initialised cache at "/tmp/uricp"
141
+ When I successfully run `uricp --dry-run --dry-cache --cache=/tmp/uricp rbd:///servers/img-testy rbd:///servers/srv-testy`
142
+ And the output should not contain:
143
+ """
144
+ snap create
145
+ """
146
+ And the output should contain:
147
+ """
148
+ rbd clone --no-progress --id libvirt 'servers/img-testy@base' 'servers/srv-testy'
149
+ """
150
+
151
+ Scenario: RBD export.
152
+ Given a correctly initialised cache at "/tmp/uricp"
153
+ When I successfully run `uricp --dry-run --compress rbd:///servers/srv-testy file:///tmp/img-testy`
154
+ And the output should contain:
155
+ """
156
+ rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
157
+ """
158
+ And the output should contain:
159
+ """
160
+ rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
161
+ """
162
+ And the output should contain:
163
+ """
164
+ rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
165
+ """
166
+ And the output should contain:
167
+ """
168
+ rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap';
169
+ """
170
+ And the output should contain:
171
+ """
172
+ rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
173
+ """
174
+
175
+ Scenario: RBD export with cacheing - populated cache
176
+ Given a correctly initialised cache at "/tmp/uricp"
177
+ When I run `uricp --dry-run --dry-cache --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
178
+ Then the exit status should be 70
179
+ And the output should contain:
180
+ """
181
+ Unsupported transfer
182
+ """
183
+
184
+ Scenario: RBD export with cacheing - empty cache
185
+ Given a correctly initialised cache at "/tmp/uricp"
186
+ When I successfully run `uricp --dry-run --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
187
+ And the output should contain:
188
+ """
189
+ rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
190
+ """
191
+ And the output should contain:
192
+ """
193
+ rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
194
+ """
195
+ And the output should contain:
196
+ """
197
+ rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
198
+ """
199
+ And the output should contain:
200
+ """
201
+ rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap';
202
+ """
203
+ And the output should not contain:
204
+ """
205
+ rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
206
+ """
207
+ And the output should contain:
208
+ """
209
+ rbd clone --no-progress --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy'
210
+ """
211
+ And the output should contain:
212
+ """
213
+ rbd export --no-progress --id libvirt 'servers/img-testy@base' -
214
+ """
215
+ And the output should contain:
216
+ """
217
+ rbd snap create --id libvirt 'servers/img-testy@base'
218
+ """
219
+ And the output should contain:
220
+ """
221
+ rbd snap protect --id libvirt 'servers/img-testy@base'
222
+ """
223
+ And the output should contain:
224
+ """
225
+ rbd flatten --id libvirt --no-progress 'servers/img-testy'
226
+ """