uricp 0.0.16 → 0.0.21

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7db104674249fa9443799b004c877667e22b142d26a7c7a2220ef668865dfbc
4
- data.tar.gz: d333e085bb1b666e09883fbd9b9006334d6c15acd17ac781629697bcc0766e5a
3
+ metadata.gz: aeaa81822977930906959744feb0d8bdf9ca820afd10e6b97d32a726cbf67391
4
+ data.tar.gz: cd29b49f83ba53a275f4574c32cbb7f1b92c5218421cef668355a14ab5a36bec
5
5
  SHA512:
6
- metadata.gz: 7e16104719cca1e2def15b5d9b2d7cbdbcb84b68f7d69a566b8eddd64e699654ea72f066102bb8949e2eb583ffd54aad9549b5094746747382930cf18a1de5a8
7
- data.tar.gz: b0f839f96f8975ce95121085fdba25ecb1451fc38dbc975de250a6277ffe584a5548f6033138cb46ae8f200a0e6c063e45b2eb25b26ea4e6cefad0d592b91294
6
+ metadata.gz: 56c0e441da6e7e709580e09cdcc68c56b3ff731fc9fd028e56160dbfca427048ecab2f79c049f490bd15bcb027a67ec1b4aa01ddd2ce801cda89ad53f9ba6efa
7
+ data.tar.gz: 92122076440ca0cbd0345f29bf4386503c9f3830d6a4ffbfc92a4f55e40b9ea7790ff81cc1ebf1101ce7ac4cb552c312bf2be0cc5c3c49f0b727ab0247f46f90
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uricp (0.0.16)
4
+ uricp (0.0.21)
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
 
@@ -14,32 +15,33 @@ GEM
14
15
  childprocess (>= 0.3.6)
15
16
  cucumber (>= 1.1.1)
16
17
  rspec-expectations (>= 2.7.0)
17
- builder (3.2.3)
18
- childprocess (0.9.0)
19
- ffi (~> 1.0, >= 1.0.11)
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.3)
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)
31
31
  inifile (1.1.0)
32
32
  json (1.8.6)
33
- methadone (2.0.0)
33
+ methadone (2.0.2)
34
34
  bundler
35
- multi_json (1.13.1)
35
+ multi_json (1.15.0)
36
36
  multi_test (0.1.2)
37
37
  open4 (1.3.4)
38
- rake (10.4.2)
38
+ rake (12.3.3)
39
39
  rdoc (4.2.2)
40
40
  json (~> 1.4)
41
- rspec-expectations (2.99.2)
42
- diff-lcs (>= 1.1.3, < 2.0)
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 (~> 10.4.0)
55
+ rake (~> 12.3)
54
56
  rdoc (~> 4.2.0)
55
57
  uricp!
56
58
 
57
59
  BUNDLED WITH
58
- 1.16.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
- 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("Trusty, Ruby 1.9.3") {
67
+ stage("Focal, Ruby 2.7.0") {
40
68
  agent {
41
- dockerfile {
42
- dir 'trusty'
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
91
  stage("Xenial, Ruby 2.3.1") {
62
92
  agent {
63
- dockerfile {
64
- dir 'xenial'
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
113
  stage("Bionic, Ruby 2.5.1") {
84
114
  agent {
85
- dockerfile {
86
- dir 'bionic'
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,20 +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 python-setuptools && \
15
- easy_install pip && \
16
- pip install --upgrade setuptools && \
17
- pip install python-swiftclient
18
-
19
- RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
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
@@ -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"