Skip to content

Commit

Permalink
Merge pull request #34 from lsst-it/IT-5556/daqsdk-R5-V10.3
Browse files Browse the repository at this point in the history
add support for daqsdk >= R5-V10
  • Loading branch information
jhoblitt committed Aug 1, 2024
2 parents 59f79f0 + cc82081 commit 04ee3ec
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

inherit_gem:
voxpupuli-test: rubocop.yml
RSpec/RepeatedExampleGroupBody:
Enabled: false
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Data type: `String`

DAQ SDK relase version string

Default value: `'R5-V3.2'`
Default value: `'R5-V10.3'`

##### <a name="-daq--daqsdk--purge"></a>`purge`

Expand Down
2 changes: 1 addition & 1 deletion manifests/daqsdk.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
class daq::daqsdk (
Stdlib::HTTPUrl $repo_url = 'https://repo-nexus.lsst.org/nexus/repository/daq/daq-sdk',
String $version = 'R5-V3.2',
String $version = 'R5-V10.3',
Boolean $purge = false,
) {
require daq
Expand Down
30 changes: 19 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,30 @@
},
})

# XXX The current dsid/rce service binaries are linked against
# libreadline.so.6, which does not exist in EL8+. error while loading shared
# libraries: libreadline.so.6: cannot open shared object file: No such file or
# directory
if fact('os.family') == 'RedHat' and versioncmp(fact('os.release.major'), '8') >= 0 {
$readline = fact('os.release.major') ? {
if fact('os.family') == 'RedHat' {
# XXX daqsdk < V10 is linked against libreadline.so.6, which does not
# exist in EL8+. While daqsdk >= V10 is linked against libreadline.so.7.
$os_readline = fact('os.release.major') ? {
'8' => 'libreadline.so.7.0',
'9' => 'libreadline.so.8.1',
default => 'libreadline.so.8.1',
}

file { '/usr/lib64/libreadline.so.6':
ensure => link,
owner => 'root',
group => 'root',
target => $readline,
$legacy_readline_versions = fact('os.release.major') ? {
# EL8 natively has libreadline.so.7
'8' => ['6'],
# EL9+
'9' => ['6', '7'],
default => ['6', '7'],
}

$legacy_readline_versions.each |$v| {
file { "/usr/lib64/libreadline.so.${v}":
ensure => link,
owner => 'root',
group => 'root',
target => $os_readline,
}
}
}
}
17 changes: 16 additions & 1 deletion spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,27 @@
it { is_expected.to be_mode '755' } # serverspec does not like a leading 0
end

if fact('os.release.major') == '8'
case fact('os.release.major')
when '8'
describe file('/usr/lib64/libreadline.so.6') do
it { is_expected.to be_symlink }
it { is_expected.to be_linked_to 'libreadline.so.7.0' }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
end
when '9'
describe file('/usr/lib64/libreadline.so.6') do
it { is_expected.to be_symlink }
it { is_expected.to be_linked_to 'libreadline.so.8.1' }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
end

describe file('/usr/lib64/libreadline.so.7') do
it { is_expected.to be_symlink }
it { is_expected.to be_linked_to 'libreadline.so.8.1' }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
end
end
end
16 changes: 8 additions & 8 deletions spec/acceptance/daqsdk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
%w[
/opt/lsst/daq-sdk
/opt/lsst/daq-sdk/dl
/opt/lsst/daq-sdk/R5-V3.2
/opt/lsst/daq-sdk/R5-V3.2/alinux
/opt/lsst/daq-sdk/R5-V3.2/examples
/opt/lsst/daq-sdk/R5-V3.2/include
/opt/lsst/daq-sdk/R5-V3.2/rtems
/opt/lsst/daq-sdk/R5-V3.2/x86
/opt/lsst/daq-sdk/R5-V10.3
/opt/lsst/daq-sdk/R5-V10.3/alinux
/opt/lsst/daq-sdk/R5-V10.3/examples
/opt/lsst/daq-sdk/R5-V10.3/include
/opt/lsst/daq-sdk/R5-V10.3/rtems
/opt/lsst/daq-sdk/R5-V10.3/x86
].each do |dir|
describe file(dir) do
it { is_expected.to be_directory }
Expand All @@ -31,12 +31,12 @@

describe file('/opt/lsst/daq-sdk/current') do
it { is_expected.to be_symlink }
it { is_expected.to be_linked_to 'R5-V3.2' }
it { is_expected.to be_linked_to 'R5-V10.3' }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
end

describe file('/opt/lsst/daq-sdk/dl/R5-V3.2.tgz') do
describe file('/opt/lsst/daq-sdk/dl/R5-V10.3.tgz') do
it { is_expected.to be_file }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/daqsdk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
end

it do
is_expected.to contain_archive('/opt/lsst/daq-sdk/dl/R5-V3.2.tgz').with(
source: 'https://repo-nexus.lsst.org/nexus/repository/daq/daq-sdk/R5-V3.2.tgz'
is_expected.to contain_archive('/opt/lsst/daq-sdk/dl/R5-V10.3.tgz').with(
source: 'https://repo-nexus.lsst.org/nexus/repository/daq/daq-sdk/R5-V10.3.tgz'
)
end

it do
is_expected.to contain_file('/opt/lsst/daq-sdk/dl/R5-V3.2.tgz').with(
is_expected.to contain_file('/opt/lsst/daq-sdk/dl/R5-V10.3.tgz').with(
ensure: 'file',
mode: '0644',
owner: 'root',
Expand All @@ -49,7 +49,7 @@
end

it do
is_expected.to contain_file('/opt/lsst/daq-sdk/R5-V3.2').with(
is_expected.to contain_file('/opt/lsst/daq-sdk/R5-V10.3').with(
owner: 'root',
group: 'root',
recurse: true
Expand All @@ -61,7 +61,7 @@
ensure: 'link',
owner: 'root',
group: 'root',
target: 'R5-V3.2'
target: 'R5-V10.3'
)
end
end
Expand Down

0 comments on commit 04ee3ec

Please sign in to comment.