Skip to content

Commit 3956f16

Browse files
committed
(maint) Handle case where agent and server are on the same host
The test sets the vendormoduledir so that compilation succeeds and expects the agent to fail, since the customtype was never pluginsynced. Override vendormoduledir on the agent so the test works in either case.
1 parent e91e775 commit 3956f16

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

acceptance/tests/agent/agent_fails_with_unknown_resource.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ def refresh
6868
agent.rm_rf(vendor_modules_path)
6969
end
7070

71-
on(agent, puppet('agent', '-t', '--environment', tmp_environment), acceptable_exit_codes: [1]) do |result|
71+
# override vendormoduledir in case agent and server are on the same host
72+
agent_dir = get_test_file_path(agent, 'vendormodulepath')
73+
on(agent, puppet('agent', '-t', '--environment', tmp_environment, '--vendormoduledir', agent_dir), acceptable_exit_codes: [1]) do |result|
7274
assert_match(/Error: Failed to apply catalog: Resource type 'Mycustomtype' was not found/, result.stderr)
7375
end
7476
end

0 commit comments

Comments
 (0)