Skip to content

(PE-37704) Allow for SLES-11 (Intel) builds to be installed in PE 2021.7.x for testing#259

Merged
nmburgan merged 1 commit into
puppetlabs:mainfrom
shubhamshinde360:PE-37704
Mar 19, 2024
Merged

(PE-37704) Allow for SLES-11 (Intel) builds to be installed in PE 2021.7.x for testing#259
nmburgan merged 1 commit into
puppetlabs:mainfrom
shubhamshinde360:PE-37704

Conversation

@shubhamshinde360

@shubhamshinde360 shubhamshinde360 commented Mar 11, 2024

Copy link
Copy Markdown
Contributor
  • Define method to install sles-11 rpm from agent-downloads since it is not present in PE.
  • Define rspec to test the above method.
  • Adds a new mock sles11 host to the hosts list for the rspec.
  • Expect get_mco_setting() to be received twice instead of once for the subject, one for osx host (already existed before this commit), another for sles11 host (added in this commit).

@shubhamshinde360 shubhamshinde360 requested review from a team as code owners March 11, 2024 19:20
@shubhamshinde360 shubhamshinde360 marked this pull request as draft March 11, 2024 19:30
@shubhamshinde360 shubhamshinde360 marked this pull request as ready for review March 11, 2024 19:31
@shubhamshinde360 shubhamshinde360 marked this pull request as draft March 11, 2024 19:34
Comment thread lib/beaker-pe/install/pe_utils.rb Outdated
@joshcooper

Copy link
Copy Markdown
Contributor

@shubhamshinde360 shubhamshinde360 marked this pull request as ready for review March 13, 2024 18:54
Comment thread lib/beaker-pe/install/pe_utils.rb Outdated
Comment thread lib/beaker-pe/install/pe_utils.rb Outdated
@joshcooper

Copy link
Copy Markdown
Contributor

@shubhamshinde360 I think the changes are mostly fine with a few minor comments. Could you add a unit test to pe_utils_spec.rb to verify Host#install_package_from_rpm gets called with the expected url?

I'd probably create a sles 11 host similar to what's done in

let(:unixhost) { make_host( 'unixhost', { :platform => 'linux',
:pe_ver => '3.0',
:type => 'pe',
:working_dir => '/tmp',
:dist => 'puppet-enterprise-3.1.0-rc0-230-g36c9e5c-debian-7-i386' } ) }

Append that host to the list of hosts in

basic_hosts[3][:platform] = 'eos'

Then verify the hosts[4] receives the expected call, similar to how it's handled for macOS and EOS/swix:

expect( subject ).to receive( :on ).with( hosts[2], / hdiutil attach puppet-enterprise-3.0-osx-10.9-x86_64.dmg && installer -pkg \/Volumes\/puppet-enterprise-3.0\/puppet-enterprise-installer-3.0.pkg -target \// ).once
expect( hosts[3] ).to receive( :install_from_file ).with( /swix$/ ).once

Also can you provide details how you're testing this? I was able to do the following. Note I'm explicitly not adding the frictionless role:

#!/bin/bash

export GEM_SOURCE=https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/
export BEAKER_PE_VERSION=file:///home/josh/work/beaker-pe
export UPGRADE_FROM=NONE
export UPGRADE_TO_VERSION=NONE
export pe_version=2021.7.8-rc1-60-g52a023c
export pe_dep_versions=config/versions/pe_version
export MT_COMPAT=true

bundle update
bundle exec beaker-hostgenerator centos7-64mcd-sles11-64a --hypervisor abs --global-config 'ssh={forward_agent=true}' > hosts.cfg
bundle exec beaker init --hosts hosts.cfg \
 --debug \
 --type pe \
 --keyfile ~/.ssh/id_rsa-acceptance \
 --tests acceptance/tests \
 --helper lib/beaker_helper.rb \
 --pre-cleanup acceptance/post \
 --pre-suite setup/install.rb \
 --test-tag-exclude pe_infra_only,security
bundle exec beaker provision
bundle exec beaker exec setup/install.rb

@joshcooper

Copy link
Copy Markdown
Contributor

This needs to land in a beaker-pe 2.x release so that it can be used in PE 2021.7.x pipelines. Only PE 2023 is using beaker-pe because of the password complexity changes.

@joshcooper joshcooper changed the title (PE-37704) Allow for SLES-11 (Intel) builds to be installed in PE for testing (PE-37704) Allow for SLES-11 (Intel) builds to be installed in PE 2021.7.x for testing Mar 19, 2024
@joshcooper

Copy link
Copy Markdown
Contributor

Adding @steveax and @nmburgan for visibility

… testing

  - Define method to install sles-11 rpm from agent-downloads since it is not present in PE.
  - Define rspec to test the above method.
  - Adds a new mock sles11 host to the hosts list for the rspec.
  - Expect get_mco_setting() to be received twice instead of once for the subject, one for osx host (already existed before this commit), another for sles11 host (added in this commit).
@shubhamshinde360

shubhamshinde360 commented Mar 19, 2024

Copy link
Copy Markdown
Contributor Author

Hey @joshcooper,

I was testing this earlier as

Not sure if this is ok. So I also tried using what you have suggested above and it passed too. Thanks!

@joshcooper

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants