Skip to content

Commit

Permalink
Update crates for pallet 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoduncan committed Aug 9, 2011
1 parent 4f4b6f1 commit 236b4c9
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
clojure.test
pallet.test-utils))

(use-fixtures :once with-ubuntu-script-template)
(use-fixtures :once with-ubuntu-script-template with-bash-script-language)

(deftest cruise-control-rb-job-test
(is (= (stevedore/checked-script
Expand Down
12 changes: 8 additions & 4 deletions hudson/test/pallet/crate/hudson_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@

(def parameters {:host
{:id
{:tomcat {:owner "tomcat6"
:group "tomcat6"
:config-path "/etc/tomcat6/"
:base "/var/lib/tomcat6/"}}}})
{:tomcat
{:default
{:owner "tomcat6"
:group "tomcat6"
:config-path "/etc/tomcat6/"
:base "/var/lib/tomcat6/"
:deploy "/var/lib/tomcat6/webapps"}}}}})

(deftest hudson-tomcat-test
(is (= (first
(build-actions/build-actions
Expand Down
2 changes: 1 addition & 1 deletion iptables/test/pallet/crate/iptables_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(:use clojure.test
pallet.test-utils))

(use-fixtures :once with-ubuntu-script-template)
(use-fixtures :once with-ubuntu-script-template with-bash-script-language)

(def remote-file* (action/action-fn remote-file/remote-file-action))

Expand Down
5 changes: 4 additions & 1 deletion nagios/test/pallet/crate/nagios_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
[clojure.string :as string])
(:use clojure.test))

(use-fixtures :once test-utils/with-ubuntu-script-template)
(use-fixtures
:once
test-utils/with-ubuntu-script-template
test-utils/with-bash-script-language)

(def remote-file* (action/action-fn remote-file/remote-file-action))

Expand Down
2 changes: 1 addition & 1 deletion resolv/test/pallet/crate/resolv_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(:require
[pallet.build-actions :as build-actions]))

(use-fixtures :once with-ubuntu-script-template)
(use-fixtures :once with-ubuntu-script-template with-bash-script-language)

(with-private-vars [pallet.crate.resolv
[write-key-value write-option write-options write
Expand Down
5 changes: 2 additions & 3 deletions rubygems/test/pallet/crate/rubygems_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
[pallet.stevedore :as stevedore])
(:use
clojure.test
pallet.test-utils
))
pallet.test-utils))

(use-fixtures :once with-ubuntu-script-template)
(use-fixtures :once with-ubuntu-script-template with-bash-script-language)

(deftest gem-script-test
(is (= "gem install fred"
Expand Down
6 changes: 5 additions & 1 deletion ssh-key/test/pallet/crate/ssh_key_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
(var auth_file
"$(getent passwd fred | cut -d: -f6)/.ssh/authorized_keys")
(if-not (fgrep (quoted "key1") @auth_file)
(echo (quoted "key1") ">>" @auth_file)))))
(echo (quoted "key1") ">>" @auth_file)))
(exec-script/exec-checked-script
"Set selinux permissions"
(~lib/selinux-file-type
"$(getent passwd fred | cut -d: -f6)/.ssh" "user_home_t"))))
(first
(build-actions/build-actions
{}
Expand Down
23 changes: 16 additions & 7 deletions tomcat/test/pallet/crate/tomcat_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
clojure.test
pallet.test-utils))

(use-fixtures :once with-ubuntu-script-template)
(use-fixtures :once with-ubuntu-script-template with-bash-script-language)

(deftest install-test
(is (= (first
Expand All @@ -37,7 +37,7 @@
(package/package-manager :update)
(package/package "tomcat6")
(directory/directory
(stevedore/script (user-home "tomcat6"))
(stevedore/script (~lib/user-home "tomcat6"))
:owner "tomcat6" :group "tomcat6" :mode "0755")
(exec-script/exec-checked-script
"Check tomcat is at /var/lib/tomcat6/"
Expand Down Expand Up @@ -70,14 +70,17 @@
(build-actions/build-actions
{:parameters
{:host {:id {:tomcat
{:default {:base "/p/" :owner "o" :group "g"}}}}}}
{:default {:base "/p/" :deploy "/p/webapps"
:owner "o" :group "g"}}}}}}
(tomcat/deploy nil :remote-file "file.war"))))))

(deftest tomcat-undeploy-all-test
(is (= "rm -r -f /p/webapps/*\n"
(first
(build-actions/build-actions
{:parameters {:host {:id {:tomcat {:default {:base "/p/"}}}}}}
{:parameters
{:host {:id {:tomcat {:default
{:base "/p/" :deploy "/p/webapps"}}}}}}
(tomcat/undeploy-all))))))

(deftest tomcat-undeploy-test
Expand All @@ -88,7 +91,9 @@
(file/file "/p/webapps/ROOT.war" :action :delete)))
(first
(build-actions/build-actions
{:parameters {:host {:id {:tomcat {:default {:base "/p/"}}}}}}
{:parameters
{:host {:id {:tomcat {:default {:base "/p/"
:deploy "/p/webapps"}}}}}}
(tomcat/undeploy nil)))))
(is (= (first
(build-actions/build-actions
Expand All @@ -97,7 +102,9 @@
(file/file "/p/webapps/app.war" :action :delete)))
(first
(build-actions/build-actions
{:parameters {:host {:id {:tomcat {:default {:base "/p/"}}}}}}
{:parameters
{:host {:id {:tomcat {:default {:base "/p/"
:deploy "/p/webapps"}}}}}}
(tomcat/undeploy :app)))))
(is (= (first
(build-actions/build-actions
Expand All @@ -106,7 +113,9 @@
(file/file "/p/webapps/foo.war" :action :delete)))
(first
(build-actions/build-actions
{:parameters {:host {:id {:tomcat {:default {:base "/p/"}}}}}}
{:parameters
{:host {:id {:tomcat {:default {:base "/p/"
:deploy "/p/webapps"}}}}}}
(tomcat/undeploy "foo"))))))

(deftest tomcat-policy-test
Expand Down

0 comments on commit 236b4c9

Please sign in to comment.