Skip to content

Commit 84099fd

Browse files
committed
Add boxcutter_ros::build_essential and boxcutter_ros::dev_tools
1 parent 8a1078e commit 84099fd

File tree

12 files changed

+238
-0
lines changed

12 files changed

+238
-0
lines changed

cookbooks/boxcutter_ros/Policyfile.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
# run_list: chef-client will run these recipes in the order specified.
1414
run_list 'boxcutter_ohai', 'boxcutter_init', 'boxcutter_ros_test::default'
15+
named_run_list 'boxcutter_ros_test_build_essential',
16+
'boxcutter_ohai', 'boxcutter_init', 'boxcutter_ros_test::build_essential'
17+
named_run_list 'boxcutter_ros_test_dev_tools',
18+
'boxcutter_ohai', 'boxcutter_init', 'boxcutter_ros_test::dev_tools'
1519

1620
# Specify a custom source for a single cookbook:
1721
cookbook 'boxcutter_ros', path: '.'

cookbooks/boxcutter_ros/kitchen.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,17 @@ suites:
6969
inspec_tests:
7070
- test/integration/default
7171
attributes:
72+
73+
- name: build_essential
74+
named_run_list: boxcutter_ros_test_build_essential
75+
verifier:
76+
inspec_tests:
77+
- test/integration/build_essential
78+
attributes:
79+
80+
- name: dev_tools
81+
named_run_list: boxcutter_ros_test_dev_tools
82+
verifier:
83+
inspec_tests:
84+
- test/integration/dev_tools
85+
attributes:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Cookbook:: boxcutter_ros
3+
# Recipe:: build_essential
4+
#
5+
# Copyright:: 2025, Boxcutter
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
# Includes only the packages that are required for building standalone ROS 2
20+
# packages. ROS developers should use ros::dev_tools instead for the full set
21+
# of recommended tools.
22+
23+
unless node.ubuntu?
24+
raise 'boxcutter_ros is only supported onUbuntu.'
25+
end
26+
27+
%w(
28+
build-essential
29+
cmake
30+
git
31+
python3-pip
32+
).each do |pkg|
33+
package pkg do
34+
action :upgrade
35+
end
36+
end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Cookbook:: boxcutter_ros
3+
# Recipe:: dev_tools
4+
#
5+
# Copyright:: 2025, Boxcutter
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
unless node.ubuntu?
20+
raise 'boxcutter_ros is only supported onUbuntu.'
21+
end
22+
23+
include_recipe 'boxcutter_ros::common'
24+
include_recipe 'boxcutter_ros::build_essential'
25+
26+
%w(
27+
python3-colcon-common-extensions
28+
python3-vcstool
29+
python3-rosdep
30+
).each do |pkg|
31+
package pkg do
32+
action :upgrade
33+
end
34+
end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
# Cookbook:: boxcutter_ros
3+
# Spec:: build_essential
4+
#
5+
# Copyright:: 2025, Boxcutter
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
require 'spec_helper'
20+
21+
describe 'boxcutter_ros::build_essential' do
22+
context 'When all attributes are default, on Ubuntu 20.04' do
23+
# for a complete list of available platforms and versions see:
24+
# https://github.com/chefspec/fauxhai/blob/main/PLATFORMS.md
25+
platform 'ubuntu', '20.04'
26+
27+
it 'converges successfully' do
28+
expect { chef_run }.to_not raise_error
29+
end
30+
end
31+
32+
context 'When all attributes are default, on CentOS 8' do
33+
# for a complete list of available platforms and versions see:
34+
# https://github.com/chefspec/fauxhai/blob/main/PLATFORMS.md
35+
platform 'centos', '8'
36+
37+
it 'converges successfully' do
38+
expect { chef_run }.to_not raise_error
39+
end
40+
end
41+
end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
# Cookbook:: boxcutter_ros
3+
# Spec:: dev_tools
4+
#
5+
# Copyright:: 2025, Boxcutter
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
require 'spec_helper'
20+
21+
describe 'boxcutter_ros::dev_tools' do
22+
context 'When all attributes are default, on Ubuntu 20.04' do
23+
# for a complete list of available platforms and versions see:
24+
# https://github.com/chefspec/fauxhai/blob/main/PLATFORMS.md
25+
platform 'ubuntu', '20.04'
26+
27+
it 'converges successfully' do
28+
expect { chef_run }.to_not raise_error
29+
end
30+
end
31+
32+
context 'When all attributes are default, on CentOS 8' do
33+
# for a complete list of available platforms and versions see:
34+
# https://github.com/chefspec/fauxhai/blob/main/PLATFORMS.md
35+
platform 'centos', '8'
36+
37+
it 'converges successfully' do
38+
expect { chef_run }.to_not raise_error
39+
end
40+
end
41+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Cookbook:: polymath_ros_test
3+
# Recipe:: build_essential
4+
#
5+
include_recipe 'boxcutter_ros::build_essential'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include_recipe 'boxcutter_ros::dev_tools'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Chef InSpec test for recipe polymath_ros::build_essential
2+
3+
# The Chef InSpec reference, with examples and extensive documentation, can be
4+
# found at https://docs.chef.io/inspec/resources/
5+
6+
%w(cmake git python3).each do |tool|
7+
describe command("which #{tool}") do
8+
its('exit_status') { should eq 0 }
9+
its('stdout') { should match %r{^/} } # should return a path like /usr/bin/git
10+
end
11+
12+
describe command("#{tool} --version") do
13+
its('exit_status') { should eq 0 }
14+
end
15+
end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Chef InSpec test for recipe boxcutter_ros::build_essential
2+
3+
# The Chef InSpec reference, with examples and extensive documentation, can be
4+
# found at https://docs.chef.io/inspec/resources/
5+
6+
unless os.windows?
7+
# This is an example test, replace with your own test.
8+
describe user('root'), :skip do
9+
it { should exist }
10+
end
11+
end
12+
13+
# This is an example test, replace it with your own test.
14+
describe port(80), :skip do
15+
it { should_not be_listening }
16+
end

0 commit comments

Comments
 (0)