uricp 0.0.18 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -2
- data/Jenkinsfile +88 -58
- data/Rakefile +5 -0
- data/almalinux8/Dockerfile +26 -0
- data/bin/uricp +26 -11
- data/bionic/Dockerfile +2 -1
- data/centos7/Dockerfile +16 -9
- data/cucumber.yml +1 -0
- data/features/check_uri_path.feature +14 -0
- data/features/rbd_access.feature +248 -0
- data/features/step_definitions/rbd_steps.rb +8 -0
- data/focal/Dockerfile +10 -3
- data/lib/uricp/strategy/cache_common.rb +19 -1
- data/lib/uricp/strategy/cached_get.rb +8 -5
- data/lib/uricp/strategy/common.rb +69 -1
- data/lib/uricp/strategy/piped_cache.rb +7 -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 +39 -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 +1 -1
- data/lib/uricp.rb +26 -19
- data/uricp.gemspec +2 -1
- data/xenial/Dockerfile +2 -1
- metadata +33 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f12b0071b707cd164565e756677d620c77aa4433161b28b4e2aed90e764f2e68
|
4
|
+
data.tar.gz: 2a226104ffad1d51b15e6a9ea015d94e058ff7728e66d3f0c708092e1764205b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 420a3273588f2fde0d78b12250be89b0c07fc0f82d9e4101c427780f871f021bba870ff88b14d5adf3dd9ed0c599a944474137040e8ea2f07aaadd326fa6eccc
|
7
|
+
data.tar.gz: 6cba1806fed37f14d5dad8402061f639f9d6e32df79caf66bd06c2bbabcbd68d460b71710ba76f676967301a1b878129b8b92bd7796f697f8159cc9a65da3c89
|
data/Gemfile.lock
CHANGED
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
|
-
stage("
|
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
|
-
stage("
|
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("--dry-cache DRY_CACHE",[:rbd, :partial_rbd],
|
126
|
+
"On dry runs assume the cache is populated", "[rbd, partial_rbd]")
|
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,18 +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
|
-
|
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,248 @@
|
|
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 partial rbd caches
|
60
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
61
|
+
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`
|
62
|
+
And the output should not contain:
|
63
|
+
"""
|
64
|
+
snap create
|
65
|
+
"""
|
66
|
+
And the output should contain:
|
67
|
+
"""
|
68
|
+
rbd import --no-progress --id libvirt - 'servers/srv-testy'
|
69
|
+
"""
|
70
|
+
|
71
|
+
Scenario: HTTP URI to rbd via populated cache
|
72
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
73
|
+
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`
|
74
|
+
And the output should not contain:
|
75
|
+
"""
|
76
|
+
snap create
|
77
|
+
"""
|
78
|
+
And the output should contain:
|
79
|
+
"""
|
80
|
+
rbd clone --id libvirt 'servers/freedos.qcow2@base' 'servers/srv-testy'
|
81
|
+
"""
|
82
|
+
|
83
|
+
Scenario: rbd to rbd - no cache
|
84
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
85
|
+
When I successfully run `uricp --dry-run rbd:///servers/img-testy rbd:///servers/srv-testy`
|
86
|
+
And the output should contain:
|
87
|
+
"""
|
88
|
+
rbd snap create --id libvirt 'servers/img-testy@uricp_snap'
|
89
|
+
"""
|
90
|
+
And the output should contain:
|
91
|
+
"""
|
92
|
+
rbd snap protect --id libvirt 'servers/img-testy@uricp_snap'
|
93
|
+
"""
|
94
|
+
And the output should not contain:
|
95
|
+
"""
|
96
|
+
rbd snap unprotect --id libvirt 'servers/img-testy@uricp_snap'
|
97
|
+
"""
|
98
|
+
And the output should not contain:
|
99
|
+
"""
|
100
|
+
rbd snap rm --id libvirt 'servers/img-testy@uricp_snap'
|
101
|
+
"""
|
102
|
+
And the output should contain:
|
103
|
+
"""
|
104
|
+
rbd clone --id libvirt 'servers/img-testy@uricp_snap' 'servers/srv-testy'
|
105
|
+
"""
|
106
|
+
|
107
|
+
Scenario: rbd to rbd - unpopulated cache
|
108
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
109
|
+
When I successfully run `uricp --dry-run --cache=/tmp/uricp rbd:///servers/srv-testy rbd:///servers/img-testy`
|
110
|
+
And the output should contain:
|
111
|
+
"""
|
112
|
+
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
113
|
+
"""
|
114
|
+
And the output should contain:
|
115
|
+
"""
|
116
|
+
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
117
|
+
"""
|
118
|
+
And the output should not contain:
|
119
|
+
"""
|
120
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
121
|
+
"""
|
122
|
+
And the output should not contain:
|
123
|
+
"""
|
124
|
+
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
125
|
+
"""
|
126
|
+
And the output should not contain:
|
127
|
+
"""
|
128
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
129
|
+
"""
|
130
|
+
And the output should contain:
|
131
|
+
"""
|
132
|
+
rbd clone --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy'
|
133
|
+
"""
|
134
|
+
And the output should not contain:
|
135
|
+
"""
|
136
|
+
rbd export --no-progress --id libvirt 'servers/img-testy@base' -
|
137
|
+
"""
|
138
|
+
And the output should contain:
|
139
|
+
"""
|
140
|
+
rbd snap create --id libvirt 'servers/img-testy@base'
|
141
|
+
"""
|
142
|
+
And the output should contain:
|
143
|
+
"""
|
144
|
+
rbd snap protect --id libvirt 'servers/img-testy@base'
|
145
|
+
"""
|
146
|
+
|
147
|
+
Scenario: rbd to rbd - partial cache
|
148
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
149
|
+
When I run `uricp --dry-run --dry-cache=partial_rbd --cache=/tmp/uricp rbd:///servers/srv-testy rbd:///servers/img-testy`
|
150
|
+
Then the exit status should be 70
|
151
|
+
And the output should contain:
|
152
|
+
"""
|
153
|
+
Unsupported transfer
|
154
|
+
"""
|
155
|
+
|
156
|
+
Scenario: rbd to rbd - populated cache
|
157
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
158
|
+
When I successfully run `uricp --dry-run --dry-cache=rbd --cache=/tmp/uricp rbd:///servers/img-testy rbd:///servers/srv-testy`
|
159
|
+
And the output should not contain:
|
160
|
+
"""
|
161
|
+
snap create
|
162
|
+
"""
|
163
|
+
And the output should contain:
|
164
|
+
"""
|
165
|
+
rbd clone --id libvirt 'servers/img-testy@base' 'servers/srv-testy'
|
166
|
+
"""
|
167
|
+
|
168
|
+
Scenario: RBD export.
|
169
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
170
|
+
When I successfully run `uricp --dry-run --compress rbd:///servers/srv-testy file:///tmp/img-testy`
|
171
|
+
And the output should contain:
|
172
|
+
"""
|
173
|
+
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
174
|
+
"""
|
175
|
+
And the output should contain:
|
176
|
+
"""
|
177
|
+
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
178
|
+
"""
|
179
|
+
And the output should contain:
|
180
|
+
"""
|
181
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
182
|
+
"""
|
183
|
+
And the output should contain:
|
184
|
+
"""
|
185
|
+
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
186
|
+
"""
|
187
|
+
And the output should contain:
|
188
|
+
"""
|
189
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
190
|
+
"""
|
191
|
+
|
192
|
+
Scenario: RBD export with cacheing - populated cache
|
193
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
194
|
+
When I run `uricp --dry-run --dry-cache=rbd --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
|
195
|
+
Then the exit status should be 70
|
196
|
+
And the output should contain:
|
197
|
+
"""
|
198
|
+
Unsupported transfer
|
199
|
+
"""
|
200
|
+
|
201
|
+
Scenario: RBD export with cacheing - partial cache
|
202
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
203
|
+
When I run `uricp --dry-run --dry-cache=partial_rbd --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
|
204
|
+
Then the exit status should be 70
|
205
|
+
And the output should contain:
|
206
|
+
"""
|
207
|
+
Unsupported transfer
|
208
|
+
"""
|
209
|
+
|
210
|
+
Scenario: RBD export with cacheing - empty cache
|
211
|
+
Given a correctly initialised cache at "/tmp/uricp"
|
212
|
+
When I successfully run `uricp --dry-run --compress --cache=/tmp/uricp rbd:///servers/srv-testy file:///tmp/img-testy`
|
213
|
+
And the output should contain:
|
214
|
+
"""
|
215
|
+
rbd snap create --id libvirt 'servers/srv-testy@uricp_snap'
|
216
|
+
"""
|
217
|
+
And the output should contain:
|
218
|
+
"""
|
219
|
+
rbd snap protect --id libvirt 'servers/srv-testy@uricp_snap'
|
220
|
+
"""
|
221
|
+
And the output should not contain:
|
222
|
+
"""
|
223
|
+
rbd snap unprotect --id libvirt 'servers/srv-testy@uricp_snap'
|
224
|
+
"""
|
225
|
+
And the output should not contain:
|
226
|
+
"""
|
227
|
+
rbd snap rm --id libvirt 'servers/srv-testy@uricp_snap'
|
228
|
+
"""
|
229
|
+
And the output should not contain:
|
230
|
+
"""
|
231
|
+
rbd export --no-progress --id libvirt 'servers/srv-testy@uricp_snap' -
|
232
|
+
"""
|
233
|
+
And the output should contain:
|
234
|
+
"""
|
235
|
+
rbd clone --id libvirt 'servers/srv-testy@uricp_snap' 'servers/img-testy'
|
236
|
+
"""
|
237
|
+
And the output should contain:
|
238
|
+
"""
|
239
|
+
rbd export --no-progress --id libvirt 'servers/img-testy@base' -
|
240
|
+
"""
|
241
|
+
And the output should contain:
|
242
|
+
"""
|
243
|
+
rbd snap create --id libvirt 'servers/img-testy@base'
|
244
|
+
"""
|
245
|
+
And the output should contain:
|
246
|
+
"""
|
247
|
+
rbd snap protect --id libvirt 'servers/img-testy@base'
|
248
|
+
"""
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Then(/^a ceph entry named "(.*?)" should exist$/) do |arg1|
|
2
|
+
pending # express the regexp above with the code you wish you had
|
3
|
+
end
|
4
|
+
|
5
|
+
Then(/^a ceph snapshot named "(.*?)" should exist$/) do |arg1|
|
6
|
+
pending # express the regexp above with the code you wish you had
|
7
|
+
end
|
8
|
+
|