fix tests so that the explorers are not changed while running tests

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-09-05 13:02:39 +02:00
parent e1fa588a4d
commit 98cdc6c139
5 changed files with 59 additions and 4 deletions

View File

@ -39,9 +39,9 @@ conf_dir = op.join(fixtures, "conf")
class ExplorerClassTestCase(test.CdistTestCase):
def setUp(self):
self.temp_dir = self.mkdtemp()
self.local_path = os.path.join(self.temp_dir, "local")
self.remote_base_path = os.path.join(self.temp_dir, "remote")
self.temp_dir = self.mkdtemp()
self.local_path = os.path.join(self.temp_dir, "local")
self.remote_base_path = os.path.join(self.temp_dir, "remote")
os.makedirs(self.remote_base_path)
self.local = local.Local(

View File

@ -1 +0,0 @@
../../../other/examples/remote/local

3
cdist/test/fixtures/remote/README vendored Normal file
View File

@ -0,0 +1,3 @@
This effectively turns remote calling into local calling.
Probably most useful for the unittesting.

30
cdist/test/fixtures/remote/copy vendored Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
#
# 2012-2013 Nico Schottelius (nico-cdist schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
#
# This is based on other/examples/remote/local/, but uses --dereference for the
# test cases
#
recursive=$1; shift
src=$1; shift
dst=$1; shift
dst=$(echo $dst | sed "s/^${__target_host}://")
cp --dereference "$recursive" "$src" "$dst"

23
cdist/test/fixtures/remote/exec vendored Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
#
# 2012 Nico Schottelius (nico-cdist schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
#
target_host=$1; shift
echo "$@" | /bin/sh