diff options
author | Josh Cooper <josh@puppet.com> | 2018-07-09 22:30:55 -0700 |
---|---|---|
committer | Josh Cooper <josh@puppet.com> | 2018-07-10 11:03:14 -0700 |
commit | fa61bde37d75c0482d0a0d8822d635a1bc02662b (patch) | |
tree | dfcc296fe48ae82e3cb5674f1119ba8ebd4616f8 /spec/acceptance/tests/create_spec.rb | |
parent | 9c626516d265d7b3aa7bee08f23be6a36a3d8280 (diff) | |
download | puppet-hosts_core-fa61bde37d75c0482d0a0d8822d635a1bc02662b.tar.gz puppet-hosts_core-fa61bde37d75c0482d0a0d8822d635a1bc02662b.tar.bz2 |
Rename beaker tests to end with _spec
Diffstat (limited to 'spec/acceptance/tests/create_spec.rb')
-rw-r--r-- | spec/acceptance/tests/create_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/acceptance/tests/create_spec.rb b/spec/acceptance/tests/create_spec.rb new file mode 100644 index 0000000..3ce34e8 --- /dev/null +++ b/spec/acceptance/tests/create_spec.rb @@ -0,0 +1,23 @@ +test_name 'host should create' + +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') + + step 'clean up for the test' + on agent, "rm -f #{target}" + + step 'create the host record' + on(agent, puppet_resource('host', 'test', 'ensure=present', + 'ip=127.0.0.1', "target=#{target}")) + + step 'verify that the record was created' + on(agent, "cat #{target} ; rm -f #{target}") do + fail_test 'record was not present' unless stdout =~ %r{^127\.0\.0\.1[[:space:]]+test} + end +end |