summaryrefslogtreecommitdiff
path: root/src/leap/eip/tests/test_config.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-14 00:33:05 +0900
committerkali <kali@leap.se>2012-11-14 00:33:05 +0900
commitd24c7328fa845737dbb83d512e4b3f287634c4cc (patch)
treeae0409bd742ce3a6f994ae9bb31fc5ab7225f1c6 /src/leap/eip/tests/test_config.py
parentd2dcf5a1060d60c451570349a6a06ad102d6924c (diff)
make tests pass + pep8
They were breaking mainly because I did not bother to have a pass over them to change the PROVIDER settings from the branding case. All good now, although much testing is yet needed and some refactor could be used. long live green tests!
Diffstat (limited to 'src/leap/eip/tests/test_config.py')
-rw-r--r--src/leap/eip/tests/test_config.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/leap/eip/tests/test_config.py b/src/leap/eip/tests/test_config.py
index 6759b522..50538240 100644
--- a/src/leap/eip/tests/test_config.py
+++ b/src/leap/eip/tests/test_config.py
@@ -18,13 +18,14 @@ from leap.util.fileutil import mkdir_p
_system = platform.system()
-PROVIDER = BRANDING.get('provider_domain')
-PROVIDER_SHORTNAME = BRANDING.get('short_name')
+#PROVIDER = BRANDING.get('provider_domain')
+#PROVIDER_SHORTNAME = BRANDING.get('short_name')
class EIPConfigTest(BaseLeapTest):
__name__ = "eip_config_tests"
+ provider = "testprovider.example.org"
def setUp(self):
pass
@@ -74,7 +75,8 @@ class EIPConfigTest(BaseLeapTest):
args.append('--persist-tun')
args.append('--persist-key')
args.append('--remote')
- args.append('%s' % eipconfig.get_eip_gateway())
+ args.append('%s' % eipconfig.get_eip_gateway(
+ provider=self.provider))
# XXX get port!?
args.append('1194')
# XXX get proto
@@ -103,23 +105,23 @@ class EIPConfigTest(BaseLeapTest):
args.append(os.path.join(
self.home,
'.config', 'leap', 'providers',
- '%s' % PROVIDER,
+ '%s' % self.provider,
'keys', 'client',
'openvpn.pem'))
args.append('--key')
args.append(os.path.join(
self.home,
'.config', 'leap', 'providers',
- '%s' % PROVIDER,
+ '%s' % self.provider,
'keys', 'client',
'openvpn.pem'))
args.append('--ca')
args.append(os.path.join(
self.home,
'.config', 'leap', 'providers',
- '%s' % PROVIDER,
+ '%s' % self.provider,
'keys', 'ca',
- '%s-cacert.pem' % PROVIDER_SHORTNAME))
+ 'cacert.pem'))
return args
# build command string
@@ -141,7 +143,8 @@ class EIPConfigTest(BaseLeapTest):
print 'vpnbin = ', vpnbin
command, args = eipconfig.build_ovpn_command(
do_pkexec_check=False, vpnbin=vpnbin,
- socket_path="/tmp/test.socket")
+ socket_path="/tmp/test.socket",
+ provider=self.provider)
self.assertEqual(command, self.home + '/bin/openvpn')
self.assertEqual(args, self.get_expected_openvpn_args())