beaker 4.23.0 → 4.23.1
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/CHANGELOG.md +7 -1
- data/lib/beaker/host/unix/exec.rb +2 -2
- data/lib/beaker/host/windows/exec.rb +19 -0
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host/unix/exec_spec.rb +2 -2
- data/spec/beaker/host/windows/exec_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 442731199e19c2bfbd64dbc64851c80155659e8e7deee3e6512fe05006056efb
|
4
|
+
data.tar.gz: 51c93bf9df5a4ef96c3739dbbae19d41ca70e91f03a250a4e6c5418294d7cfc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 838c910a425573e64ae111686c1a3b1da59c2cfc4d485b177af8374d103a1879aab0a41fd0f9074a438c0adda41d4acbd3adc55017d7e49a52df79ffc1c91403
|
7
|
+
data.tar.gz: 6869be1711abcdeaf5166213ec3ba082e5e1210576c0fab3d777cb0a902793465acd44bd4e36a8ae6e7aa2ebb2be5cf6f4d0f096c65c12c0ac765163e891741c
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
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
|
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
|
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
|
#
|
data/lib/beaker/version.rb
CHANGED
@@ -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
|
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
|
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.
|
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-
|
11
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|