Skip to content

Commit

Permalink
Merge pull request #1134 from lsst-it/IT-5290_udev_rule_spectrograph
Browse files Browse the repository at this point in the history
(profile::core::fiberspec) add spectrometer udev rule
  • Loading branch information
dtapiacl authored Apr 29, 2024
2 parents 5656bd5 + c5165fd commit 7ecdc84
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hieradata/role/fiberspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
classes:
- "profile::core::common"
- "profile::core::fiberspec"
10 changes: 10 additions & 0 deletions site/profile/manifests/core/fiberspec.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @summary
# Manages Avantes Fiberspectrometer USB devices.
#
class profile::core::fiberspec {
systemd::udev::rule { 'fiberspec.rules':
rules => [
"SUBSYSTEM==\"usb\", ATTR{idVendor}==\"1992\", ATTR{idProduct}==\"0667\", ACTION==\"add\", GROUP=\"saluser\", MODE=\"0664\"",
],
}
}
15 changes: 15 additions & 0 deletions spec/classes/core/fiberspec_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'profile::core::fiberspec' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }

include_examples 'fiberspec'
end
end
end
11 changes: 11 additions & 0 deletions spec/support/spec/fiberspec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

shared_examples 'fiberspec' do
it do
is_expected.to contain_systemd__udev__rule('fiberspec.rules').with(
rules: [
'SUBSYSTEM=="usb", ATTR{idVendor}=="1992", ATTR{idProduct}=="0667", ACTION=="add", GROUP="saluser", MODE="0664"',
],
)
end
end

0 comments on commit 7ecdc84

Please sign in to comment.