[DRE-commits] [chef] 04/05: Added dead-simple DEP-8/autppkgtest smoke tests in debian/tests
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Sep 28 00:24:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository chef.
commit cfdc98d503507deaae689363d79c98dfebb1ac76
Author: Antonio Terceiro <terceiro at debian.org>
Date: Sat Sep 27 17:13:56 2014 -0300
Added dead-simple DEP-8/autppkgtest smoke tests in debian/tests
---
debian/changelog | 1 +
debian/tests/config.rb | 2 ++
debian/tests/control | 3 +++
debian/tests/cookbooks/example/recipes/default.rb | 1 +
debian/tests/node.json | 5 +++++
debian/tests/smoke-test | 21 +++++++++++++++++++++
6 files changed, 33 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 1fd1d77..9541da8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,7 @@ chef (11.12.8-1) UNRELEASED; urgency=medium
* Japanese (victory). Closes: #740714
* Italian (Beatrice Torracca). Closes: #740756
* Czech (Michal Simunek). Closes: #751462
+ * Added dead-simple DEP-8/autopkgtest smoke tests in debian/tests
-- Antonio Terceiro <terceiro at debian.org> Sat, 27 Sep 2014 16:38:11 -0300
diff --git a/debian/tests/config.rb b/debian/tests/config.rb
new file mode 100644
index 0000000..8a39866
--- /dev/null
+++ b/debian/tests/config.rb
@@ -0,0 +1,2 @@
+root = File.expand_path(File.dirname(__FILE__))
+cookbook_path root + '/cookbooks'
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..9f6de75
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: smoke-test
+Depends: @, shunit2
+Restrictions: needs-root
diff --git a/debian/tests/cookbooks/example/recipes/default.rb b/debian/tests/cookbooks/example/recipes/default.rb
new file mode 100644
index 0000000..ec81598
--- /dev/null
+++ b/debian/tests/cookbooks/example/recipes/default.rb
@@ -0,0 +1 @@
+package 'vim'
diff --git a/debian/tests/node.json b/debian/tests/node.json
new file mode 100644
index 0000000..0de6113
--- /dev/null
+++ b/debian/tests/node.json
@@ -0,0 +1,5 @@
+{
+ "run_list": [
+ "recipe[example]"
+ ]
+}
diff --git a/debian/tests/smoke-test b/debian/tests/smoke-test
new file mode 100755
index 0000000..d4ebdf0
--- /dev/null
+++ b/debian/tests/smoke-test
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+exec 2>&1
+
+run() {
+ echo '$' "$@"
+ set -e
+ "$@"
+ set +e
+}
+
+run chef-solo -c debian/tests/config.rb -j debian/tests/node.json
+
+echo
+echo '------ testing results of chef-solo run ------'
+
+test_install_package() {
+ assertTrue 'dpkg-query --show vim'
+}
+
+. shunit2
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/chef.git
More information about the Pkg-ruby-extras-commits
mailing list