spacepants / puppet-ds_389

Puppet module to manage 389 Directory Server
1 stars 15 forks source link

Beaker acceptance tests failing for debian-82-x64.yml and ubuntu-server-1404-x64.yml due to non-patched bugs with 389-ds-base package from base system repositories #16

Closed codylane closed 6 years ago

codylane commented 6 years ago

Hello,

I've been adding some new functionality to this module and will be submitting a pull request very soon. However, one thing I noticed is that the following beaker acceptance tests are now failing and I have figured out why. It's because we need 389-ds-base >= 1.3.4

These are failing with the same issue:

It is failing because the base 389-ds-base package that comes from the default repositories on Ubuntu or Debian is suffering from this bug https://pagure.io/389-ds-base/issue/48316. Yes, we could patch it but I don't think that is wise to do for this module. Instead, I'm thinking the next best course of action is to create a custom fact for this module so that we can we can better handle when things might go awry from upstream package differences across different operating systems. It will also give us the ability to fail fast if a version of the 389-ds-base package is not a supported or a tested version. What are your thoughts?

But yeah, otherwise, I'm unable to write beaker acceptance tests for those two test environments noted above because there is no easy fix unless we re-create 389-ds-base and all it's associated deps for beaker testing. That just sounds way to tedious and error prone. Compiling from source would also be difficult to do as a pre-step during the beaker test suite. The 389 packages do not seem to be patched for those two distros above so I'm wondering if should update the metadata.json to say we only support Ubuntu 16.04 and above and 389-ds-base >= 1.3.4?

codylane commented 6 years ago

Here's the failing test results.

$ BEAKER_destroy=no be rake beaker:ubuntu-server-1404-x64
...

==> ubuntu-server-1404-x64: Attempting graceful shutdown of VM...
==> ubuntu-server-1404-x64: Booting VM...
==> ubuntu-server-1404-x64: Waiting for machine to boot. This may take a few minutes...
    ubuntu-server-1404-x64: SSH address: 127.0.0.1:2222
    ubuntu-server-1404-x64: SSH username: vagrant
    ubuntu-server-1404-x64: SSH auth method: private key
==> ubuntu-server-1404-x64: Machine booted and ready!
==> ubuntu-server-1404-x64: Checking for guest additions in VM...
==> ubuntu-server-1404-x64: Setting hostname...
==> ubuntu-server-1404-x64: Configuring and enabling network interfaces...
==> ubuntu-server-1404-x64: Mounting shared folders...
    ubuntu-server-1404-x64: /vagrant => /Users/clane/prj/puppet/puppet-ds_389/.vagrant/beaker_vagrant_files/ubuntu-server-1404-x64.yml
Disabling updates.puppetlabs.com by modifying hosts file to resolve updates to 127.0.0.1 on ubuntu-server-1404-x64
localhost $ scp /Users/clane/prj/puppet/puppet-ds_389 ubuntu-server-1404-x64:/etc/puppetlabs/code/modules {:ignore => [".bundle", ".git", ".idea", ".vagrant", ".vendor", "vendor", "acceptance", "bundle", "spec", "tests", "log", ".svn", "junit", "pkg", "example", ".", ".."]}

ds_389 class
  default parameters
localhost $ scp /var/folders/cd/71012kpx07j_yr_zc6xtq2fh0000gn/T/beaker20180422-31518-wm2zz3 ubuntu-server-1404-x64:/tmp/apply_manifest.pp.UX14PJ {:ignore => }
    is expected to work idempotently with no errors (FAILED - 1)
    Port "389"
      should be listening (FAILED - 2)
    Port "636"
      should be listening (FAILED - 3)
    Service "dirsrv@foo"
      should be enabled (FAILED - 4)
      should be running (FAILED - 5)

