From 2ac89832b7e065df4490d81b3080b2b570a172ad Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Mon, 9 Jul 2018 17:15:39 -0700 Subject: Initial host import from puppet#ee7cf4d28077be7d1bdbbe934ea012d41d33deff --- spec/acceptance/tests/should_create_aliases.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 spec/acceptance/tests/should_create_aliases.rb (limited to 'spec/acceptance/tests/should_create_aliases.rb') diff --git a/spec/acceptance/tests/should_create_aliases.rb b/spec/acceptance/tests/should_create_aliases.rb new file mode 100644 index 0000000..be4a134 --- /dev/null +++ b/spec/acceptance/tests/should_create_aliases.rb @@ -0,0 +1,24 @@ +test_name "host should create aliases" + +tag 'audit:low', + 'audit:refactor', # Use block style `test_name` + 'audit:acceptance' # Could be done at the integration (or unit) layer though + # actual changing of resources could irreparably damage a + # host running this, or require special permissions. + +agents.each do |agent| + target = agent.tmpfile('host-create-aliases') + + step "clean up the system for testing" + on agent, "rm -f #{target}" + + step "create the record" + on(agent, puppet_resource('host', 'test', "ensure=present", + "ip=127.0.0.7", "target=#{target}", "host_aliases=alias")) + + step "verify that the aliases were added" + on(agent, "cat #{target} ; rm -f #{target}") do + fail_test "alias was missing" unless + stdout =~ /^127\.0\.0\.7[[:space:]]+test[[:space:]]alias/ + end +end -- cgit v1.2.3