uricp 0.0.17 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -13
- data/Jenkinsfile +86 -56
- data/Rakefile +5 -0
- data/almalinux8/Dockerfile +26 -0
- data/bin/uricp +26 -11
- data/bionic/Dockerfile +2 -1
- data/centos7/Dockerfile +16 -11
- data/cucumber.yml +1 -0
- data/features/check_uri_path.feature +14 -0
- data/features/rbd_access.feature +218 -0
- data/features/step_definitions/rbd_steps.rb +8 -0
- data/features/step_definitions/uricp_steps.rb +8 -4
- data/focal/Dockerfile +28 -0
- data/lib/uricp/strategy/cache_common.rb +19 -1
- data/lib/uricp/strategy/cached_get.rb +8 -5
- data/lib/uricp/strategy/common.rb +54 -1
- data/lib/uricp/strategy/local_convert.rb +1 -1
- data/lib/uricp/strategy/piped_cache.rb +5 -4
- data/lib/uricp/strategy/piped_rbd_get.rb +8 -24
- data/lib/uricp/strategy/rbd_cache_base_snap.rb +27 -0
- data/lib/uricp/strategy/rbd_cache_check.rb +42 -0
- data/lib/uricp/strategy/rbd_cache_clone.rb +40 -0
- data/lib/uricp/strategy/rbd_cache_upload.rb +40 -0
- data/lib/uricp/strategy/rbd_cached_get.rb +36 -0
- data/lib/uricp/strategy/rbd_cached_put.rb +32 -0
- data/lib/uricp/strategy/{rbd_remote_put.rb → rbd_put.rb} +7 -5
- data/lib/uricp/strategy/rbd_snap.rb +57 -0
- data/lib/uricp/strategy/rbd_sweeper.rb +2 -1
- data/lib/uricp/uri_strategy.rb +8 -1
- data/lib/uricp/version.rb +4 -2
- data/lib/uricp.rb +26 -19
- data/uricp.gemspec +3 -2
- data/xenial/Dockerfile +2 -1
- metadata +36 -8
- data/trusty/Dockerfile +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e1b637ff4ba7720c05496e44d43b9dbe71908bb8bf1605e7a64c2ed1497f273
|
4
|
+
data.tar.gz: 037bd61ab71e9f18bd654779d6fe7049d42124f678737c5703e7a76eef9448df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d71cb3c6211690160d6a57130eff9b6ed3043f497ef9b182f1aefd9dbb378d186c16c7093e637f2ed718867d47f6e6a50059976440ece998f8c313facd701be8
|
7
|
+
data.tar.gz: d7feeb5ab8fe6b98e6895d442f38c8404fcc12687dcc851485f6e38e640eb31cfe1bb0dfb2e0803d50261594e918e92034f1653f9ece0d457fea15f98cfbbd3a
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
uricp (0.0.
|
4
|
+
uricp (0.0.22)
|
5
|
+
childprocess (~> 1.0)
|
5
6
|
filesize (= 0.0.2)
|
6
|
-
methadone (~> 2.0.
|
7
|
+
methadone (~> 2.0.2)
|
7
8
|
open4 (~> 1.3.0)
|
8
9
|
sendfile (~> 1.2.0)
|
9
10
|
|
@@ -14,17 +15,16 @@ GEM
|
|
14
15
|
childprocess (>= 0.3.6)
|
15
16
|
cucumber (>= 1.1.1)
|
16
17
|
rspec-expectations (>= 2.7.0)
|
17
|
-
builder (3.2.
|
18
|
-
childprocess (0.
|
19
|
-
|
18
|
+
builder (3.2.4)
|
19
|
+
childprocess (1.0.1)
|
20
|
+
rake (< 13.0)
|
20
21
|
cucumber (1.3.20)
|
21
22
|
builder (>= 2.1.2)
|
22
23
|
diff-lcs (>= 1.1.3)
|
23
24
|
gherkin (~> 2.12)
|
24
25
|
multi_json (>= 1.7.5, < 2.0)
|
25
26
|
multi_test (>= 0.1.2)
|
26
|
-
diff-lcs (1.
|
27
|
-
ffi (1.9.23)
|
27
|
+
diff-lcs (1.4.4)
|
28
28
|
filesize (0.0.2)
|
29
29
|
gherkin (2.12.2)
|
30
30
|
multi_json (~> 1.3)
|
@@ -32,14 +32,16 @@ GEM
|
|
32
32
|
json (1.8.6)
|
33
33
|
methadone (2.0.2)
|
34
34
|
bundler
|
35
|
-
multi_json (1.
|
35
|
+
multi_json (1.15.0)
|
36
36
|
multi_test (0.1.2)
|
37
37
|
open4 (1.3.4)
|
38
|
-
rake (
|
38
|
+
rake (12.3.3)
|
39
39
|
rdoc (4.2.2)
|
40
40
|
json (~> 1.4)
|
41
|
-
rspec-expectations (
|
42
|
-
diff-lcs (>= 1.
|
41
|
+
rspec-expectations (3.10.1)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-support (3.10.2)
|
43
45
|
sendfile (1.2.2)
|
44
46
|
|
45
47
|
PLATFORMS
|
@@ -50,9 +52,9 @@ DEPENDENCIES
|
|
50
52
|
bundler (~> 1.7)
|
51
53
|
cucumber (~> 1.3)
|
52
54
|
inifile (~> 1.1)
|
53
|
-
rake (~>
|
55
|
+
rake (~> 12.3)
|
54
56
|
rdoc (~> 4.2.0)
|
55
57
|
uricp!
|
56
58
|
|
57
59
|
BUNDLED WITH
|
58
|
-
1.
|
60
|
+
1.17.3
|
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
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
26
|
-
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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("
|
67
|
+
stage("Focal, Ruby 2.7.0") {
|
40
68
|
agent {
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
48
|
-
|
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
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
91
|
stage("Xenial, Ruby 2.3.1") {
|
62
92
|
agent {
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
93
|
+
dockerfile {
|
94
|
+
dir 'xenial'
|
95
|
+
label "docker"
|
96
|
+
}
|
67
97
|
}
|
68
98
|
steps {
|
69
|
-
|
70
|
-
|
99
|
+
sh 'bundle install --deployment'
|
100
|
+
sh 'bundle exec rake features:new_qemu'
|
71
101
|
}
|
72
102
|
post {
|
73
103
|
always {
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
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
113
|
stage("Bionic, Ruby 2.5.1") {
|
84
114
|
agent {
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
115
|
+
dockerfile {
|
116
|
+
dir 'bionic'
|
117
|
+
label "docker"
|
118
|
+
}
|
89
119
|
}
|
90
120
|
steps {
|
91
|
-
|
92
|
-
|
121
|
+
sh 'bundle install --deployment'
|
122
|
+
sh 'bundle exec rake features:new_qemu'
|
93
123
|
}
|
94
124
|
post {
|
95
125
|
always {
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
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
|
-
|
109
|
-
|
110
|
-
|
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,8 @@ require 'optparse'
|
|
4
4
|
require 'uri'
|
5
5
|
require 'methadone'
|
6
6
|
require 'filesize'
|
7
|
-
require '
|
7
|
+
require 'securerandom'
|
8
|
+
require 'uricp'
|
8
9
|
|
9
10
|
class App
|
10
11
|
include Methadone::Main
|
@@ -52,20 +53,32 @@ class App
|
|
52
53
|
def self.build_command
|
53
54
|
command_sequence = Uricp::UriStrategy.choose_strategy(options)
|
54
55
|
debug "#{self.name} Command sequence is #{command_sequence.inspect}"
|
55
|
-
command_sequence.map
|
56
|
+
command_sequence.map do |c|
|
57
|
+
debug c.class.name
|
58
|
+
c.command
|
59
|
+
end.join('')
|
56
60
|
end
|
57
61
|
|
58
62
|
def self.validate_options
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
"'max-cache' requires 'cache' option"
|
67
|
-
end
|
63
|
+
case
|
64
|
+
when options['from_uri'].path.nil?
|
65
|
+
raise ::OptionParser::InvalidArgument,
|
66
|
+
"'from_uri' has missing path"
|
67
|
+
when options['to_uri'].path.nil?
|
68
|
+
raise ::OptionParser::InvalidArgument,
|
69
|
+
"'to_uri' has missing path"
|
68
70
|
end
|
71
|
+
return if options['cache']
|
72
|
+
|
73
|
+
case
|
74
|
+
when options['target-format']
|
75
|
+
raise ::OptionParser::MissingArgument,
|
76
|
+
"'target-format' requires 'cache' option"
|
77
|
+
when options['max-cache']
|
78
|
+
raise ::OptionParser::MissingArgument,
|
79
|
+
"'max-cache' requires 'cache' option"
|
80
|
+
end
|
81
|
+
|
69
82
|
end
|
70
83
|
|
71
84
|
def self.add_cache_name
|
@@ -109,6 +122,8 @@ class App
|
|
109
122
|
"Compress output")
|
110
123
|
on("--[no-]dry-run",
|
111
124
|
"Show what would be run,", "but don't run the command")
|
125
|
+
on("--[no-]dry-cache",
|
126
|
+
"On dry runs assume the cache is populated")
|
112
127
|
on("--[no-]force",
|
113
128
|
"Always write sparsely")
|
114
129
|
#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,20 +1,25 @@
|
|
1
1
|
FROM centos:7
|
2
2
|
MAINTAINER support@brightbox.co.uk
|
3
3
|
|
4
|
-
RUN
|
5
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
RUN echo
|
20
|
-
|
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
@@ -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,218 @@
|
|
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 --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 --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 --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 not contain:
|
83
|
+
"""
|
84
|
+
rbd snap unprotect --id libvirt 'servers/img-testy@uricp_snap'
|
85
|
+
"""
|
86
|
+
And the output should not contain:
|
87
|
+
"""
|
88
|
+
rbd snap rm --id libvirt 'servers/img-testy@uricp_snap'
|
89
|
+
"""
|
90
|
+
And the output should contain:
|
91
|
+
"""
|
92
|
+
rbd clone --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 not contain:
|
107
|
+
"""
|
108
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
109
|
+
"""
|
110
|
+
And the output should not 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 --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
|
+
|
135
|
+
Scenario: rbd to rbd - populated cache
|
136
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
137
|
+
When I successfully run `uricp --dry-run --dry-cache --cache=/tmp/uricp rbd:///servers/img-testy rbd:///servers/srv-testy`
|
138
|
+
And the output should not contain:
|
139
|
+
"""
|
140
|
+
snap create
|
141
|
+
"""
|
142
|
+
And the output should contain:
|
143
|
+
"""
|
144
|
+
rbd clone --id libvirt 'servers/img-testy@base' 'servers/srv-testy'
|
145
|
+
"""
|
146
|
+
|
147
|
+
Scenario: RBD export.
|
148
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
149
|
+
When I successfully run `uricp --dry-run --compress rbd:///servers/srv-testy file:///tmp/img-testy`
|
150
|
+
And the output should contain:
|
151
|
+
"""
|
152
|
+
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
153
|
+
"""
|
154
|
+
And the output should contain:
|
155
|
+
"""
|
156
|
+
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
157
|
+
"""
|
158
|
+
And the output should contain:
|
159
|
+
"""
|
160
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
161
|
+
"""
|
162
|
+
And the output should contain:
|
163
|
+
"""
|
164
|
+
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
165
|
+
"""
|
166
|
+
And the output should contain:
|
167
|
+
"""
|
168
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
169
|
+
"""
|
170
|
+
|
171
|
+
Scenario: RBD export with cacheing - populated cache
|
172
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
173
|
+
When I run `uricp --dry-run --dry-cache --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
|
174
|
+
Then the exit status should be 70
|
175
|
+
And the output should contain:
|
176
|
+
"""
|
177
|
+
Unsupported transfer
|
178
|
+
"""
|
179
|
+
|
180
|
+
Scenario: RBD export with cacheing - empty cache
|
181
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
182
|
+
When I successfully run `uricp --dry-run --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
|
183
|
+
And the output should contain:
|
184
|
+
"""
|
185
|
+
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
186
|
+
"""
|
187
|
+
And the output should contain:
|
188
|
+
"""
|
189
|
+
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
190
|
+
"""
|
191
|
+
And the output should not contain:
|
192
|
+
"""
|
193
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
194
|
+
"""
|
195
|
+
And the output should not contain:
|
196
|
+
"""
|
197
|
+
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
198
|
+
"""
|
199
|
+
And the output should not contain:
|
200
|
+
"""
|
201
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
202
|
+
"""
|
203
|
+
And the output should contain:
|
204
|
+
"""
|
205
|
+
rbd clone --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy'
|
206
|
+
"""
|
207
|
+
And the output should contain:
|
208
|
+
"""
|
209
|
+
rbd export --no-progress --id libvirt 'servers/img-testy@base' -
|
210
|
+
"""
|
211
|
+
And the output should contain:
|
212
|
+
"""
|
213
|
+
rbd snap create --id libvirt 'servers/img-testy@base'
|
214
|
+
"""
|
215
|
+
And the output should contain:
|
216
|
+
"""
|
217
|
+
rbd snap protect --id libvirt 'servers/img-testy@base'
|
218
|
+
"""
|