(maint) Add acceptance libdir and Util helper module
This commit is contained in:
		
							parent
							
								
									f72b7995fe
								
							
						
					
					
						commit
						132d39066c
					
				|  | @ -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 | ||||||
|  | @ -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 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Will Hopper
						Will Hopper