(maint) Add acceptance libdir and Util helper module

This commit is contained in:
Will Hopper 2016-09-30 16:28:57 -07:00
parent f72b7995fe
commit 132d39066c
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,15 @@
module PuppetStrings
module Acceptance
module Util
def read_file_on(host, filename)
on(host, "cat #{filename}").stdout
end
def get_test_module_path(host, module_regex)
modules = JSON.parse(on(host, puppet('module', 'list', '--render-as', 'json')).stdout)
test_module_info = modules['modules_by_path'].values.flatten.find { |mod_info| mod_info =~ module_regex }
test_module_info.match(/\(([^)]*)\)/)[1]
end
end
end
end

View File

@ -1,6 +1,8 @@
require 'beaker-rspec/spec_helper' require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec' require 'beaker-rspec/helpers/serverspec'
$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'acceptance/lib'))
unless ENV['RS_PROVISION'] == 'no' unless ENV['RS_PROVISION'] == 'no'
install_puppet install_puppet
end end