Merge branch 'master' into 4.0-pre-not-stable
This commit is contained in:
commit
32eee3b8e9
8 changed files with 38 additions and 4 deletions
|
@ -16,7 +16,7 @@ This cdist type allows you to setup locales.
|
|||
OPTIONAL PARAMETERS
|
||||
-------------------
|
||||
state::
|
||||
'present' or 'absent'
|
||||
'present' or 'absent', defaults to present
|
||||
|
||||
|
||||
EXAMPLES
|
||||
|
@ -43,5 +43,5 @@ SEE ALSO
|
|||
|
||||
COPYING
|
||||
-------
|
||||
Copyright \(C) 2013 Nico Schottelius. Free use of this software is
|
||||
Copyright \(C) 2013-2014 Nico Schottelius. Free use of this software is
|
||||
granted under the terms of the GNU General Public License version 3 (GPLv3).
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2013 Nico Schottelius (nico-cdist at schottelius.org)
|
||||
# 2013-2014 Nico Schottelius (nico-cdist at schottelius.org)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
|
@ -29,4 +29,9 @@ case "$os" in
|
|||
# Debian needs a seperate package
|
||||
__package locales --state present
|
||||
;;
|
||||
*)
|
||||
echo "Sorry, do not know how to handle os: $os" >&2
|
||||
echo "Please edit the type ${__type##*/} to fix this." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#
|
||||
# 2010-2011 Steven Armstrong (steven-cdist at armstrong.cc)
|
||||
# 2012-2013 Nico Schottelius (nico-cdist at schottelius.org)
|
||||
# 2014 Daniel Heule (hda at sfs.biz)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
|
@ -137,6 +138,22 @@ class ConfigRunTestCase(test.CdistTestCase):
|
|||
with self.assertRaises(cdist.core.cdist_object.MissingObjectIdError):
|
||||
self.config.iterate_until_finished()
|
||||
|
||||
|
||||
def test_dryrun(self):
|
||||
"""Test if the dryrun option is working like expected"""
|
||||
drylocal = cdist.exec.local.Local(
|
||||
target_host=self.target_host,
|
||||
base_path=self.local_dir,
|
||||
#exec_path can not derivated from sys.argv in case of unittest ...
|
||||
exec_path=os.path.abspath(os.path.join(my_dir,'../../../scripts/cdist')),
|
||||
initial_manifest=os.path.join(fixtures, 'manifest/dryrun_manifest'),
|
||||
add_conf_dirs=[ fixtures ] )
|
||||
|
||||
dryrun = cdist.config.Config(drylocal, self.remote, dry_run=True)
|
||||
dryrun.run()
|
||||
# if we are here, dryrun works like expected
|
||||
|
||||
|
||||
# Currently the resolving code will simply detect that this object does
|
||||
# not exist. It should probably check if the type is a singleton as well
|
||||
# - but maybe only in the emulator - to be discussed.
|
||||
|
|
1
cdist/test/config/fixtures/manifest/dryrun_manifest
Normal file
1
cdist/test/config/fixtures/manifest/dryrun_manifest
Normal file
|
@ -0,0 +1 @@
|
|||
__dryrun_test testit
|
0
cdist/test/config/fixtures/type/__dryrun_test/.keep
Normal file
0
cdist/test/config/fixtures/type/__dryrun_test/.keep
Normal file
|
@ -0,0 +1,3 @@
|
|||
# this type is only for testing the dryrun feature, it does nothing usefull
|
||||
echo 'echo "This gencode-local script should never be executed >&2"'
|
||||
echo 'exit 1'
|
|
@ -0,0 +1,3 @@
|
|||
# this type is only for testing the dryrun feature, it does nothing usefull
|
||||
echo 'echo "this gencode-remote script should never be executed >&2"'
|
||||
echo 'exit 1'
|
|
@ -9,8 +9,13 @@ Changelog
|
|||
* Core: Integrate initial preos support
|
||||
|
||||
|
||||
3.0.8:
|
||||
3.0.9:
|
||||
* Type __locale: Error out in case of unsupported OS
|
||||
|
||||
3.0.8: 2014-02-11
|
||||
* Core: Enhance object id verification (Daniel Heule)
|
||||
* Core: Add unit tests for dependencies based on execution order (Daniel Heule)
|
||||
* Core: Add unit tests for dry run (Daniel Heule)
|
||||
|
||||
3.0.7: 2014-02-08
|
||||
* Core: Allow dependencies to be created based execution order (Daniel Heule)
|
||||
|
|
Loading…
Reference in a new issue