beaker-docker 2.4.0 → 2.5.0

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: c3f0bbe394205e745cae22a3fdc5b7fbbfc8c1d249a66c0643965be119889e74
4
- data.tar.gz: 74fcee3180ea629537014d1c584fe7d3823819533a8e0a6ff713dc1414bd8779
3
+ metadata.gz: 1b71f56e85f3587c0e5a206f50e0076dc720ee1439190ff174106433042702df
4
+ data.tar.gz: 6ecc500404ea4ffb79d4e25ad3eaea8dab76dbba20551eae2f48872c638ed44c
5
5
  SHA512:
6
- metadata.gz: d960dca1afe2a89bf8bec6d87c739ca7d0b5cf5def2c9f9c454e6fe47d2cb59b428d2bc89c622932c65218826318fa3e8595bcea51415bfb3c57f064e00be151
7
- data.tar.gz: d2f9001431ded7693d1147ad6f7de4662dab404e826dd234e0947296ddc6617f588ce5a9980e9887c3ecb1394fa4d045328b1c8480ac74e2bb603d97212f63c5
6
+ metadata.gz: c3382b63801a0a3ecaa409337ac240e8b9565892120a2e62285a7436047fae856384476b6d9427cf4ebbbe96b7470bec360d42d6cb765cffcbefe1adce210821
7
+ data.tar.gz: a70861121d80a3e16b1abadf7b03ef1925a04ad8d87c6dfe71abd8e19e0e335ab44ebc16f8c24fba2d2ec483dcbea7681ffcfb303b67a0aca4f0ab717b7390a7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.5.0](https://github.com/voxpupuli/beaker-docker/tree/2.5.0) (2024-09-20)
4
+
5
+ [Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/2.4.0...2.5.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - add ContainerDocker and ContainerSwarm [\#145](https://github.com/voxpupuli/beaker-docker/pull/145) ([evgeni](https://github.com/evgeni))
10
+ - Add ContainerPodman class [\#130](https://github.com/voxpupuli/beaker-docker/pull/130) ([bastelfreak](https://github.com/bastelfreak))
11
+
12
+ **Merged pull requests:**
13
+
14
+ - fix tests after Beaker::Platform refactoring [\#146](https://github.com/voxpupuli/beaker-docker/pull/146) ([evgeni](https://github.com/evgeni))
15
+
3
16
  ## [2.4.0](https://github.com/voxpupuli/beaker-docker/tree/2.4.0) (2024-08-13)
4
17
 
5
18
  [Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/2.3.1...2.4.0)
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'beaker/hypervisor/docker'
4
+
5
+ module Beaker
6
+ class Container < Beaker::Docker
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'beaker/hypervisor/container'
4
+
5
+ module Beaker
6
+ class ContainerDocker < Beaker::Container
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'beaker/hypervisor/container'
4
+
5
+ module Beaker
6
+ class ContainerPodman < Beaker::Container
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'beaker/hypervisor/container'
4
+
5
+ module Beaker
6
+ class ContainerSwarm < Beaker::Container
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeakerDocker
4
- VERSION = '2.4.0'
4
+ VERSION = '2.5.0'
5
5
  end
@@ -6,7 +6,6 @@ require 'fakefs/spec_helpers'
6
6
  module Beaker
7
7
  platforms = [
8
8
  'ubuntu-14.04-x86_64',
9
- 'cumulus-2.2-x86_64',
10
9
  'fedora-22-x86_64',
11
10
  'centos-7-x86_64',
12
11
  'sles-12-x86_64',
@@ -190,14 +189,14 @@ module Beaker
190
189
  end
191
190
 
192
191
  it 'accepts alpine as valid platform' do
193
- host['platform'] = 'alpine-3.8-x86_64'
192
+ host['platform'] = Beaker::Platform.new('alpine-3.8-x86_64')
194
193
  expect(test_container).to receive(:exec).at_least(:twice)
195
194
  docker.install_ssh_components(test_container, host)
196
195
  end
197
196
 
198
197
  it 'raises an error with an unsupported platform' do
199
- host['platform'] = 'boogeyman-2000-x86_64'
200
- expect { docker.install_ssh_components(test_container, host) }.to raise_error(RuntimeError, /boogeyman/)
198
+ host['platform'] = Beaker::Platform.new('windows-11-64')
199
+ expect { docker.install_ssh_components(test_container, host) }.to raise_error(RuntimeError, /windows/)
201
200
  end
202
201
  end
203
202
 
@@ -632,16 +631,16 @@ module Beaker
632
631
  describe '#dockerfile_for' do
633
632
  FakeFS.deactivate!
634
633
  it 'raises on an unsupported platform' do
635
- expect { docker.send(:dockerfile_for, { 'platform' => 'a_sidewalk', 'image' => 'foobar' }) }.to raise_error(/platform a_sidewalk not yet supported/)
634
+ expect { docker.send(:dockerfile_for, make_host('none', { 'platform' => 'solaris-11-64', 'image' => 'foobar' })) }.to raise_error(/platform solaris-11-64 not yet supported/)
636
635
  end
637
636
 
638
637
  it 'sets "ENV container docker"' do
639
638
  FakeFS.deactivate!
640
639
  platforms.each do |platform|
641
- dockerfile = docker.send(:dockerfile_for, {
642
- 'platform' => platform,
643
- 'image' => 'foobar',
644
- })
640
+ dockerfile = docker.send(:dockerfile_for, make_host('none', {
641
+ 'platform' => platform,
642
+ 'image' => 'foobar',
643
+ }))
645
644
  expect(dockerfile).to match(/ENV container docker/)
646
645
  end
647
646
  end
@@ -649,15 +648,15 @@ module Beaker
649
648
  it 'adds docker_image_first_commands as RUN statements' do
650
649
  FakeFS.deactivate!
651
650
  platforms.each do |platform|
652
- dockerfile = docker.send(:dockerfile_for, {
653
- 'platform' => platform,
654
- 'image' => 'foobar',
655
- 'docker_image_first_commands' => [
656
- 'special one',
657
- 'special two',
658
- 'special three',
659
- ],
660
- })
651
+ dockerfile = docker.send(:dockerfile_for, make_host('none', {
652
+ 'platform' => platform,
653
+ 'image' => 'foobar',
654
+ 'docker_image_first_commands' => [
655
+ 'special one',
656
+ 'special two',
657
+ 'special three',
658
+ ],
659
+ }))
661
660
 
662
661
  expect(dockerfile).to match(/RUN special one\nRUN special two\nRUN special three/)
663
662
  end
@@ -666,15 +665,15 @@ module Beaker
666
665
  it 'adds docker_image_commands as RUN statements' do
667
666
  FakeFS.deactivate!
668
667
  platforms.each do |platform|
669
- dockerfile = docker.send(:dockerfile_for, {
670
- 'platform' => platform,
671
- 'image' => 'foobar',
672
- 'docker_image_commands' => [
673
- 'special one',
674
- 'special two',
675
- 'special three',
676
- ],
677
- })
668
+ dockerfile = docker.send(:dockerfile_for, make_host('none', {
669
+ 'platform' => platform,
670
+ 'image' => 'foobar',
671
+ 'docker_image_commands' => [
672
+ 'special one',
673
+ 'special two',
674
+ 'special three',
675
+ ],
676
+ }))
678
677
 
679
678
  expect(dockerfile).to match(/RUN special one\nRUN special two\nRUN special three/)
680
679
  end
@@ -683,11 +682,11 @@ module Beaker
683
682
  it 'adds docker_image_entrypoint' do
684
683
  FakeFS.deactivate!
685
684
  platforms.each do |platform|
686
- dockerfile = docker.send(:dockerfile_for, {
687
- 'platform' => platform,
688
- 'image' => 'foobar',
689
- 'docker_image_entrypoint' => '/bin/bash',
690
- })
685
+ dockerfile = docker.send(:dockerfile_for, make_host('none', {
686
+ 'platform' => platform,
687
+ 'image' => 'foobar',
688
+ 'docker_image_entrypoint' => '/bin/bash',
689
+ }))
691
690
 
692
691
  expect(dockerfile).to match(%r{ENTRYPOINT /bin/bash})
693
692
  end
@@ -695,10 +694,10 @@ module Beaker
695
694
 
696
695
  it 'uses zypper on sles' do
697
696
  FakeFS.deactivate!
698
- dockerfile = docker.send(:dockerfile_for, {
699
- 'platform' => 'sles-12-x86_64',
700
- 'image' => 'foobar',
701
- })
697
+ dockerfile = docker.send(:dockerfile_for, make_host('none', {
698
+ 'platform' => Beaker::Platform.new('sles-12-x86_64'),
699
+ 'image' => 'foobar',
700
+ }))
702
701
 
703
702
  expect(dockerfile).to match(/zypper -n in openssh/)
704
703
  end
@@ -706,10 +705,10 @@ module Beaker
706
705
  (22..39).to_a.each do |fedora_release|
707
706
  it "uses dnf on fedora #{fedora_release}" do
708
707
  FakeFS.deactivate!
709
- dockerfile = docker.send(:dockerfile_for, {
710
- 'platform' => "fedora-#{fedora_release}-x86_64",
711
- 'image' => 'foobar',
712
- })
708
+ dockerfile = docker.send(:dockerfile_for, make_host('none', {
709
+ 'platform' => Beaker::Platform.new("fedora-#{fedora_release}-x86_64"),
710
+ 'image' => 'foobar',
711
+ }))
713
712
 
714
713
  expect(dockerfile).to match(/dnf install -y sudo/)
715
714
  end
@@ -717,14 +716,14 @@ module Beaker
717
716
 
718
717
  it 'uses pacman on archlinux' do
719
718
  FakeFS.deactivate!
720
- dockerfile = docker.send(:dockerfile_for, {
721
- 'platform' => 'archlinux-current-x86_64',
722
- 'image' => 'foobar',
723
- })
719
+ dockerfile = docker.send(:dockerfile_for, make_host('none', {
720
+ 'platform' => Beaker::Platform.new('archlinux-current-x86_64'),
721
+ 'image' => 'foobar',
722
+ }))
724
723
 
725
724
  expect(dockerfile).to match(/pacman --sync --refresh --noconfirm archlinux-keyring/)
726
725
  expect(dockerfile).to match(/pacman --sync --refresh --noconfirm --sysupgrade/)
727
- expect(dockerfile).to match(/pacman --sync --noconfirm curl ntp net-tools openssh/)
726
+ expect(dockerfile).to match(/pacman --sync --noconfirm curl net-tools openssh/)
728
727
  end
729
728
  end
730
729
 
@@ -747,21 +746,21 @@ module Beaker
747
746
  end
748
747
 
749
748
  it 'execs sshd on alpine' do
750
- host['platform'] = 'alpine-3.8-x86_64'
749
+ host['platform'] = Beaker::Platform.new('alpine-3.8-x86_64')
751
750
  expect(test_container).to receive(:exec).with(array_including('sed'))
752
751
  expect(test_container).to receive(:exec).with(%w[/usr/sbin/sshd])
753
752
  docker.send(:fix_ssh, test_container, host)
754
753
  end
755
754
 
756
755
  it 'restarts ssh service on ubuntu' do
757
- host['platform'] = 'ubuntu-20.04-x86_64'
756
+ host['platform'] = Beaker::Platform.new('ubuntu-20.04-x86_64')
758
757
  expect(test_container).to receive(:exec).with(array_including('sed'))
759
758
  expect(test_container).to receive(:exec).with(%w[service ssh restart])
760
759
  docker.send(:fix_ssh, test_container, host)
761
760
  end
762
761
 
763
762
  it 'restarts sshd service otherwise' do
764
- host['platform'] = 'boogeyman-2000-x86_64'
763
+ host['platform'] = Beaker::Platform.new('centos-6-x86_64')
765
764
  expect(test_container).to receive(:exec).with(array_including('sed'))
766
765
  expect(test_container).to receive(:exec).with(%w[service sshd restart])
767
766
  docker.send(:fix_ssh, test_container, host)
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: 2.4.0
4
+ version: 2.5.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: 2024-08-13 00:00:00.000000000 Z
14
+ date: 2024-09-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fakefs
@@ -151,6 +151,10 @@ files:
151
151
  - docker.md
152
152
  - lib/beaker-docker.rb
153
153
  - lib/beaker-docker/version.rb
154
+ - lib/beaker/hypervisor/container.rb
155
+ - lib/beaker/hypervisor/container_docker.rb
156
+ - lib/beaker/hypervisor/container_podman.rb
157
+ - lib/beaker/hypervisor/container_swarm.rb
154
158
  - lib/beaker/hypervisor/docker.rb
155
159
  - spec/beaker/hypervisor/docker_spec.rb
156
160
  - spec/spec_helper.rb
@@ -176,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
180
  - !ruby/object:Gem::Version
177
181
  version: '0'
178
182
  requirements: []
179
- rubygems_version: 3.5.11
183
+ rubygems_version: 3.5.16
180
184
  signing_key:
181
185
  specification_version: 4
182
186
  summary: Docker hypervisor for Beaker acceptance testing framework