Skip to content

Commit

Permalink
allow current symlinks to be manually updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed Nov 15, 2023
1 parent fcd6751 commit e6070a5
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 8 deletions.
9 changes: 5 additions & 4 deletions manifests/daqsdk.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@
}

file { $current_path:
ensure => link,
owner => 'root',
group => 'root',
target => $version,
ensure => link,
owner => 'root',
group => 'root',
target => $version,
replace => false,
}
}
9 changes: 5 additions & 4 deletions manifests/rptsdk.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@
}

file { $current_path:
ensure => link,
owner => 'root',
group => 'root',
target => $version,
ensure => link,
owner => 'root',
group => 'root',
target => $version,
replace => false,
}
}
26 changes: 26 additions & 0 deletions spec/acceptance/daqsdk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,30 @@
it { is_expected.to be_grouped_into 'root' }
it { is_expected.to be_mode '644' } # serverspec does not like a leading 0
end

context '/opt/lsst/daq-sdk/current symlink manually changed' do
let(:manifest) do
<<-PP
include daq::daqsdk
PP
end

before(:context) do
shell('ln -snf /tmp /opt/lsst/daq-sdk/current')
end

after(:context) do
# cleanup so as not to break other tests
shell('rm -rf /opt/lsst/daq-sdk/current')
end

it_behaves_like 'an idempotent resource'

describe file('/opt/lsst/daq-sdk/current') do
it { is_expected.to be_symlink }
it { is_expected.to be_linked_to '/tmp' }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
end
end
end
26 changes: 26 additions & 0 deletions spec/acceptance/rptsdk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,30 @@
it { is_expected.to be_grouped_into 'root' }
it { is_expected.to be_mode '644' } # serverspec does not like a leading 0
end

context '/opt/lsst/rpt-sdk/current symlink manually changed' do
let(:manifest) do
<<-PP
include daq::rptsdk
PP
end

before(:context) do
shell('ln -snf /tmp /opt/lsst/rpt-sdk/current')
end

after(:context) do
# cleanup so as not to break other tests
shell('rm -rf /opt/lsst/rpt-sdk/current')
end

it_behaves_like 'an idempotent resource'

describe file('/opt/lsst/rpt-sdk/current') do
it { is_expected.to be_symlink }
it { is_expected.to be_linked_to '/tmp' }
it { is_expected.to be_owned_by 'root' }
it { is_expected.to be_grouped_into 'root' }
end
end
end

0 comments on commit e6070a5

Please sign in to comment.