Browse Source

Assert directory ownership (pending).

Andrea Campi 11 years ago
parent
commit
bf83f68890

+ 1 - 0
test/features/basic_app.feature

@@ -10,4 +10,5 @@ I want to deploy a basic application
     Then the "/var/www/basic_app" directory should exist
     And the "/var/www/basic_app/shared" directory should exist
     And the "/var/www/basic_app/releases/0b60046431d14b6615d53ae6d8bd0ac62ae3eb6f" directory should exist
+    And it should be owned by nobody with group daemon
     And "/var/www/basic_app/current" should be a symlink to "/var/www/basic_app/releases/0b60046431d14b6615d53ae6d8bd0ac62ae3eb6f"

+ 4 - 0
test/features/step_definitions/app_steps.rb

@@ -6,6 +6,10 @@ Then /^the "?(.+?)"? directory should exist$/ do |dir_name|
   assert File.directory?(dir_name), "File.directory?(#{dir_name}) = #{File.directory?(dir_name)}"
 end
 
+Then /^it should be owned by (.+?) with group (.+?)$/ do |owner, group|
+  # TODO
+end
+
 Then /^"?(.+?)"? should be a symlink to "?(.+?)"$/ do |link, target|
   assert File.symlink?(link)
   assert_equal target, File.readlink(link)

+ 2 - 0
test/kitchen/cookbooks/application_test/attributes/default.rb

@@ -18,3 +18,5 @@
 #
 
 default['application_test']['root_dir'] = '/var/www'
+default['application_test']['owner']    = 'nobody'
+default['application_test']['group']    = 'daemon'

+ 2 - 0
test/kitchen/cookbooks/application_test/recipes/basic_app.rb

@@ -26,4 +26,6 @@ application app_name do
   repository  "https://github.com/h5bp/html5-boilerplate.git"
   revision    "0b60046431d14b6615d53ae6d8bd0ac62ae3eb6f"  # v4.0.0 tag
   path        app_dir
+  owner       node['application_test']['owner']
+  group       node['application_test']['group']
 end