-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new way to test library functionality for decrement
- Loading branch information
1 parent
080fb92
commit 6db835e
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
client_id = ENV['FALCON_CLIENT_ID'] | ||
client_secret = ENV['FALCON_CLIENT_SECRET'] | ||
falcon_cloud = ENV['FALCON_CLOUD'] | ||
sensor_tmp_dir = '/tmp' | ||
|
||
falcon_install 'falcon' do | ||
client_id ENV['FALCON_CLIENT_ID'] | ||
client_secret ENV['FALCON_CLIENT_SECRET'] | ||
falcon_cloud ENV['FALCON_CLOUD'] | ||
client_id client_id | ||
client_secret client_secret | ||
falcon_cloud falcon_cloud | ||
version_decrement 2 | ||
action :install | ||
end | ||
|
||
# Use the helpers library to get the version of the requested package | ||
::Chef::DSL::Recipe.send(:include, ChefFalcon::Helpers) | ||
|
||
sensor_info = sensor_download_info(client_id, client_secret, { | ||
version_decrement: 2, | ||
sensor_tmp_dir: sensor_tmp_dir, | ||
falcon_cloud: falcon_cloud, | ||
}) | ||
|
||
file "#{sensor_tmp_dir}/version" do | ||
content sensor_info['version'] | ||
end | ||
|
||
include_recipe 'test::common' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
# Include common controls | ||
include_controls 'common' | ||
|
||
# TODO: Figure out how to get sensor version from API | ||
# We want to ensure the package version installed matches the version we expect | ||
# from the /tmp/version file | ||
sensor_tmp_dir = '/tmp' | ||
sensor_version_file = File.join(sensor_tmp_dir, 'version') | ||
|
||
describe package('falcon-sensor') do | ||
its('version') { should match file(sensor_version_file).content.strip } | ||
end |