spec/integration/recipes/default.rb in itamae-1.9.9 vs spec/integration/recipes/default.rb in itamae-1.9.10

- old
+ new

@@ -171,10 +171,17 @@ file "/tmp/file" do content "Hello World" mode "777" end +file "/tmp/file_with_suid" do + content "Hello World" + mode "4755" + owner "itamae" + group "itamae" +end + execute "echo 'Hello Execute' > /tmp/execute" file "/tmp/never_exist1" do only_if "exit 1" end @@ -260,10 +267,26 @@ link "/tmp-link-force" do to "/tmp" force true end +###### + +execute "mkdir /tmp/link-force-no-dereference1" +link "link-force-no-dereference" do + cwd "/tmp" + to "link-force-no-dereference1" + force true +end + +execute "mkdir /tmp/link-force-no-dereference2" +link "link-force-no-dereference" do + cwd "/tmp" + to "link-force-no-dereference2" + force true +end + ##### local_ruby_block "greeting" do block do Itamae.logger.info "板前" @@ -282,10 +305,15 @@ git "/tmp/git_repo_submodule" do repository "https://github.com/mmasaki/fake_repo_including_submodule.git" recursive true end +git "/tmp/git_repo_depth_1" do + repository "https://github.com/ryotarai/infrataster.git" + depth 1 +end + ##### execute "echo -n \"$HOME\n$(pwd)\" > /tmp/created_by_itamae_user" do user "itamae" end @@ -409,10 +437,24 @@ content.gsub!('world', 'Itamae') end notifies :run, "execute[echo -n 1 > /tmp/file_edit_notifies]" end +file '/tmp/file_edit_with_suid' do + content 'Hello, world' + owner 'itamae' + group 'itamae' + mode '600' +end + +file '/tmp/file_edit_with_suid' do + action :edit + owner 'itamae2' + group 'itamae2' + mode '4755' +end + file '/tmp/file_edit_keeping_mode_owner' do content 'Hello, world' owner 'itamae' group 'itamae' mode '444' @@ -505,14 +547,20 @@ raise "run_command in local_ruby_block failed" end end end +execute "touch /tmp/subscribed_from_parent" do + action :nothing + subscribes :run, 'execute[subscribed from parent]' +end + ### v1 = node.memory.total v2 = node[:memory][:total] v3 = node['memory']['total'] unless v1 == v2 && v2 == v3 && v1 =~ /\A\d+kB\z/ raise "failed to fetch host inventory value (#{v1}, #{v2}, #{v3})" end +