Failures:

  1) ds_389 class default parameters is expected to work idempotently with no errors
     Failure/Error: apply_manifest(pp, catch_failures: true)
     Beaker::Host::CommandFailure:
       Host 'ubuntu-server-1404-x64' exited with 6 running:
        puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.UX14PJ
       Last 10 lines of output were:
        Notice: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Ds_389::Ssl[foo]/Exec[Restart foo to enable SSL]: Dependency File_line[dirsrv ulimit] has failures: true
        Warning: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Ds_389::Ssl[foo]/Exec[Restart foo to enable SSL]: Skipping because of failed dependencies
        Notice: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Ds_389::Service[foo]/File[/etc/init.d/dirsrv@foo]: Dependency File_line[dirsrv ulimit] has failures: true
        Warning: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Ds_389::Service[foo]/File[/etc/init.d/dirsrv@foo]: Skipping because of failed dependencies
        Notice: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Ds_389::Service[foo]/Service[dirsrv@foo]: Dependency File_line[dirsrv ulimit] has failures: true
        Warning: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Ds_389::Service[foo]/Service[dirsrv@foo]: Skipping because of failed dependencies
        Notice: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Anchor[foo_ldif_modify]: Dependency File_line[dirsrv ulimit] has failures: true
        Warning: /Stage[main]/Ds_389/Ds_389::Instance[foo]/Anchor[foo_ldif_modify]: Skipping because of failed dependencies
        Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
        Notice: Applied catalog in 23.38 seconds

     # ./.bundle/gems/ruby/2.4.0/gems/beaker-3.34.0/lib/beaker/host.rb:375:in `exec'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-3.34.0/lib/beaker/dsl/helpers/host_helpers.rb:83:in `block in on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-3.34.0/lib/beaker/shared/host_manager.rb:127:in `run_block_on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-3.34.0/lib/beaker/dsl/patterns.rb:37:in `block_on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-3.34.0/lib/beaker/dsl/helpers/host_helpers.rb:63:in `on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-puppet-0.13.3/lib/beaker-puppet/helpers/puppet_helpers.rb:505:in `block in apply_manifest_on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-3.34.0/lib/beaker/shared/host_manager.rb:127:in `run_block_on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-3.34.0/lib/beaker/dsl/patterns.rb:37:in `block_on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-puppet-0.13.3/lib/beaker-puppet/helpers/puppet_helpers.rb:434:in `apply_manifest_on'
     # ./.bundle/gems/ruby/2.4.0/gems/beaker-puppet-0.13.3/lib/beaker-puppet/helpers/puppet_helpers.rb:512:in `apply_manifest'
     # ./spec/acceptance/ds_389_spec.rb:22:in `block (3 levels) in <top (required)>'

  2) ds_389 class default parameters Port "389" should be listening
     Failure/Error: it { is_expected.to be_listening }
       expected Port "389" to be listening

     # ./spec/acceptance/ds_389_spec.rb:27:in `block (4 levels) in <top (required)>'

  3) ds_389 class default parameters Port "636" should be listening
     Failure/Error: it { is_expected.to be_listening }
       expected Port "636" to be listening

     # ./spec/acceptance/ds_389_spec.rb:31:in `block (4 levels) in <top (required)>'

  4) ds_389 class default parameters Service "dirsrv@foo" should be enabled
     Failure/Error: it { is_expected.to be_enabled }
       expected Service "dirsrv@foo" to be enabled

     # ./spec/acceptance/ds_389_spec.rb:35:in `block (4 levels) in <top (required)>'

  5) ds_389 class default parameters Service "dirsrv@foo" should be running
     Failure/Error: it { is_expected.to be_running }
       expected Service "dirsrv@foo" to be running

     # ./spec/acceptance/ds_389_spec.rb:36:in `block (4 levels) in <top (required)>'

Finished in 43.28 seconds (files took 2 minutes 15.3 seconds to load)
5 examples, 5 failures

Failed examples:

rspec ./spec/acceptance/ds_389_spec.rb:6 # ds_389 class default parameters is expected to work idempotently with no errors
rspec ./spec/acceptance/ds_389_spec.rb:27 # ds_389 class default parameters Port "389" should be listening
rspec ./spec/acceptance/ds_389_spec.rb:31 # ds_389 class default parameters Port "636" should be listening
rspec ./spec/acceptance/ds_389_spec.rb:35 # ds_389 class default parameters Service "dirsrv@foo" should be enabled
rspec ./spec/acceptance/ds_389_spec.rb:36 # ds_389 class default parameters Service "dirsrv@foo" should be running

I logged into this environment and noted the package versions for 389

root@ubuntu-server-1404-x64:~# dpkg -l | grep 389

ii  389-admin                           1.1.35-0ubuntu1                  amd64        389 Directory Administration Server
ii  389-ds-base                         1.3.2.16-0ubuntu1                amd64        389 Directory Server suite - server
ii  389-ds-base-libs                    1.3.2.16-0ubuntu1                amd64        389 Directory Server suite - libraries
ii  libadminutil-data                   1.1.20-0ubuntu1                  amd64        Utility library for 389ds administration -- data files
ii  libadminutil0:amd64                 1.1.20-0ubuntu1                  amd64        Utility library for 389ds administration
ii  libds-admin-serv0:amd64             1.1.35-0ubuntu1                  amd64        Libraries for the 389 Directory Administration Server

Root Cause:

Solution

spacepants commented 6 years ago

Hey there, thanks for putting this together.

Yeah, let's go ahead and add a custom fact for the version and drop the problematic versions. I'll see if there's a vagrantbox for Debian 9 for Beaker.

codylane commented 6 years ago

Sounds good, I'll get started on this implementation tonight. Should be pretty quick to whip up.

Talk to you soon.

codylane commented 6 years ago

Sorry, I haven't had time to look into this yet. I may have to let this wait until this weekend. I only have time to look into this on my own personal time.

codylane commented 6 years ago

I've decided not to spend any more time on this implementation and will not be working on the version flag constraints as I originally promised. I just don't have the personal free time and no longer really use puppet every day like I used too.

For now, I feel like the easiest and quickest approach would be to update the README with a disclaimer this only works on 389-ds-base >= 1.3.4