beaker 4.23.0 → 4.23.1

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: 90b746c013603a55023f75c05cfa79a8301fa58729b82a1dcc677067dde77ab1
4
- data.tar.gz: f76631826758f41afb1517224fed593bdf988278bb1c18a23dd6ddea0d74ca8a
3
+ metadata.gz: 442731199e19c2bfbd64dbc64851c80155659e8e7deee3e6512fe05006056efb
4
+ data.tar.gz: 51c93bf9df5a4ef96c3739dbbae19d41ca70e91f03a250a4e6c5418294d7cfc9
5
5
  SHA512:
6
- metadata.gz: 24dc7d2592f0de06a51a6534f9f0014a5075851295926c696b5fd0d2ea835f7f95bf4f630f12c91f645fccf33ab43eb3acb8fe33fd1a841e0ae4bd52a529e3a8
7
- data.tar.gz: 9556e24844dd480c3bab6b30bb6e29db3b34ae4e6a76fd53f47c76fb018d805804eb1e2de87a6798850e1880ea5960cfd90902a99856caff8284f172f0b5f4f6
6
+ metadata.gz: 838c910a425573e64ae111686c1a3b1da59c2cfc4d485b177af8374d103a1879aab0a41fd0f9074a438c0adda41d4acbd3adc55017d7e49a52df79ffc1c91403
7
+ data.tar.gz: 6869be1711abcdeaf5166213ec3ba082e5e1210576c0fab3d777cb0a902793465acd44bd4e36a8ae6e7aa2ebb2be5cf6f4d0f096c65c12c0ac765163e891741c
@@ -20,7 +20,13 @@ The headers used in [Keep a Changelog](http://keepachangelog.com) are:
20
20
  - Fixed - for any bug fixes.
21
21
  - Security - in case of vulnerabilities.
22
22
 
23
- # [Unreleased](https://github.com/puppetlabs/beaker/compare/4.23.0...master)
23
+ # [Unreleased](https://github.com/puppetlabs/beaker/compare/4.23.1...master)
24
+
25
+ # [4.23.1](https://github.com/puppetlabs/beaker/compare/4.23.0...4.23.1)
26
+
27
+ ### Changed/Removed
28
+
29
+ - Reversed the quoting changes on Unix from #1644 in favor of only quoting on Windows. (#1650)
24
30
 
25
31
  # [4.23.0](https://github.com/puppetlabs/beaker/compare/4.22.1...4.23.0)
26
32
 
@@ -133,7 +133,7 @@ module Unix::Exec
133
133
  # @param [String] dir The directory structure to create on the host
134
134
  # @return [Boolean] True, if directory construction succeeded, otherwise False
135
135
  def mkdir_p dir
136
- cmd = "mkdir -p \"#{dir}\""
136
+ cmd = "mkdir -p #{dir}"
137
137
  result = exec(Beaker::Command.new(cmd), :acceptable_exit_codes => [0, 1])
138
138
  result.exit_code == 0
139
139
  end
@@ -150,7 +150,7 @@ module Unix::Exec
150
150
  # @param [Boolean] rm Remove the destination prior to move
151
151
  def mv orig, dest, rm=true
152
152
  rm_rf dest unless !rm
153
- execute("mv \"#{orig}\" \"#{dest}\"")
153
+ execute("mv #{orig} #{dest}")
154
154
  end
155
155
 
156
156
  # Attempt to ping the provided target hostname
@@ -119,6 +119,25 @@ module Windows::Exec
119
119
  false
120
120
  end
121
121
 
122
+ # Create the provided directory structure on the host
123
+ # @param [String] dir The directory structure to create on the host
124
+ # @return [Boolean] True, if directory construction succeeded, otherwise False
125
+ def mkdir_p dir
126
+ cmd = "mkdir -p \"#{dir}\""
127
+ result = exec(Beaker::Command.new(cmd), :acceptable_exit_codes => [0, 1])
128
+ result.exit_code == 0
129
+ end
130
+
131
+ # Move the origin to destination. The destination is removed prior to moving.
132
+ # @param [String] orig The origin path
133
+ # @param [String] dest the destination path
134
+ # @param [Boolean] rm Remove the destination prior to move
135
+ def mv orig, dest, rm=true
136
+ rm_rf dest unless !rm
137
+ execute("mv \"#{orig}\" \"#{dest}\"")
138
+ end
139
+
140
+
122
141
  # Determine if cygwin is actually installed on the SUT. Differs from
123
142
  # is_cygwin?, which is just a type check for a Windows::Host.
124
143
  #
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '4.23.0'
3
+ STRING = '4.23.1'
4
4
  end
5
5
  end
@@ -40,13 +40,13 @@ module Beaker
40
40
 
41
41
  it 'rm first' do
42
42
  expect( instance ).to receive(:execute).with("rm -rf #{destination}").and_return(0)
43
- expect( instance ).to receive(:execute).with("mv \"#{origin}\" \"#{destination}\"").and_return(0)
43
+ expect( instance ).to receive(:execute).with("mv #{origin} #{destination}").and_return(0)
44
44
  expect( instance.mv(origin, destination) ).to be === 0
45
45
 
46
46
  end
47
47
 
48
48
  it 'does not rm' do
49
- expect( instance ).to receive(:execute).with("mv \"#{origin}\" \"#{destination}\"").and_return(0)
49
+ expect( instance ).to receive(:execute).with("mv #{origin} #{destination}").and_return(0)
50
50
  expect( instance.mv(origin, destination, false) ).to be === 0
51
51
  end
52
52
  end
@@ -3,6 +3,7 @@ require 'spec_helper'
3
3
  module Beaker
4
4
  describe Windows::Exec do
5
5
  class WindowsExecTest
6
+ include Unix::Exec
6
7
  include Windows::Exec
7
8
 
8
9
  def initialize(hash, logger)
@@ -78,5 +79,22 @@ module Beaker
78
79
  expect(instance.cygwin_installed?).to eq(false)
79
80
  end
80
81
  end
82
+
83
+ context 'mv' do
84
+ let(:origin) { '/origin/path/of/content' }
85
+ let(:destination) { '/destination/path/of/content' }
86
+
87
+ it 'rm first' do
88
+ expect( instance ).to receive(:execute).with("rm -rf #{destination}").and_return(0)
89
+ expect( instance ).to receive(:execute).with("mv \"#{origin}\" \"#{destination}\"").and_return(0)
90
+ expect( instance.mv(origin, destination) ).to be === 0
91
+
92
+ end
93
+
94
+ it 'does not rm' do
95
+ expect( instance ).to receive(:execute).with("mv \"#{origin}\" \"#{destination}\"").and_return(0)
96
+ expect( instance.mv(origin, destination, false) ).to be === 0
97
+ end
98
+ end
81
99
  end
82
100
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.23.0
4
+ version: 4.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2020-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec