diff --git a/cdist/test/explorer/__init__.py b/cdist/test/explorer/__init__.py index b0e4b24c..92ef75a3 100644 --- a/cdist/test/explorer/__init__.py +++ b/cdist/test/explorer/__init__.py @@ -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( diff --git a/cdist/test/fixtures/remote b/cdist/test/fixtures/remote deleted file mode 120000 index c5db6358..00000000 --- a/cdist/test/fixtures/remote +++ /dev/null @@ -1 +0,0 @@ -../../../other/examples/remote/local \ No newline at end of file diff --git a/cdist/test/fixtures/remote/README b/cdist/test/fixtures/remote/README new file mode 100644 index 00000000..cfd350f9 --- /dev/null +++ b/cdist/test/fixtures/remote/README @@ -0,0 +1,3 @@ +This effectively turns remote calling into local calling. + +Probably most useful for the unittesting. diff --git a/cdist/test/fixtures/remote/copy b/cdist/test/fixtures/remote/copy new file mode 100755 index 00000000..a5b5fe6f --- /dev/null +++ b/cdist/test/fixtures/remote/copy @@ -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 . +# +# +# 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" diff --git a/cdist/test/fixtures/remote/exec b/cdist/test/fixtures/remote/exec new file mode 100755 index 00000000..838513a9 --- /dev/null +++ b/cdist/test/fixtures/remote/exec @@ -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 . +# +# + +target_host=$1; shift +echo "$@" | /bin/sh