Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modify permission for mdata socket

  • Loading branch information...
commit a913a08788d7a571c122738741a6b905c302d7fe 1 parent 996080c
Yukihiko SAWANOBORI sawanoboly authored
6 Gemfile
View
@@ -0,0 +1,6 @@
+# A sample Gemfile
+source "https://rubygems.org"
+
+gem "chef"
+gem "chefspec"
+gem "foodcritic"
18 recipes/mdata_permission.rb
View
@@ -0,0 +1,18 @@
+#
+# Cookbook Name:: smartmachine_functions
+# Recipe:: mdata_permission
+#
+# Copyright 2013, HiganWorks LLC
+#
+# Author: sawanoboriyu@higanworks.com
+# Licence: MIT
+#
+
+directory "/var/run/smartdc" do
+ action :create
+ owner "root"
+ group "root"
+ mode "0700"
+end
+
+
8 spec/default_spec.rb
View
@@ -0,0 +1,8 @@
+require 'chefspec'
+
+describe 'smartmachine_functions::default' do
+ let (:chef_run) { ChefSpec::ChefRunner.new.converge 'smartmachine_functions::default' }
+ it 'should nothing to do' do
+ true
+ end
+end
10 spec/mdata_permission_spec.rb
View
@@ -0,0 +1,10 @@
+require 'chefspec'
+
+describe 'smartmachine_functions::mdata_permission' do
+ let (:chef_run) { ChefSpec::ChefRunner.new.converge 'smartmachine_functions::mdata_permission' }
+ it 'should mdata socket accessing is allowed to root only.' do
+ chef_run.should create_directory '/var/run/smartdc'
+ chef_run.directory('/var/run/smartdc').should be_owned_by('root', 'root')
+ chef_run.directory('/var/run/smartdc').mode.should == "0700"
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.