beaker-docker 1.2.0 → 1.4.0
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/.github/dependabot.yml +9 -0
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +39 -3
- data/.gitignore +1 -0
- data/.rubocop.yml +30 -0
- data/.rubocop_todo.yml +742 -0
- data/CHANGELOG.md +26 -0
- data/Gemfile +3 -3
- data/Rakefile +12 -9
- data/beaker-docker.gemspec +4 -0
- data/lib/beaker/hypervisor/docker.rb +88 -102
- data/lib/beaker-docker/version.rb +1 -1
- data/spec/beaker/hypervisor/docker_spec.rb +44 -5
- metadata +60 -2
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.4.0](https://github.com/voxpupuli/beaker-docker/tree/1.4.0) (2023-03-09)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/1.3.0...1.4.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Enable Rubocop [\#72](https://github.com/voxpupuli/beaker-docker/pull/72) ([jay7x](https://github.com/jay7x))
|
10
|
+
- Refactor built-in Dockerfile and fix\_ssh\(\) [\#71](https://github.com/voxpupuli/beaker-docker/pull/71) ([jay7x](https://github.com/jay7x))
|
11
|
+
|
12
|
+
**Fixed bugs:**
|
13
|
+
|
14
|
+
- set flag for container to container communication [\#84](https://github.com/voxpupuli/beaker-docker/pull/84) ([rwaffen](https://github.com/rwaffen))
|
15
|
+
|
16
|
+
**Merged pull requests:**
|
17
|
+
|
18
|
+
- Bump actions/checkout from 2 to 3 [\#90](https://github.com/voxpupuli/beaker-docker/pull/90) ([dependabot[bot]](https://github.com/apps/dependabot))
|
19
|
+
- dependabot: check for github actions as well [\#89](https://github.com/voxpupuli/beaker-docker/pull/89) ([bastelfreak](https://github.com/bastelfreak))
|
20
|
+
|
21
|
+
## [1.3.0](https://github.com/voxpupuli/beaker-docker/tree/1.3.0) (2022-12-18)
|
22
|
+
|
23
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/1.2.0...1.3.0)
|
24
|
+
|
25
|
+
**Implemented enhancements:**
|
26
|
+
|
27
|
+
- Generate a ssh port from 1025..9999 range [\#68](https://github.com/voxpupuli/beaker-docker/pull/68) ([jay7x](https://github.com/jay7x))
|
28
|
+
|
3
29
|
## [1.2.0](https://github.com/voxpupuli/beaker-docker/tree/1.2.0) (2022-08-11)
|
4
30
|
|
5
31
|
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/1.1.1...1.2.0)
|
data/Gemfile
CHANGED
@@ -6,9 +6,9 @@ if File.exists? "#{__FILE__}.local"
|
|
6
6
|
eval(File.read("#{__FILE__}.local"), binding)
|
7
7
|
end
|
8
8
|
|
9
|
-
group :coverage, optional: ENV['COVERAGE']!='yes' do
|
10
|
-
gem 'simplecov-console', :
|
11
|
-
gem 'codecov', :
|
9
|
+
group :coverage, optional: ENV['COVERAGE'] != 'yes' do
|
10
|
+
gem 'simplecov-console', require: false
|
11
|
+
gem 'codecov', require: false
|
12
12
|
end
|
13
13
|
|
14
14
|
group :release do
|
data/Rakefile
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
require 'rspec/core/rake_task'
|
2
2
|
|
3
|
-
namespace :
|
3
|
+
namespace :lint do
|
4
|
+
require 'rubocop/rake_task'
|
5
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
6
|
+
# Use Rubocop's Github Actions formatter
|
7
|
+
if ENV['GITHUB_ACTIONS'] == 'true'
|
8
|
+
task.formatters << 'github'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
4
12
|
|
13
|
+
namespace :test do
|
5
14
|
namespace :spec do
|
6
|
-
|
7
15
|
desc "Run spec tests"
|
8
16
|
RSpec::Core::RakeTask.new(:run) do |t|
|
9
17
|
t.rspec_opts = ['--color', '--format documentation']
|
@@ -16,11 +24,9 @@ namespace :test do
|
|
16
24
|
t.rspec_opts = ['--color', '--format documentation']
|
17
25
|
t.pattern = 'spec/'
|
18
26
|
end
|
19
|
-
|
20
27
|
end
|
21
28
|
|
22
29
|
namespace :acceptance do
|
23
|
-
|
24
30
|
desc <<-EOS
|
25
31
|
A quick acceptance test, named because it has no pre-suites to run
|
26
32
|
EOS
|
@@ -32,9 +38,8 @@ A quick acceptance test, named because it has no pre-suites to run
|
|
32
38
|
beaker_test_base_dir = File.join(beaker_gem_dir, 'acceptance/tests/base')
|
33
39
|
load_path_option = File.join(beaker_gem_dir, 'acceptance/lib')
|
34
40
|
|
35
|
-
ENV['BEAKER_setfile'] = 'acceptance/config/nodes/hosts.yaml'
|
41
|
+
ENV['BEAKER_setfile'] = 'acceptance/config/nodes/hosts.yaml' unless ENV.key?('BEAKER_setfile')
|
36
42
|
sh("beaker",
|
37
|
-
"--hosts", "acceptance/config/nodes/hosts.yaml",
|
38
43
|
# We can't run these tests until the rsync support in the main
|
39
44
|
# beaker/host.rb is updated to work with passwords.
|
40
45
|
# "--tests", beaker_test_base_dir,
|
@@ -43,9 +48,7 @@ A quick acceptance test, named because it has no pre-suites to run
|
|
43
48
|
"--log-level", "debug",
|
44
49
|
"--debug")
|
45
50
|
end
|
46
|
-
|
47
51
|
end
|
48
|
-
|
49
52
|
end
|
50
53
|
|
51
54
|
# namespace-named default tasks.
|
@@ -55,6 +58,7 @@ task 'test:spec' => 'test:spec:run'
|
|
55
58
|
task 'test:acceptance' => 'test:acceptance:quick'
|
56
59
|
|
57
60
|
# global defaults
|
61
|
+
task :lint => %i[lint:rubocop]
|
58
62
|
task :test => 'test:spec'
|
59
63
|
task :default => :test
|
60
64
|
|
@@ -90,7 +94,6 @@ task :docs => 'docs:clear' do
|
|
90
94
|
end
|
91
95
|
|
92
96
|
namespace :docs do
|
93
|
-
|
94
97
|
desc 'Clear the generated documentation cache'
|
95
98
|
task :clear do
|
96
99
|
original_dir = Dir.pwd
|
data/beaker-docker.gemspec
CHANGED
@@ -27,6 +27,10 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_development_dependency 'rspec-its', '~> 1.3'
|
28
28
|
s.add_development_dependency 'fakefs', '~> 1.3'
|
29
29
|
s.add_development_dependency 'rake', '~> 13.0'
|
30
|
+
s.add_development_dependency 'rubocop', '~> 1.12.0'
|
31
|
+
s.add_development_dependency 'rubocop-performance', '~> 1.10'
|
32
|
+
s.add_development_dependency 'rubocop-rake', '~> 0.2'
|
33
|
+
s.add_development_dependency 'rubocop-rspec', '>= 1.44'
|
30
34
|
|
31
35
|
# Run time dependencies
|
32
36
|
s.add_runtime_dependency 'stringify-hash', '~> 0.0.0'
|
@@ -30,7 +30,7 @@ module Beaker
|
|
30
30
|
* Check your DOCKER_HOST variable has been set
|
31
31
|
* If you are on OSX or Windows, you might not have Docker Machine setup correctly: https://docs.docker.com/machine/
|
32
32
|
* If you are using rootless podman, you might need to set up your local socket and service
|
33
|
-
|
33
|
+
ERRMSG
|
34
34
|
end
|
35
35
|
|
36
36
|
# Pass on all the logging from docker-api to the beaker logger instance
|
@@ -78,7 +78,7 @@ module Beaker
|
|
78
78
|
'Hostname' => host.name,
|
79
79
|
'HostConfig' => {
|
80
80
|
'PortBindings' => {
|
81
|
-
'22/tcp' => [{ 'HostPort' => rand.to_s
|
81
|
+
'22/tcp' => [{ 'HostPort' => rand(1025..9999).to_s, 'HostIp' => '0.0.0.0'}]
|
82
82
|
},
|
83
83
|
'PublishAllPorts' => true,
|
84
84
|
'RestartPolicy' => {
|
@@ -142,9 +142,9 @@ module Beaker
|
|
142
142
|
port: nil
|
143
143
|
}
|
144
144
|
|
145
|
-
container_json
|
145
|
+
container_json = container.json
|
146
146
|
network_settings = container_json['NetworkSettings']
|
147
|
-
host_config
|
147
|
+
host_config = container_json['HostConfig']
|
148
148
|
|
149
149
|
ip = nil
|
150
150
|
port = nil
|
@@ -161,9 +161,10 @@ module Beaker
|
|
161
161
|
|
162
162
|
# Host to Container
|
163
163
|
port22 = network_settings.dig('PortBindings','22/tcp')
|
164
|
-
if port22.nil? && network_settings.key?('Ports')
|
164
|
+
if port22.nil? && network_settings.key?('Ports') && !nested_docker?
|
165
165
|
port22 = network_settings.dig('Ports','22/tcp')
|
166
166
|
end
|
167
|
+
|
167
168
|
ip = port22[0]['HostIp'] if port22
|
168
169
|
port = port22[0]['HostPort'] if port22
|
169
170
|
|
@@ -216,7 +217,6 @@ module Beaker
|
|
216
217
|
@hosts.each do |host|
|
217
218
|
@logger.notify "provisioning #{host.name}"
|
218
219
|
|
219
|
-
|
220
220
|
image = get_container_image(host)
|
221
221
|
|
222
222
|
if host['tag']
|
@@ -510,145 +510,132 @@ module Beaker
|
|
510
510
|
|
511
511
|
def dockerfile_for(host)
|
512
512
|
# specify base image
|
513
|
-
dockerfile =
|
513
|
+
dockerfile = <<~DF
|
514
514
|
FROM #{host['image']}
|
515
515
|
ENV container docker
|
516
|
-
|
516
|
+
DF
|
517
517
|
|
518
518
|
# Commands before any other commands. Can be used for eg. proxy configuration
|
519
|
-
dockerfile += (host['docker_image_first_commands'] || []).map { |
|
520
|
-
"RUN #{command}\n"
|
521
|
-
}.join('')
|
522
|
-
|
523
|
-
# additional options to specify to the sshd
|
524
|
-
# may vary by platform
|
525
|
-
sshd_options = ''
|
519
|
+
dockerfile += (host['docker_image_first_commands'] || []).map { |cmd| "RUN #{cmd}\n" }.join('')
|
526
520
|
|
527
521
|
# add platform-specific actions
|
528
|
-
service_name =
|
522
|
+
service_name = 'sshd'
|
529
523
|
additional_packages = host_packages(host)
|
530
524
|
case host['platform']
|
531
525
|
when /ubuntu/, /debian/
|
532
|
-
service_name =
|
533
|
-
dockerfile += <<~
|
534
|
-
RUN apt-get update
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
when
|
539
|
-
|
540
|
-
RUN apt-get update
|
541
|
-
|
542
|
-
|
526
|
+
service_name = 'ssh'
|
527
|
+
dockerfile += <<~DF
|
528
|
+
RUN apt-get update \
|
529
|
+
&& apt-get install -y openssh-server openssh-client #{additional_packages.join(' ')} \
|
530
|
+
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/*
|
531
|
+
DF
|
532
|
+
when /cumulus/
|
533
|
+
dockerfile += <<~DF
|
534
|
+
RUN apt-get update \
|
535
|
+
&& apt-get install -y openssh-server openssh-client #{additional_packages.join(' ')}
|
536
|
+
DF
|
543
537
|
when /el-[89]/, /fedora-(2[2-9]|3)/
|
544
|
-
dockerfile += <<~
|
545
|
-
RUN dnf clean all
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
538
|
+
dockerfile += <<~DF
|
539
|
+
RUN dnf clean all \
|
540
|
+
&& dnf install -y sudo openssh-server openssh-clients #{additional_packages.join(' ')} \
|
541
|
+
&& ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \
|
542
|
+
&& ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \
|
543
|
+
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/*
|
544
|
+
DF
|
551
545
|
when /^el-/, /centos/, /fedora/, /redhat/, /eos/
|
552
|
-
dockerfile += <<~
|
553
|
-
RUN yum clean all
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
546
|
+
dockerfile += <<~DF
|
547
|
+
RUN yum clean all \
|
548
|
+
&& yum install -y sudo openssh-server openssh-clients #{additional_packages.join(' ')} \
|
549
|
+
&& ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \
|
550
|
+
&& ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \
|
551
|
+
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/*
|
552
|
+
DF
|
559
553
|
when /opensuse/, /sles/
|
560
|
-
dockerfile += <<~
|
561
|
-
RUN zypper -n in openssh #{additional_packages.join(' ')}
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
554
|
+
dockerfile += <<~DF
|
555
|
+
RUN zypper -n in openssh #{additional_packages.join(' ')} \
|
556
|
+
&& ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \
|
557
|
+
&& ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \
|
558
|
+
&& sed -ri 's/^#?UsePAM .*/UsePAM no/' /etc/ssh/sshd_config \
|
559
|
+
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/*
|
560
|
+
DF
|
567
561
|
when /archlinux/
|
568
|
-
dockerfile += <<~
|
569
|
-
RUN pacman --sync --refresh --noconfirm archlinux-keyring
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
562
|
+
dockerfile += <<~DF
|
563
|
+
RUN pacman --sync --refresh --noconfirm archlinux-keyring \
|
564
|
+
&& pacman --sync --refresh --noconfirm --sysupgrade \
|
565
|
+
&& pacman --sync --noconfirm #{additional_packages.join(' ')} \
|
566
|
+
&& ssh-keygen -A \
|
567
|
+
&& sed -ri 's/^#?UsePAM .*/UsePAM no/' /etc/ssh/sshd_config \
|
568
|
+
&& systemctl enable sshd
|
569
|
+
DF
|
576
570
|
else
|
577
|
-
# TODO add more platform steps here
|
571
|
+
# TODO: add more platform steps here
|
578
572
|
raise "platform #{host['platform']} not yet supported on docker"
|
579
573
|
end
|
580
574
|
|
581
575
|
# Make sshd directory, set root password
|
582
|
-
dockerfile += <<~
|
583
|
-
RUN mkdir -p /var/run/sshd
|
584
|
-
|
585
|
-
|
576
|
+
dockerfile += <<~DF
|
577
|
+
RUN mkdir -p /var/run/sshd \
|
578
|
+
&& echo root:#{root_password} | chpasswd
|
579
|
+
DF
|
586
580
|
|
587
581
|
# Configure sshd service to allowroot login using password
|
588
582
|
# Also, disable reverse DNS lookups to prevent every. single. ssh
|
589
583
|
# operation taking 30 seconds while the lookup times out.
|
590
|
-
|
591
|
-
|
592
|
-
RUN sed -ri
|
593
|
-
|
594
|
-
|
595
|
-
|
584
|
+
# Also unbreak users with a bunch of SSH keys loaded in their keyring.
|
585
|
+
dockerfile += <<~DF
|
586
|
+
RUN sed -ri \
|
587
|
+
-e 's/^#?PermitRootLogin .*/PermitRootLogin yes/' \
|
588
|
+
-e 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/' \
|
589
|
+
-e 's/^#?UseDNS .*/UseDNS no/' \
|
590
|
+
-e 's/^#?MaxAuthTries.*/MaxAuthTries 1000/' \
|
591
|
+
/etc/ssh/sshd_config
|
592
|
+
DF
|
596
593
|
|
597
594
|
# Any extra commands specified for the host
|
598
|
-
dockerfile += (host['docker_image_commands'] || []).map { |
|
599
|
-
"RUN #{command}\n"
|
600
|
-
}.join('')
|
595
|
+
dockerfile += (host['docker_image_commands'] || []).map { |cmd| "RUN #{cmd}\n" }.join('')
|
601
596
|
|
602
597
|
# Override image entrypoint
|
603
|
-
if host['docker_image_entrypoint']
|
604
|
-
dockerfile += "ENTRYPOINT #{host['docker_image_entrypoint']}\n"
|
605
|
-
end
|
598
|
+
dockerfile += "ENTRYPOINT #{host['docker_image_entrypoint']}\n" if host['docker_image_entrypoint']
|
606
599
|
|
607
600
|
# How to start a sshd on port 22. May be an init for more supervision
|
608
601
|
# Ensure that the ssh server can be restarted (done from set_env) and container keeps running
|
609
|
-
cmd = host['docker_cmd'] || [
|
610
|
-
dockerfile +=
|
602
|
+
cmd = host['docker_cmd'] || ['sh', '-c', "service #{service_name} start; tail -f /dev/null"]
|
603
|
+
dockerfile += <<~DF
|
611
604
|
EXPOSE 22
|
612
605
|
CMD #{cmd}
|
613
|
-
|
614
|
-
|
615
|
-
# end
|
606
|
+
DF
|
616
607
|
|
617
608
|
@logger.debug("Dockerfile is #{dockerfile}")
|
618
|
-
|
609
|
+
|
610
|
+
dockerfile
|
619
611
|
end
|
620
612
|
|
621
613
|
# a puppet run may have changed the ssh config which would
|
622
614
|
# keep us out of the container. This is a best effort to fix it.
|
623
615
|
# Optionally pass in a host object to to determine which ssh
|
624
616
|
# restart command we should try.
|
625
|
-
def fix_ssh(container, host=nil)
|
617
|
+
def fix_ssh(container, host = nil)
|
626
618
|
@logger.debug("Fixing ssh on container #{container.id}")
|
627
|
-
container.exec(['sed','-ri',
|
628
|
-
's/^#?PermitRootLogin .*/PermitRootLogin yes/',
|
629
|
-
'/
|
630
|
-
|
631
|
-
|
619
|
+
container.exec(['sed', '-ri',
|
620
|
+
'-e', 's/^#?PermitRootLogin .*/PermitRootLogin yes/',
|
621
|
+
'-e', 's/^#?PasswordAuthentication .*/PasswordAuthentication yes/',
|
622
|
+
'-e', 's/^#?UseDNS .*/UseDNS no/',
|
623
|
+
# Unbreak users with a bunch of SSH keys loaded in their keyring.
|
624
|
+
'-e', 's/^#?MaxAuthTries.*/MaxAuthTries 1000/',
|
632
625
|
'/etc/ssh/sshd_config'])
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
if host['platform'] =~ /alpine/
|
644
|
-
container.exec(%w(/usr/sbin/sshd))
|
645
|
-
else
|
646
|
-
container.exec(%w(service ssh restart))
|
647
|
-
end
|
626
|
+
|
627
|
+
return unless host
|
628
|
+
|
629
|
+
case host['platform']
|
630
|
+
when /alpine/
|
631
|
+
container.exec(%w[/usr/sbin/sshd])
|
632
|
+
when /ubuntu/, /debian/
|
633
|
+
container.exec(%w[service ssh restart])
|
634
|
+
else
|
635
|
+
container.exec(%w[service sshd restart])
|
648
636
|
end
|
649
637
|
end
|
650
638
|
|
651
|
-
|
652
639
|
# return the existing container if we're not provisioning
|
653
640
|
# and docker_container_name is set
|
654
641
|
def find_container(host)
|
@@ -679,6 +666,5 @@ module Beaker
|
|
679
666
|
def in_container?
|
680
667
|
return File.file?('/.dockerenv')
|
681
668
|
end
|
682
|
-
|
683
669
|
end
|
684
670
|
end
|
@@ -746,7 +746,7 @@ module Beaker
|
|
746
746
|
'image' => 'foobar',
|
747
747
|
})
|
748
748
|
|
749
|
-
expect( dockerfile ).to be =~ /
|
749
|
+
expect( dockerfile ).to be =~ /zypper -n in openssh/
|
750
750
|
end
|
751
751
|
|
752
752
|
(22..39).to_a.each do | fedora_release |
|
@@ -757,7 +757,7 @@ module Beaker
|
|
757
757
|
'image' => 'foobar',
|
758
758
|
})
|
759
759
|
|
760
|
-
expect( dockerfile ).to be =~ /
|
760
|
+
expect( dockerfile ).to be =~ /dnf install -y sudo/
|
761
761
|
end
|
762
762
|
end
|
763
763
|
|
@@ -768,9 +768,48 @@ module Beaker
|
|
768
768
|
'image' => 'foobar',
|
769
769
|
})
|
770
770
|
|
771
|
-
expect( dockerfile ).to match(/
|
772
|
-
expect( dockerfile ).to match(/
|
773
|
-
expect( dockerfile ).to match(/
|
771
|
+
expect( dockerfile ).to match(/pacman --sync --refresh --noconfirm archlinux-keyring/)
|
772
|
+
expect( dockerfile ).to match(/pacman --sync --refresh --noconfirm --sysupgrade/)
|
773
|
+
expect( dockerfile ).to match(/pacman --sync --noconfirm curl ntp net-tools openssh/)
|
774
|
+
end
|
775
|
+
end
|
776
|
+
|
777
|
+
describe '#fix_ssh' do
|
778
|
+
let(:test_container) { double('container') }
|
779
|
+
let(:host) { hosts[0] }
|
780
|
+
before :each do
|
781
|
+
expect(test_container).to receive(:id).and_return('abcdef')
|
782
|
+
end
|
783
|
+
|
784
|
+
it 'should call exec once when called without host' do
|
785
|
+
expect(test_container).to receive(:exec).once.with(
|
786
|
+
include(/PermitRootLogin/) &&
|
787
|
+
include(/PasswordAuthentication/) &&
|
788
|
+
include(/UseDNS/) &&
|
789
|
+
include(/MaxAuthTries/)
|
790
|
+
)
|
791
|
+
docker.send(:fix_ssh, test_container)
|
792
|
+
end
|
793
|
+
|
794
|
+
it 'should exec sshd on alpine' do
|
795
|
+
host['platform'] = 'alpine-3.8-x86_64'
|
796
|
+
expect(test_container).to receive(:exec).with(array_including('sed'))
|
797
|
+
expect(test_container).to receive(:exec).with(%w[/usr/sbin/sshd])
|
798
|
+
docker.send(:fix_ssh, test_container, host)
|
799
|
+
end
|
800
|
+
|
801
|
+
it 'should restart ssh service on ubuntu' do
|
802
|
+
host['platform'] = 'ubuntu-20.04-x86_64'
|
803
|
+
expect(test_container).to receive(:exec).with(array_including('sed'))
|
804
|
+
expect(test_container).to receive(:exec).with(%w[service ssh restart])
|
805
|
+
docker.send(:fix_ssh, test_container, host)
|
806
|
+
end
|
807
|
+
|
808
|
+
it 'should restart sshd service otherwise' do
|
809
|
+
host['platform'] = 'boogeyman-2000-x86_64'
|
810
|
+
expect(test_container).to receive(:exec).with(array_including('sed'))
|
811
|
+
expect(test_container).to receive(:exec).with(%w[service sshd restart])
|
812
|
+
docker.send(:fix_ssh, test_container, host)
|
774
813
|
end
|
775
814
|
end
|
776
815
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2023-03-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -69,6 +69,62 @@ dependencies:
|
|
69
69
|
- - "~>"
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '13.0'
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: rubocop
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - "~>"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 1.12.0
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.12.0
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: rubocop-performance
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - "~>"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '1.10'
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '1.10'
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: rubocop-rake
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - "~>"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0.2'
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - "~>"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0.2'
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: rubocop-rspec
|
116
|
+
requirement: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '1.44'
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '1.44'
|
72
128
|
- !ruby/object:Gem::Dependency
|
73
129
|
name: stringify-hash
|
74
130
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,6 +179,8 @@ files:
|
|
123
179
|
- ".github/workflows/release.yml"
|
124
180
|
- ".github/workflows/test.yml"
|
125
181
|
- ".gitignore"
|
182
|
+
- ".rubocop.yml"
|
183
|
+
- ".rubocop_todo.yml"
|
126
184
|
- ".simplecov"
|
127
185
|
- CHANGELOG.md
|
128
186
|
- Gemfile
|