summaryrefslogtreecommitdiffstats
path: root/testsuite/Testsrc
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-02-05 14:04:09 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-02-05 14:04:09 -0500
commit25cb6db5ccb0c8e8302c220a90344a95baf3909b (patch)
tree80d6a81f2dcd164f0b127bdfe75a4b2d833c6be6 /testsuite/Testsrc
parent5d237f71575a109c10d5aad8d70dc5dda00a2d96 (diff)
downloadbcfg2-25cb6db5ccb0c8e8302c220a90344a95baf3909b.tar.gz
bcfg2-25cb6db5ccb0c8e8302c220a90344a95baf3909b.tar.bz2
bcfg2-25cb6db5ccb0c8e8302c220a90344a95baf3909b.zip
moved some libraries in Bcfg2/ into more specific (Server/ or Client/) places
Diffstat (limited to 'testsuite/Testsrc')
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestEncryption.py (renamed from testsuite/Testsrc/Testlib/TestEncryption.py)4
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py8
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py7
-rw-r--r--testsuite/Testsrc/test_code_checks.py5
4 files changed, 13 insertions, 11 deletions
diff --git a/testsuite/Testsrc/Testlib/TestEncryption.py b/testsuite/Testsrc/Testlib/TestServer/TestEncryption.py
index f8fcaa98d..8f69f3bf0 100644
--- a/testsuite/Testsrc/Testlib/TestEncryption.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestEncryption.py
@@ -16,7 +16,7 @@ while path != "/":
from common import *
try:
- from Bcfg2.Encryption import *
+ from Bcfg2.Server.Encryption import *
HAS_CRYPTO = True
except ImportError:
HAS_CRYPTO = False
@@ -124,7 +124,7 @@ baz
dict(foo="passphrase",
bar="passphrase"))
- @patch("Bcfg2.Encryption.get_passphrases")
+ @patch("Bcfg2.Server.Encryption.get_passphrases")
def test_bruteforce_decrypt(self, mock_passphrases):
passwd = "a simple passphrase"
crypted = ssl_encrypt(self.plaintext, passwd)
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py
index 0d44e7284..9eb584e90 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py
@@ -23,7 +23,7 @@ from TestServer.TestPlugin.Testbase import TestPlugin, TestDebuggable
from TestServer.TestPlugin.Testinterfaces import TestGenerator
try:
- from Bcfg2.Encryption import EVPError
+ from Bcfg2.Server.Encryption import EVPError
HAS_CRYPTO = True
except:
HAS_CRYPTO = False
@@ -766,9 +766,9 @@ class TestStructFile(TestXMLFileBacked):
[call(el) for el in sf.xdata.xpath("//*[@encrypted]")])
@skipUnless(HAS_CRYPTO, "No crypto libraries found, skipping")
- @patchIf(HAS_CRYPTO, "Bcfg2.Encryption.ssl_decrypt")
- @patchIf(HAS_CRYPTO, "Bcfg2.Encryption.get_passphrases")
- @patchIf(HAS_CRYPTO, "Bcfg2.Encryption.bruteforce_decrypt")
+ @patchIf(HAS_CRYPTO, "Bcfg2.Server.Encryption.ssl_decrypt")
+ @patchIf(HAS_CRYPTO, "Bcfg2.Server.Encryption.get_passphrases")
+ @patchIf(HAS_CRYPTO, "Bcfg2.Server.Encryption.bruteforce_decrypt")
def test_decrypt(self, mock_bruteforce, mock_get_passphrases, mock_ssl):
sf = self.get_obj()
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py
index bf34d4c3c..2982825a9 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgPrivateKeyCreator.py
@@ -7,7 +7,7 @@ from Bcfg2.Server.Plugins.Cfg.CfgPrivateKeyCreator import *
from Bcfg2.Server.Plugin import PluginExecutionError
import Bcfg2.Server.Plugins.Cfg.CfgPrivateKeyCreator
try:
- from Bcfg2.Encryption import EVPError
+ from Bcfg2.Server.Encryption import EVPError
HAS_CRYPTO = True
except:
HAS_CRYPTO = False
@@ -66,7 +66,8 @@ class TestCfgPrivateKeyCreator(TestCfgCreator, TestStructFile):
pkc.setup.cfp.get.assert_called_with("sshkeys", "category")
@skipUnless(HAS_CRYPTO, "No crypto libraries found, skipping")
- @patchIf(HAS_CRYPTO, "Bcfg2.Encryption.get_passphrases")
+ @patchIf(HAS_CRYPTO,
+ "Bcfg2.Server.Plugins.Cfg.CfgPrivateKeyCreator.get_passphrases")
def test_passphrase(self, mock_get_passphrases):
pkc = self.get_obj()
pkc.setup = Mock()
@@ -281,7 +282,7 @@ class TestCfgPrivateKeyCreator(TestCfgCreator, TestStructFile):
if HAS_CRYPTO:
@patch(passphrase, "foo")
- @patch("Bcfg2.Encryption.ssl_encrypt")
+ @patch("Bcfg2.Server.Plugins.Cfg.CfgPrivateKeyCreator.ssl_encrypt")
def inner2(mock_ssl_encrypt):
reset()
mock_ssl_encrypt.return_value = "encryptedprivatekey"
diff --git a/testsuite/Testsrc/test_code_checks.py b/testsuite/Testsrc/test_code_checks.py
index 323f64f49..73ffe954a 100644
--- a/testsuite/Testsrc/test_code_checks.py
+++ b/testsuite/Testsrc/test_code_checks.py
@@ -58,8 +58,9 @@ contingent_checks = {
# perform only error checking on the listed files
error_checks = {
"sbin": ["bcfg2-reports"],
- "lib/Bcfg2": ["Proxy.py", "SSLServer.py", "Reporting"],
- "lib/Bcfg2/Server": ["Reports", "SchemaUpdater"],
+ "lib/Bcfg2": ["Reporting"],
+ "lib/Bcfg2/Client": ["Proxy.py"],
+ "lib/Bcfg2/Server": ["Reports", "SchemaUpdater", "SSLServer.py"],
"lib/Bcfg2/Server/Admin": ["Compare.py"],
"lib/Bcfg2/Client/Tools": ["launchd.py",
"OpenCSW.py",